-2

I am trying to make an my own OS. This is for educational purpose only, so that I get to understand the internals as well as get a good idea of low level programming. I have some prior application development experience in C#/python/C++/C. I am a noob in assembly language(very less experience and knowledge). I understand that in writing an operating system,we can't go without assembly language.

Currently, I have just printed a string in assembly language in the boot sector using qemu and BIOS interrupts.
What I want is that, can someone specifically point out the steps that I need to follow to make my operating systems run C programs. So that, I can start writing my OS in C.
Any other piece of advice to help a newbie, regarding the same is also welcome.

Although, I have looked into many os development related tutorials/websites, I can't seem to find this information anywhere.

Pratik Singhal
  • 107
  • 1
  • 4
  • recommended reading: **[Where to start?](http://meta.programmers.stackexchange.com/a/6367/31260)** – gnat Aug 22 '14 at 05:36
  • see also: [Is it possible to write an operating system in C?](http://programmers.stackexchange.com/questions/209667/is-it-possible-to-write-an-operating-system-in-c), [Are there any OS which are simple enough for learning?](http://programmers.stackexchange.com/questions/117973/are-there-any-os-which-are-simple-enough-for-learning) and multiple questions linked to these ([lack of research](http://meta.programmers.stackexchange.com/questions/6559/why-is-research-important) in this question feels pretty appalling) – gnat Aug 22 '14 at 05:45
  • I recommend PintOS. – Siyuan Ren Aug 22 '14 at 07:14

1 Answers1

2

First, you cannot write entirely an operating system kernel in C, because by definition an OS is managing physical hardware resources, and some of them (at least on common hardware like x86) are not accessible in C (e.g. MMU, I/O ports, ...). So you'll need a little assembly. (perhaps most of them can be asm instructions inside C functions).

Then, look at OsDev, it gives you a lot of information about how to start.

You'll also learn a lot by extending existing free software OS: in particular, understanding how to write your own Linux kernel modules and drivers will teach you a lot. See http://kernelnewbies.org/

Basile Starynkevitch
  • 32,434
  • 6
  • 84
  • 125