KePOS is a 64-bit operating system. The purpose of this system is to combine the theoretical knowledge and practice of the operating system, and to deepen the understanding of the operating system. kePOS is suitable for people who want to understand the basic implementation of modern operating systems. It is also suitable for people who want to understand how user mode programs (compile -> link -> run on the operating system), how to switch processes, and how system calls enter the kernel and return.
KePOS implements what modern operating systems involve: memory management, device management (keyboard, mouse), interrupt and exception handling, multi-process, GUI, system calls; due to time constraints, KePOS does not implement a file system, and may be implemented later.
If you want to run KePOS or read its code, you need basic knowledge of C language and assembly language.
The following is the development and deployment environment of the project:
- Operating system used for development: centos 6
- gcc 4.4.7
- CPU: AMD RYZEN 5, Inter cpu is also available (compatible instructions are used)
- Run KePOS virtual machine: Oracle VM VirtualBox
- kernel.bin：Binary file after kernel compilation
- loader.bin：Binary file after bootloadercompilation
- mymain.bin： Binary file of user program
Save the assembly source code of boot and loader, and makefile
Save the kernel source code
Save user programs and library files.
- main.c source code of user program.
- makefile：Used to compile and link user programs and libraries code .
KePOS_v0.1.img：The prepared floppy disk file (including: F12 file system, kernel.bin, mymain.bin, boot.bin, loader.bin) .
In the Oracle VM VirtualBox , create a new 64-bit virtual machine (memory: 4G, including floppy disk). Download KePOS_v0.1.img and add it to the virtual machine to run the KePOS system.
Open the kePOS system and click the right mouse button to open a user process. The process can enter (w, a, s, d) on the keyboard to control the movement direction of the small square.
The window closing has not yet been realized.
In centos 6, make sure the gcc version is 4, then execute the following commands:
Compile to generate boot.bin and loader.bin, go to the bootloader directory, and execute:
Compile to generate kernel.bin, go to the kernel directory, and execute:
Compile and generate mymain.bin, go to the user directory, and execute:
3.Floppy disk image
In the directory where boot.bin is located, execute the following command, the KePOS_v0.1.img will be generated in the current directory.
dd if=boot.bin of=KePOS_v0.1.img bs=512 count=1 conv=notrunc dd if=/dev/zero of=KePOS_v0.1.img bs=512 count=2880
4.Copy binary file to floppy disk image
You can copy the prepared KePOS_v0.1.img, loader.bin and kernel.bin, mymain.bin to the windows operating system, and then use the software WinImage to open KePOS_v0.1.img, drag loader.bin, kernel.bin, mymain.bin to KePOS_v0.1.img.
5.Virtual machine settings
- Create any 64-bit virtual machine in Oracle VM VirtualBox.
- The memory size of the virtual machine>4G
- Storage contains floppy disk
- Display controller select vboxSVGA, or vmSVGA
- Add KePOS_v0.1.img to the virtual machine
- Click to start the virtual machine to run the system.
The file system function has yet to be realized.
The GUI function needs to be improved.
There are few types of user programs and need to be added.
《AMD64 Architecture Programmer’s Manual: Volumes 1-5》