------------ Please ignore just jotting down for future myself ---------------
(Actually I want to study Win NT more than Linux as it brought me good memories, but Win NT was designed as a mature product from the beginning, and even the leaked 3.5 source code is way too much for me.)
I checked the version history and 0.11 seems to be a good start. Reasons:
- There is this book (https://download.oldlinux.org/ECLK-5.0-WithCover.pdf) which follows the style of Lion's Unix v6 book and uses the 0.12 kernel as reference;
- 0.11 doesn't have a virtual memory or a virtual terminal, and they are among the software I'd like to implement;
- 0.11 does have the basic stuffs so I assume it is not too difficult to set it up with QEMU and QEMU-gdb;
The list of software to implement in mind:
- a Debugger (I'll probably use QEMU-gdb, but if I can write a simple step-in debugger maybe it makes it a bit easier to dogfood? Still too early though as there is no compiler on it)
- a Virtual Memory system (following the MIT xv6 lab, maybe a bit more advanced as I will complete the MIT xv6 labs before pursuing this venture);
- a Virtual terminal (not sure how much I can implement, maybe just a basic one with limited control sequence support);
- a USB driver (not sure if it's possible for 0.11, I have never written a driver before);
- a mouse driver (again probably too difficult for me);
- a LOT of CLI programs as warm-up. Basically simpler versions of modern ones (less switches);
- a text editor. I never liked the key layout of emacs or vim so this is going to be my own thing. I care a lot about moving caret around without using a mouse;
- a very basic GUI system. Nothing fancy, just something that can show windows and some widgets. Maybe don't even care about multiple windows. Showing one window with a menu and some buttons probably needs a lot of effort;
- a compiler/linker of a simple language (can't dogfood without an editor, a compiler, a linker and a debugger I think)
Preparations:
- I need to complete all MIT RISC xv6 labs;
- I need to figure out how to write drivers for USB and mice;
- I want to investigate how X11 and Win32 GUI were implemented and figure out the architecture;
- I need to figure out how to write terminals and text editors. There are tons of tutorials online so shouldn't be too tough;
- I need to study compiler theory, just continue reading Crafting Interpreters should be good enough;
- I need to figure out a comfortable development and debugging environment;