August 12, 2010

It started with Hello

So there I had it, some very simply boot code that brought my emulator alive, if only enough to stutter the words 'NickOS v0.1 is loading' and then stall. It didn't die, but it didn't do anything more either. This all sounds very uneventful, and indeed you're right, it is. But it's exciting too, to appreciate just how alone this code is on the machine. There's nothing else running except for those few bytes of hand crafted assembly, no friendly API's, no drivers, no...well you get the idea....there's nothing. At least, not much.

So, once you get to this famed position, the question likely strikes (at least it did me); where to from here? So I looked ahead and tried to figure out what I wanted my OS to do...

...thought...

I emerged from my time of thinking with some ideas:
  • I wanted NickOS to run in protected mode, with access to the higher parts of memory and probably using paging too.
  • I wanted to load some kind of kernel separate from the boot loader. 
  • The kernel should manage memory, maybe allow multitasking, 
  • And I needed to read from a disk and draw to the screen. 
  • And, of course, I wanted to ultimately write programs that would run on NickOS
And all of a sudden, the chasm between what I had accomplished here, my lonely isolated piece of code, and what I was shooting for seemed incomprehensibly wide. I was immediately faced with more questions than I had answers and so began a few more days of simple thought.

...thought...

So rather than trying to write the entire kernel in one, I would work on each piece separately, one step, one baby step, at a time. And where better place to start, than protected mode.

August 6, 2010

Hello World

One of the first things that I guess anyone does, as with any other kind of programming, is to get your new code to print something to the screen. Some message, that gives you confidence that you're going in the right direction, that shows that you're you're finally getting it. So given that most people start with 'Hello World' when programming, I figured why not start this blog with that too.

But I'm not looking to write tutorials on assembly, the boot process of the PC platform or BIOS primitives to writing to the screen. What I want to give you, however, is to provide the pointers to resources (good resources) that already exist that would allow the would be OS programmer to get started. The tools that will help a new adventurer into OS development to 'get it', to give you the resources to carry on, to guide you in the right direction of discovery.

So think of this not as a how to for writing a basic boot loader, but rather a how to for getting started in writing your first boot loader. Two sites out there, if you haven't found them already, that I have found and continue to find invaluable are http://www.osdever.net/ and http://wiki.osdev.org/Main_Page. Both of these sites are backed by a bunch of people who know a lot more than me and who are willing to share it with you. Both these sites, also have great forums | forums, which give you access to those same people, should their written work not be enough. Be sure to RTFM|T (read the fine manual|tutorial) before asking questions, but if you have a worthwhile question, you'll find these forums populated by people very willing to help

In addition to forums mentioned above, I have found newsgroups to be very helpful. As yet, I've not posted to these groups but just subscribing and reading the posts on many of the comp.* groups can be very enlightening. (try comp.lang.asm.x86 for starters.)

Here's the first screen of NickOS (verion 0.1 I called it, should probably not even have been that!), running inside Virtualbox. I originally ran it on Bochs, but I don't have it installed any longer and since I use Virtualbox to host other virtual OS's, I now just use it for my OS development too.

Not really 'Hello World' but serves the same purpose!




And that's it for now. I'll start pushing some of these links into a gadget so they're always there.

August 5, 2010

Blogging about NickOS

I've been working on and off on my hobby OS for about the last 5 years. However, it's only in the last 3-6 months, that I've really but some mental muscle and time to developing it beyond the 'Hello World' stage.
I wanted to record my thoughts and processes, as the OS starts to take on real shape, somewhere other than in the books and scraps of paper that litter my desk, bag and counch at home. So this, is what you'll find in these pages.
It's an attempt to record the stages that I went through while developing NickOS and any opinions I may have at the time and in restrospect as to whether they were the right steps to take.
This is a fun topic, albeit a bit geeky, and I'm really grateful to all the people who posted tutorials and help documents that got me started. I guess I wanted to give something back in return.