Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What where the most troublesome parts of the project?

Task switching. It's a very intricate process, you really have to understand how to structure everything (especially the task stack) so that you can switch everything from underneath the CPU as if nothing has happened (the CPU is obliviuous to which task is running, including the kernel itself). Add to that switching between user mode and kernel mode (during interrupts and system calls) and it becomes even more challenging.

> Also, any tips if anyone want to write an OS from scratch, aswell?

As @deaddod said, you need to read a lot. Two invaluable resources for me were the Intel Software Development Manuals (SDM), and the osdev wiki. The SDM can be daunting, but it's surprisingly very readable. The osdev wiki has great content, but it can be a hit or miss. I complement them with various blog posts and code on github to really understand a certain topic.

That being said, the most important aspect of this process is to have tons of curiousity and to be passionate about low-level systems programming. I love to learn how things really work at the lowest level. Once you learn it, you'll discover that there's no magic, and that you can write something yourself to make it work.

[0] https://www.intel.com/content/www/us/en/developer/articles/t...

[1] https://wiki.osdev.org



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: