Click here to Skip to main content
13,593,593 members
Rate this:
Please Sign up or sign in to vote.
See more:
hey guys,

i have been thinking about this for a while and i really want to make my own operating system. it doesn't have to be anything fancy, just a basic console-based ui would be fine. i don't want people commenting and telling me that it is too big of a task, i know what i am up against. it really annoys me when people just tell me to give up what i want to do because it's too hard, that's what i was told about making a programming language, yet i am making programming languages currently. i'm sure that if i put effort into it, then i will start to be able to make operating systems just as i am making programming languages.

so, to make it simple, i am looking for someone to give me a link to a detailed tutorial on how to make an operating system and don't just tell me that it's too hard, it is do-able, if it wasn't, no one would be doing it. i'm sure that if i work hard at making this happen, i could eventually do it.
Posted 7-Jan-13 22:31pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I don't think that there is any kind of tutorial on writing operating systems. You may find some books about this topic. See the reference section of the Operating System[^] Wikipedia article. The article contains a section entitled 'Operating system development as a hobby' with some links which may be also helpful. One of these leads to the OS Wiki[^].
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

We have an article series on this topic: "Beginning Operating System Development"[^] by 0x3c0.
nv3 8-Jan-13 7:24am
Excellent suggestion!
fjdiewornncalwe 8-Jan-13 16:31pm
+5. That's a good one too.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

As you said it is a "too big of a task".

But you can learn about that. Following links might be useful !



3. Index of the book "Operating Systems Design And Implementation" (I recommend it) :[^]
Espen Harlinn 8-Jan-13 20:02pm
I was hoping somebody would mention Andrew Tanenbaums work :-D
Captain Price 9-Jan-13 0:25am
yeah, that's the best !
Rate this: bad
Please Sign up or sign in to vote.

Solution 5

You've been given lots of good answers.

It comes down really to a few basic things.

1. What does an operating system do?
2. How are operating systems put together?
3. What do I want my operating system to manage?

If you know these things and you already write languages, then you don't really need a tutorial.

The folks that write operating systems, are unlikely to see much benefit or gain, in writing a complete tutorial on how to write one. Where would they start?

1. Basic electronics?
2. Motherboard design?
3. DMA, Interrupt processing?
4. C and Assembly Programming Tutorials?
5. Basic driver design?
6. APIs and how to write them.
7. Bootstrapping.

I'm not saying you can't do it, but it sounds like you haven;t even bothered to do any basic research too understand the scope of your project.

Your question is a bit like saying, you want to build a motorized vehicle and you already know how to operate a forge and hammer, so can someone give you some simple directions.
nv3 8-Jan-13 18:54pm
I like that last metaphore!
Rate this: bad
Please Sign up or sign in to vote.

Solution 6

All the other solutions seem to assume something "real" OS-like.
You may also consider to start on real ground!
Maybe, you can start with some small experimental board with a controller, some RAM and some Flash memory, at least some primitiv I/O (e.g. input = interrupt, output = some LED). The Flash on a socket and some Flash burner device was beneficial.
Learn the basic startup machinery of a controller.
Learn the interrupt concept of the controller.
Learn how to address the I/O lines.

Based on that, you can write a primitive BIOS:
- startup and init the system
- install interupt handler
- do some lightshow controlled by the interrupt line
- program a timer for the lightshow

This all was very primitive:
- single threaded
- interrupt controlled dispatch loop
- no memory management
- *one* program from flash runs on the controller
- etc.

To program this, you need some cross compiler development environment that compiles your source code into the machine code of your controller.
You would need to understand and control how to map the respective code/data sections into the flash. The startup procedure must load the pre-initialized global variables into RAM (scattering), init the I/O device/registers/..., allocate (reserve) some stack memory, etc.

Once you master this, you can go and write mutate your BIOS into a bootloader (e.g. if you have a serial line on your board):
- extend your BIOS by a serial line handler (read/write to some registers/memory mapped locations)
- extend your BIOS by a flash burning function (assuming you have the needed circuits on your board)
- extend your BIOS by a primitive shell that talks over the serial line handler
- implement some shell commands that allows to control the flash burning function
Now you can connect the board over serial line to a PC, run some terminal program on the PC to talk to the shell on the board. All this allows now to burn programs into flash.

You now can define some more commands on the shell in the bootloader: define some partitioning of the flash to store persitent data (flash drive). You now can also invent some structure in the flash drive (file system, e.g. some FAT). With the shell commands you can e.g. create the base structure (format) and add directories of files and directories, store data as files and access them through the directories. Invent some machinery to create/delete files and directories, store some data as files, append data to files (if this is desired), etc. All accessible over the shell.

Depending on your board, you are now open to add an LCD display, some I/O extensions, some IDE HD, some USB port, etc.

This all is still a very primitive system that lacks a lot of modern OS functions.
- No process concept to load and execute (and terminate) programs
- No memory management (all memory is globally shared)
- No concurrency other than interrupts (no threading with context switch, etc.)
- No whatever...

But fun to build it up ;-)

Good luck!
Rate this: bad
Please Sign up or sign in to vote.

Solution 7

See if you can locate the 18-part series written by Lynne Jolitz and William Jolitz in Dr. Dobbs Journal beginning in January 1991 about their work on 386BSD[^] - the series was well worth reading.

Best regards
Espen Harlinn
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Strange isn't it that you can set yourself one of the most complex tasks in program development, yet cannot make the effort to use one of the easiest tools known to man to help you find articles on the subject. Or even try a search here[^].
8-Jan-13 5:15am
i've tried to search for 'how to make an operating system', but mostly that comes up is stuff using COSMOS(which doesn't work on my computer), SUSE Studio or just people saying 'look at this piece of code and then do this with it an you have an operating system'. as i said, i want a detailed tutorial.
Richard MacCutchan 8-Jan-13 5:27am
Then go and read some of those in the link I gave you. Creating an operating system is a far from trivial exercise and you will need to do a lot of reading just to get started.
fjdiewornncalwe 8-Jan-13 16:30pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180618.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100