What Order Should I Make Things In?

From OSDev.wiki
Revision as of 14:54, 3 July 2007 by Frank (talk | contribs) (Link fix)
Jump to navigation Jump to search

This is a question of style. You can start at the start and dig straight in, writing a bootsector, then a minimal kernel, and build from there. You could skip the bootsector, and use a ready-made bootloader like GRUB. (People keep arguing if rolling your own bootloader is a valuable experience or a waste of time.) Or you can write bits and pieces in no specific order, and just put them together at the very end.

There is probably no right or wrong way to go about doing it. But still, if I do not know what to start with ...

For the starter

  1. Being able to print strings and integer numbers (both decimal and hex) to screen certainly is a must at early stage. This is one of most basic ways of debugging, and virtually all of us have gone through a kprint() or kout in version 0.01.
  2. You are likely to make mistakes when going further, so having a working and (once again) reliable interrupt/exception handling system that can report you the address of the fault as well as the register contents will be a valuable help aswell.
  3. Having the opportunity to allocate memory at run-time (malloc()-like interface) for your kernel's internal structure will certainly come handy sooner or later. It is suggested you handle it soon.

Once those steps are taken, whether you'll try to have a working GUI before you have a filesystem or multitasking or module-loading facility is really up to you. Try to sketch out what is likely to depend on what, and do things in 'least dependent first' order.

For instance, the GUI could depend on the filesystem to load bitmaps, but you don't necessarily need bitmaps in your very first GUI... Good advice in such a case is to design the interface of the filesystem first (be it open/close/read/write or something else), and then go on with whatever you prefer but respecting the interface on both sides.

Style Extremes

Operating system development seems to have "archetypes" though, among the OSdevers (and OS they develop). Of course a completed kernel is a bit of each presented here.

Lino Commando

Main article: Lino Commando

He's been impressed by the "naked beauty" of DOS times. The first thing he wants to be achieved is a blinking cursor after a ">" symbol so that he can type commands. No matter if there's no way to start 2 programs at the same time: he just needs a text editor and a FAT12 driver ;)

NICk Stacky

Main article: Nick Stacky

His test-machine has no keyboard and no screen. No one needs that. All he needs is NICs (Network Interface Cards) ... Plenty of NICs and Ethernet cable to see if his kernel responds to pings and routes packets correctly. His kernel of course has powerful multithreading and a complete TCP/IP stack.

James T. Klik

Main article: James T. Klik

Look through the window ... See that background with alpha-blending and my anti-aliased fonts ? See the corner of the screen ? That's Klik's Start Menu! Hmm, no. I have no 'programs' folder, as i can't load 'programs' for now, but here's a 16-items list of test cases for my WidgetToolKit.

Eleanore Semaphore

Main article: Eleanore Semaphore

Works in a darky corner of a small room with listings all around. Her system has much evolved since last year, though all she can show you is still the same: bunches of A and B displayed in no-obvious-order on a text console and that she controls with magic key combos. Hear her talking about how she implemented components programming, auto-dependencies resolving and virtual clock algorithm for her scheduler.