Posted in Uncategorized

How do i actually write an operating system ?

This my answer to quora query. I thought it is good to archive it here.

 

How do I actually start writing an Operating System?

I want to know the baby steps to be followed. I have read all the introductory articles on http://wiki.osdev.org.
I want to know how do I actually start writing code which can be executed independently of any Operating System. How do I write the assembly code which will enable my machine to execute it directly? What all do I need to learn for that? Also, what are the prerequisites and what are the tools needed for writing an Operating System?
I have read the theoretical concepts of Operating Systems and I have also gone through the Linux source code but I couldn’t understand much.
was at your place initially therefore I hope I can help. First thing you want to do is finalize on what you want to do. Most of the operating system tutorials start with a simple boot loader.  Read the intel manuals and learn them well . I believe it is easier to start with a real mode operating system because bios does lot of work for you .
Answer :
Yes you should have a moderate knowledge of x86 assembly to write an os .

Resoures for Learning x86 Assembly

EMU8086 is one of the easiest way to get started with x86 assembly it comes with an os development tutorial too.

1) IBM PC assembly langage programming Peter Abel: IBM PC Assembly Language and Programming: Peter Abel: 9780137566105: Amazon.com: Books
2) Assembly language step by step  : http://www.amazon.com/Assembly-Language … 0471578142
3) Assembly Language Master Book : http://www.amazon.com/Assembly-Language … 0471578142
4)Art of Assembly : Art of Assembly Language Programming and HLA by Randall Hyde
5) emu8086 : EMU8086
6) ketmans assembly tutorial : BT’s free web hosting service is now closed
7) Buch of tutorials from programmers My Bible
8 ) Knuths book  – Art of computer programming – volume 1  Fundamental Algorithms — Excellent
9) PC Assembly Language Programming : PC Assembly Language by Paul A. Carter
10 ) Programming from the ground up : Programming From The Ground Up
11) Advanced 386 programming Techniques –  James Turley

Interesting Projects and Pages

Mike os is a good starting place.

simple x86 assembly language operating system

I am compiling a set of resources that might help you on the way.

Operating System Engineering
Bona Fide OS Developer
Pintos Projects: Introduction
JamesM’s kernel development tutorials
The Operating System Resource Center
BrokenThorn Entertainment
Skelix OS Tutorial Content

Learning the linux kernel is another matter, it might be easier to read historic linux kernels for a newbie than the latest one. You might find this interesting

Linux Kernel 0.01 commentary

Hope something in my rambling is of some use to you 🙂