Monday, May 9, 2011

Berkeley in Kernel Land (part 1)

Last Wednesday I decided that I wanted to learn more about operating systems. Sure, I've taken UCSB's operating systems class (and done well in it), but operating systems are so huge and daunting that I felt more was necessary.

So I decided to write one. The goal is to build an operating system that works at some basic level; right now I don't have any further objectives. Ideas have crossed my mind, such as building a system that has a little extra support for stage lighting technology (like DMX-512) among other things. Stage lighting is another hobby of mine.

The OS Dev wiki has been an invaluable source of information! It provides the guidance needed for an experienced programmer with a computer science background to start working on an OS.

So far I've done the following:
  • Setup GRUB as a bootloader
  • a simple page allocator
  • Wrote drivers for vga output, keyboard input, the PIT (programmable timer), the serial port and a dummy ramdisk (which disguises a memory mapped image as a hard drive).
  • Wrote filesystem support for FAT-32
  • Just last night I built a simple shell that you can use to browse a FAT-32 filesystem

Here are some next steps going forward:
  • I need a virtual file system to abstract-away the details of FAT-32
  • Code to execute user space programs (for now, just flat binaries -- but in the future I'll use ELF).
  • A scheduler

  • a fancier memory allocator

  • Port a C library (perhaps newlib?)

  • Port GNU core utils

  • More drivers: including ACPI, cdrom, networking, and hard disk

  • More filesystems: FAT-16 (easy), ext2/3/4 (harder), others?

Long term, I'm thinking about using modules to replace most drivers and filesystems. Unlike modern linux distributions, my goal is to minimize dynamic module loading and compile as little as possible into the kernel. Hopefully extra needed modules can be loaded from a static list on boot. I'd like to stick to a system that's quite a bit meaner-and-leaner than linux, even if it lacks many capabilities.

Right now GUI is off the radar, but it might be a possibility if I really have time...

That's all for now, but I'm going to try to post updates weekly. By the way, I'm still working on a name for this thing...

1 comment:

  1. BTW... still looking for a name. I've thought about "slimix", which just about sums up everything I'm doing: I rather slim unix system with some tweaks (that is, changing everything I don't like).

    ReplyDelete