OS dev - startup help

Started by
7 comments, last by CoMaNdore 16 years, 2 months ago
Hey Im currently taking a uni course in OS's. And the lecturer hinted that it was possible (and smart), to try and write your own os, to get a more firm picture on what was going on under the hood. This is ofc for learning purposes only, and is in NO WAY my intention of creating more than a very small almost usable (in shell ofc) os. I am pretty fluent in C/C++ and have done quite a bit of assembly programing. Tho never on a x86 platform. Now the big question. Where do I start? And also what can I expect to get done in say 2-3months of work, will I have time to even get anything on the screen? I would prefer to write as much as pos from scratch. Any advises, links, and so on would be helpful. - cheers and thanks in advance
- Me
Advertisement
For our OS course, we wrote a small kernel in just around 3 weeks. That is, a basic thread scheduler, a *very* basic telnet client (we were given most of the code for the NIC driver, so all interaction with it was over a network). And we didn't have an executable loader or anything, instead the program was just compiled into the kernel.
Getting it to print the program output on the screen instead of sending it over the network should have been easy enough to do, so if you want to do that, I doubt it'll be a problem.

Personally, I'd avoid x86. I doubt it's worth the hassle. Get a MIPS emulator or something instead.
If you do want to do this on x86 then VMWare would seem to me to be the obvious environment to develop it in. To start with it means that it'll run on other people's computers as the hardware is emulated in the virtual machine.

Outputting text to screen should be as simple as using int 0x10 to talk to the video card BIOS.

I'd think the obvious starting point would be the boot loader - getting the first little bit of code off disc and into RAM, which then loads the rest of it.
Quote:Original post by CoMaNdore
Any advises, links, and so on would be helpful.

I found the following useful.

OSDEV Community
osdev.org
Write your own OS

and of course, alt.os.development.

--smw

Stephen M. Webb
Professional Free Software Developer

To expand a bit on Bregma's reply, the following wiki pages on osdev are a good place to start:

Getting Started. Take special care to read the sections entitled "The Hard Truth" and "Required Knowledge".
Bare Bones. This is an extremely basic minimal "Hello World" kernel. Actually it doesn't even do that much. But it's where you can start. Be prepared to spend a lot of time researching how to setup grub and get a disk image created.
What order should I make things in. Once you have the bare bones working there are a number of directions you can take depending on your interests.
-Mike
An additional resource: Crypter's OS Dev series.

Σnigma
Also of interest is Bran's Kernel Development Tutorial. It covers all the really basic things needed for a protected mode OS.
In my OS project's class, we basically wrote a micro OS that ran ontop of windows. All the 'lower' level code was implemented for us (in terms of managing swapping threads, callback hooks to hardware, etc). We implemented threading, scheduling, a file system, a UDP system, a TCP system, and a routing system.

We didn't have to deal with the nitty gritty of actually booting the system on hardware, but we did have to write all the call backs and learn all the algorithms to deal with thread synchronization and resource management (semaphores, mutexes, et cetera)

I would definitely recommend doing something like that.
thanks for all the help guys :)

Started reading myself tru all the links you posted.
Looks like a nice challenge tbh.
- Me

This topic is closed to new replies.

Advertisement