Greetings, introduction, and some code
Posted: Sat Jan 19, 2008 5:05 pm
Hello all!
I've been lurking here a month or so now, and it is time to jump in, start a conversation, and do interesting things. I came up with a new-year's resolution that it's (well past) time for me to start writing an OS kernel of my own, for the educational experience. I'm two weeks into my own kernel (x86-64), finally got 64-bit code running last night.
First thing ... sources! I've tried to take periodic snapshots of the state of things, partly as my homage to version control (which I will use Real Soon Now...) and partly because I think being able to see how code evolves between daily snapshots is an excellent educational experience. Mistakes and all; most kernels work (for primitive definitions of work), but the makefile setups are evolving.
http://www.kscguru.net/osdev/
- kernel-00x is just me setting up a 32-bit baseline. GRUB bootloader installed on a bootable ISO image, with a tiny chunk of 32-bit code, printing some constants and Hello World. 884 lines of code.
- kernel-01x is the journey to 64-bit (plus a 64-bit build toolchain). There is a Makefile-toolchain that includes configure scripts to build NASM, binutils, and GCC, plus enough code to print Hello World in 64-bit. Presently 1721 lines of code (including build system), still a work in progress.
- caveat: I really am starting from scratch, some things look terrible. For example, the main Makefile is junk right now, switching to a maintainable build system is next on my list.
Up to here, not all that interesting - many of you have been working on your OS far longer than I have and have much more to show for it, though I bet some people as fresh as I am might appreciate watching a kernel codebase evolve and/or talking about some of the design decisions.
Now, for the interesting details.
I'm doing all this development on VMware Workstation. Saves on hardware wear-and-tear, avoids disk corruption, all good things for working on a hobby ... professionally, I'm a VMware employee. So (and ignoring rah-rah marketing speak - I'm an engineer, I don't care if you buy or not), I am intending to:
1) Update the OSDev VMware wiki page as much as possible with new things I'm finding useful. First up, documenting the options used to enable the built-in guest debugger gdb stub! I'll keep salesmanship out of it.
http://www.osdev.org/wiki/VMWare
2) Hang around and answer VMware questions (not in this thread!) - anyone else using VMware as a development platform? I'm not giving away company secrets and I'm not on-call, but I am looking up answers to my own questions, and could look up a few more answers while I'm at it. And if I can pass feedback to the product teams, so much the better.
3) General OS stuff - I've got questions, thoughts, and maybe a few answers. After all, my background is "kernel engineer." Most of us know modifying an existing kernel and starting from scratch have very different degrees of difficulty!
My kernel isn't for real use. It's an educational testbed for myself, which means I implement what I find interesting (and skip what I don't; filesystem support is a long way off). I'm also assuming a specific platform (64-bit system with VMware's device set), which means I am skipping lots of compatibility checks most real OSes would need.
Future directions for my kernel:
- Loadable kernel modules. This is my hobby, hobbies are about learning, and I want to learn how to write a dynamic linker.
- Loadable python kernel modules. Sounds cool to me ... ask in a few months if it's possible.
- THEN comes userspace.
I've been lurking here a month or so now, and it is time to jump in, start a conversation, and do interesting things. I came up with a new-year's resolution that it's (well past) time for me to start writing an OS kernel of my own, for the educational experience. I'm two weeks into my own kernel (x86-64), finally got 64-bit code running last night.
First thing ... sources! I've tried to take periodic snapshots of the state of things, partly as my homage to version control (which I will use Real Soon Now...) and partly because I think being able to see how code evolves between daily snapshots is an excellent educational experience. Mistakes and all; most kernels work (for primitive definitions of work), but the makefile setups are evolving.
http://www.kscguru.net/osdev/
- kernel-00x is just me setting up a 32-bit baseline. GRUB bootloader installed on a bootable ISO image, with a tiny chunk of 32-bit code, printing some constants and Hello World. 884 lines of code.
- kernel-01x is the journey to 64-bit (plus a 64-bit build toolchain). There is a Makefile-toolchain that includes configure scripts to build NASM, binutils, and GCC, plus enough code to print Hello World in 64-bit. Presently 1721 lines of code (including build system), still a work in progress.
- caveat: I really am starting from scratch, some things look terrible. For example, the main Makefile is junk right now, switching to a maintainable build system is next on my list.
Up to here, not all that interesting - many of you have been working on your OS far longer than I have and have much more to show for it, though I bet some people as fresh as I am might appreciate watching a kernel codebase evolve and/or talking about some of the design decisions.
Now, for the interesting details.
I'm doing all this development on VMware Workstation. Saves on hardware wear-and-tear, avoids disk corruption, all good things for working on a hobby ... professionally, I'm a VMware employee. So (and ignoring rah-rah marketing speak - I'm an engineer, I don't care if you buy or not), I am intending to:
1) Update the OSDev VMware wiki page as much as possible with new things I'm finding useful. First up, documenting the options used to enable the built-in guest debugger gdb stub! I'll keep salesmanship out of it.
http://www.osdev.org/wiki/VMWare
2) Hang around and answer VMware questions (not in this thread!) - anyone else using VMware as a development platform? I'm not giving away company secrets and I'm not on-call, but I am looking up answers to my own questions, and could look up a few more answers while I'm at it. And if I can pass feedback to the product teams, so much the better.
3) General OS stuff - I've got questions, thoughts, and maybe a few answers. After all, my background is "kernel engineer." Most of us know modifying an existing kernel and starting from scratch have very different degrees of difficulty!
My kernel isn't for real use. It's an educational testbed for myself, which means I implement what I find interesting (and skip what I don't; filesystem support is a long way off). I'm also assuming a specific platform (64-bit system with VMware's device set), which means I am skipping lots of compatibility checks most real OSes would need.
Future directions for my kernel:
- Loadable kernel modules. This is my hobby, hobbies are about learning, and I want to learn how to write a dynamic linker.
- Loadable python kernel modules. Sounds cool to me ... ask in a few months if it's possible.
- THEN comes userspace.