CybOS - A tutorial OS

Warning: This blogpost has been posted over two years ago. That is a long time in development-world! The story here may not be relevant, complete or secure. Code might not be complete or obsoleted, and even my current vision might have (completely) changed on the subject. So please do read further, but use it with caution.
Posted on 10 Feb 2010
Tagged with: [ cybos ]  [ operatingsystem ]  [ tutorial

Somewhere in 1998 or even earlier, I started my own little project in creating a - functional - Operating System from scratch. Not a linux clone and not a MS-DOS wannabe. Just  a simple OS that is functional in such that some tools, games etc could actually work, not caring about Posix compliance, fancy graphics or all hardware support you can think  of..

So, today, 12 years later, where are we?

Well, not very far I can tell you that. :)  However, I think the current project has more functionality than many other hobby-OS’es out there at the moment. For instance:

  • Protected Mode
  • Paging system
  • Virtual Memory Manager
  • Task switcher / scheduler
  • small dedicated c-lib with a start of functionality

So, functional or not,.. the “hardest” parts are actually done. Most of those are done 2 years ago when I had some weeks of free time. Since then, the project is stored again.. so hopefully i can pick it up again.. (note to self: need a serious time management training).

I’ve dedicated a lot of posts on Tweakers.net (url’s follow soon) about the start of such a project and what the catches are (trust me, there are a lot of those). I’ll track them down and post them here, together with the expansion of the system which i’m working on at the moment..   Even though a lot of code is 12 years old and could do with a complete rewrite, it’s still pretty easy to understand what’s going on. The following parts are based on the current CybOS sources. Every aspect is listed in the way it’s initialized. This means I will talk about consoles before talking about the GDT while keyboard handling will be dealt with in part 7. Things might be turned around later on, but for now this is probably the way I’ll blog about it..

  • Part 1 : The boot sector
  • Part 2: Creating and entering the C kernel
  • Part 3: Consoles (not your average way of handling them)
  • Part 4: kernel memory
  • Part 5: GDT
  • Part 6: PIC and PIT
  • Part 7: IDT
  • Part 8: Paging
  • Part 9: Heap
  • Part 10: Entering usermode
  • Part 11: Stack
  • Part 12: Scheduling and task switching
  • Part 13: Fork()