The first three articles of the blog are a series of articles about simple operating system development. These three articles were written in March, and were just the beginning of junior year, after we finished an IM system with our friend Feng Ying, we came up with the idea of writing a small OS. From that time on, we began to prepare this knowledge, at that time, I read the book "write an operating system by myself". At the beginning, I felt quite cool and had a lot of theoretical knowledge. Therefore, we plan to take the operating system project as a long-term goal, at least to complete it before leaving campus. Later in my junior year, Feng Ying and I both started to work. We were busy working and looking for work. So we put down the operating system, however, we are constantly reserving this knowledge.
Later, I found my desired job, But Feng Ying had a problem and failed to join me in the company we once longed, then Feng Ying went to work in another city with his classmates. After my internship, I went back to campus and completed my goal in the last year. piscisos was born like this. Although my work is simple, it is far beyond the original design. Now I want to share with you the hope that we can discuss common progress with many like-minded friends in the csdn compilation section, I also hope that you can have a reference for those who want to create an operating system but are confused.
This system is called piscisos. It has no special meaning and is a personal hobby. For the completion of piscisos, I have referred to many existing open-source small operating systems based on X86 architecture: menuetos, mikeos, mouseos, and msdos source code. It draws on many design schemes in menuetos. I also referred to a lot of books and materials, which are not listed in detail here. If necessary, you can find them in the references file of the project. Once this article is written, it means that I have to write a series of piscisos articles again. Because development requires a lot of knowledge, it is impossible for me to write a short article, therefore, I will introduce the various designs selected in piscisos development in detail in modules.
All the engineering source code and image files of piscisos can be obtained here: http://sdrv.ms/L96AMz
This article briefly introduces some features and operations of the currently completed piscisos.
Piscisos is a micro-Operating System Based on X86 architecture. All the code of the system is completed in assembly language, and the Assembly program is flat assember, currently, the Code volume of several existing applications is 7000 lines of assembly code. The system uses a 3.5 inch floppy disk image with a medium of 1.44m. The image file name is piscis. VFD.
Hardware environment:
CPU: 386 or updated CPU
Memory: at least 16 MB to ensure that the system runs nuclear energy, up to 4 GB.
Others: keyboard, floppy disk drive
System features:
Multi-task: supports a maximum of 250 processes, and uses the time slice rotation scheduling algorithm. The scheduling time is 10 ms. Currently, the Process Communication Mechanism only provides one process wait function.
File System: memory disk file system (RAM disk) based on fat12 ).
Programming Interface: System Call is provided through system interruption of the 50h number. The following table lists the currently implemented system calls:
Internal name |
System Call function no. |
System Call description |
Sysc_gettick |
0 |
Obtain the number of system tick |
Sysc_getkey |
1 |
Get keyboard input |
Sysc_screenandcursor |
2 |
Screen and cursor |
Sysc_putchar |
3 |
Screen Print characters |
Sysc_print |
4 |
Screen output string |
Sysc_time |
5 |
Get current time |
Sysc_date |
6 |
Get current date |
Sysc_createprocess |
10 |
Create Process |
Sysc_exitprocess |
11 |
Exit Process |
Sysc_waitpid |
12 |
Waiting Process |
Sysc_rdfs |
20 |
File System Problems |
For detailed instructions, see the syscils doc.txt file.
Here is the implementation code of a typical Hello world application:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Application for PiscisOS: Helloworld;;Assembled by Flat Assembler;;;;23/04/2012;;Copyright (C) tishion;;E-Mail:tishion#163.com;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;use32org 00hAPP_HEADER:db'PISCISAPP000';;Signaturedd0;;ReserverdddAPP_START;;Entry PointddAPP_ARGS;;Arguments Bufferdd0;;ReservedAPP_ARGS:times (256) db0 APP_START:mov edi, str_hwmov eax, 04hint 50hmov eax, 11hint 50hstr_hwdb 'Hello, world!', 0
The following is the complete system startup process.
Figure Boot Sector Program loading Disk Files
System started successfully
Enter the system interaction interface
System Application Testing
This article will write so much content, just give a brief introduction. Next I will sort out the development notes and share the knowledge learned in the detailed development process with you.
Coming to the next article: piscisos Development note _ 2 _ detailed description of development methods