This is a series that I wanted to do a long time ago. Writing a small operating system from scratch is a tribute to the OS project done in the previous school, and I hope it can help students who are interested in this area.
Operating system is the core subject of computer science, but I think even the CS undergraduate operating system courses of many universities may not set up projects of this scale and difficulty. I took their undergraduate OS course when I was studying at CMU. This is the biggest project assignment of the course. For many students who major in computer science and those who transfer to computers from non-disciplinary classes, trying to do it, even if they understand such a project, I think it will be of great benefit.
Project expectations
There are many similar and very good series of tutorials on the Internet. I also hope that this series of mine can bring some differences. You can roughly have a psychological expectation:
- This is a series of articles that is partial to practice + principle explanation. I will use pictures as much as possible instead of words;
- This is not a series of hands-on teaching, some hands-on areas need to be solved by your own practice, of course I will give my Git project address for your reference;
- I will not post too much code to explain line by line, nor will I explain too much about professional knowledge in textbooks or manuals (I think you should know, or have the ability to study/check by yourself);
Knowledge preparation
In order to understand this series, you need to have sufficient professional knowledge preparation. Generally speaking, it is all the theoretical knowledge of the university operating system professional course. Proficiency is not required, but at least you can understand it and know how to check it when you need it. Deep Understanding of Computer System " is recommended here. If your level has covered this book, you can continue.
To be more specific, I hope your theoretical and practical abilities can cover the following:
- Solid C language ability;
- Enough x86 assembly ability (can be improved in the project);
- Familiar with Linux system and system programming experience under Linux;
- Use of tools such as gcc and Makefile;
- Have sufficient knowledge of the principles of compilation, linking, and code execution;
- Hardware and OS management principles of memory, especially virtual memory;
- Program loading in the operating system, execution process, use and distribution of memory;
- The concept and treatment of interruption;
- Conceptual principles of processes and threads;
- Multi-threaded programming, the concept of synchronization and lock;
Does it seem a bit too much...This is indeed a basic requirement for you, but it is still the same sentence, you don’t need to be proficient, you only need to be able to "understand", you can only have a vague theoretical concept, weak Practical foundation can improve these abilities in the project, which is actually the ultimate goal of this project.
Recommended books and tutorials
Just looking at my series may not be enough, and it may not be suitable for everyone, so I recommend some books and tutorials I have read:
JamesM's kernel development tutorials
This series is very recommended, the author's focus is clear, and the organization structure and code are very clear. But the scale of this series of projects is small, there is no boot loader and kernel thread, process and system call content. The whole is more demo and teaching nature, which is very suitable for beginners.
operating system truth restoration
This is also a relatively recommended book. Contrary to the above series, this book has completely implemented a relatively complete kernel from start to finish. The scale is relatively large, and the author’s explanation is very detailed, not tiresome, even I feel a little bit Long-winded, it is more suitable to be used as a reference and theoretical manual in the actual project development, not suitable for reading from beginning to end.
My series of projects actually referred to and integrated the above two, took a compromise, and controlled the scale and difficulty to a level that I think is more reasonable.
Project directory
Before starting the series, we first make a list of the project catalog, and then fill in these pits one by one.
- Preface
- preparation work
- BIOS boot to real mode
- GDT and protected mode
- Virtual Memory Study
- load and enter the kernel
- Display and print
- Global Descriptor Table GDT
- Interrupt handling
- virtual memory perfect
- implements heap and malloc
- first kernel thread
- Multi-thread switching
- lock and multi-thread synchronization
- Enter user mode
- process
- system call
- simple file system
- Load executable program
- keyboard driver
- Run shell
There is still a lot of content, let's take it step by step and get ready to go.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。