4 ms·
If one wanted to write their own little OS today, what would you recommend in terms of: * Books or articles to read? Hopefully with a hands-on and practical a
by khazhoux 3y ago
If one wanted to write their own little OS today, what would you recommend in terms of:
* Books or articles to read? Hopefully with a hands-on and practical approach.
* Target environment: VM or real hardware, and what specifically?
- pfranz 3y agoI believe the traditional resource is Dinosaur book (OS Concepts by Silberschatz). I've also seen Operating Systems: Three Easy Pieces https://pages.cs.wisc.edu/~remzi/OSTEP/ https://pages.cs.wisc.edu/~remzi/OSTEP/ come up. Another common recommendation is to find a hackable existing OS/kernel. You already have a working OS, but you can inspect and rewrite portions without having to do everything yourself upfront. http://www.minix3.org/ http://www.minix3.org/ seems to be a popular one. Various BSDs seem to be mentioned, as well.
- khazhoux 3y agoThanks. I just flipped through a lot of Dinosaur book (10th ed) and it's not hands-on, though. Back in undergrad in the early 90s, our OS course was we spent the semester building a crappy x86 OS which could boot, run a couple of processes with basic I/O and simple signals and memory management. Even though it had nearly zero concepts relevant to modern OS's, it was so much fun. It didn't set me up in any way to be a serious OS designer, but it was the essence of programming a CPU and some devices, with nothing in between us. I'd love to experience that again. But I don't know where to find resources for the lowest levels: booting into a raw CPU and connecting directly to devices (including display and keyboard). To be sure, I can find plenty of OS texts on advanced memory and process management schemes and so on, but what about the lowest level?
- johndoe0815 3y agoOne example is Stephen Marz' "The Adventures of OS: Making a RISC-V Operating System using Rust": https://osblog.stephenmarz.com https://osblog.stephenmarz.com Unfortunately, this isn't updated to work with current RISC V specs, so you will run into a number of problems which can be frustrating...
- taylortbb 3y agoI'd start with https://wiki.osdev.org/Expanded_Main_Page https://wiki.osdev.org/Expanded_Main_Page . There's a whole community of people writing little OSs, and many OS 101 articles as a result. VMs would be the most common target, but the Raspberry Pi is also quite popular.
- khazhoux 3y agoCool, thanks!
- hliyan 3y agoThis plus QEMU https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures...
- khazhoux 3y agoExcellent, thank you!
- qingcharles 3y agoAfter I started using Linux in 1994 I wanted to write my own OS that was entirely GUI based. I used this book to learn the fundamentals and it really would help explain a lot of the Linux code, and would also teach you how to even get your kernel loaded and booted, which is the hardest bit for a new OS: https://www.amazon.com/Developing-32-Bit-Operating-System-Cd-Rom/dp/0672306557 https://www.amazon.com/Developing-32-Bit-Operating-System-Cd...