login about faq

How best could I learn to write my own OS? I'm 100% fluent in C, and I'd like to learn how to write an OS. Is there any resource (preferably free) that could help me write this stuff? I have a reasonably good idea of how kernels work, and I pretty much know what things I'd need to write (special kernel memory allocation functions, special printing functions, etc.) and I can tell you the difference between a microkernel and a monolithic kernel. How do I best go about learning this?

asked Jan 16 '11 at 19:07

HHBones's gravatar image

HHBones
4.0k5880117

I found out that you can't just write a OS in C you need to use a Assembly language which I can not find any tutorials on for more info check out my question here.

(Jan 16 '11 at 21:53) ryebread761 ryebread761's gravatar image

I'm not worried about Assembly. I know Hack assembly, and it won't take long to learn x86_64 Assembly from there. All I need to know are some new keywords and the registers. AX/BX/CX/DX/EX plus more is a bit different from A and D, but it won't be much of a problem.

(Jan 16 '11 at 22:08) HHBones HHBones's gravatar image

HHBones - from your last response you obviously have not done that much assembly programming. for every assembly language you learn, its almost like starting all over again. You need to learn more then just keywords which are called op codes and directives, also the 80x86 throws you several curve balls it is not like a simple pic chip, you also have segmented addressing which is a pain, if you ask me and from my studies of the Linux kernel, it comes up a lot. you need to learn the architecture of what you are programming.

(Jan 17 '11 at 10:54) trueb trueb's gravatar image

For someone who is 100% fluent in C i find it surprising that you are asking such a question, a person who is that good at C obviously knows how to find information and apply it to what they are doing, and should know how a OS works and what an OS needs to do.

However, knowing just C is simply not enough, you also should have a good understanding of assembly.

the best free thing you can do is learn how other operating systems work, and the code behind them (did some one say download the linux kernel from kernel.org? hum i guess not), anyways i am interested in this too, which is why i am currently reading Understanding the Linux Kernel by Bovet and Cesati published by O'Reilly.

I wish you the best of luck and hope you are successful.

answered Jan 16 '11 at 19:49

trueb's gravatar image

trueb
10.4k3072180

I have the Linux kernel, and a book on writing device drivers. The problem I have is understanding more than what the words mean. I want to see the function declarations for everything, which is simply not possible with the Linux kernel. I know 'hack' assembly, but I've always had trouble with mixing assembly and C, and I have no idea what to do with the stuff in between. Thus, I think that writing my own OS is the simplest possibility.

(Jan 16 '11 at 21:59) HHBones HHBones's gravatar image

then the short answer i can give you is your not ready yet

(Jan 17 '11 at 10:11) trueb trueb's gravatar image

to create an OS that another person would want to use would require a lot more work than 1 person can physically do. Thats why you don't see many consumer operating systems.

The only field where entirely new operating systems are still being made is the embedded OS market where you can write an OS to control a single task machine such as a paint sprayer or some custom machinery (and even then those are made by large groups of people who will all focus on making a OS that does one thing and does it with out crashing or bugs.

answered Jan 16 '11 at 19:53

Razor512's gravatar image

Razor512
11.1k3065188

I'm willing to do all the work. Linus Torvalds wrote 2% of the Linux kernel. If he can write 1/50 of 13 million lines of code, I can write a disk driver. I just need to know how.

(Jan 16 '11 at 22:01) HHBones HHBones's gravatar image

There are no books (that I know of) to explicitly tell you how to make an OS concept, but you could start learning UML or something like that and start creating sketches, first look into current free kernels (Linux ,BSD ...) and you can modify these to suit your needs ...
If you really want to make your own OS then you should already know how to implement a Linux kernel, that will help you big time, after that you need to take a pencil and a peace of paper(a big one) and "paint" your own idea of an OS !

answered Jan 16 '11 at 19:35

UniverseMorpher's gravatar image

UniverseMorpher
2364614

edited Jan 16 '11 at 19:36

That's the problem-- 95% of writing an OS is writing a kernel. I'm willing to commit the time- all I was looking for was somewhere where it tells me how. \

(Jan 16 '11 at 22:00) HHBones HHBones's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Become a Gnomie!


Join Us in the Chat Room

Tags:

×203
×121
×56
×12

Asked: Jan 16 '11 at 19:07

Seen: 2,018 times

Last updated: Jan 17 '11 at 10:54