Bare Bones OS Kernel Tutorial
wiki.osdev.org
wiki.osdev.org
These things are dime a dozen. I cut my teeth on Doug Comer's Xinu, still one of the more accessible ones, if a bit over-commented.
Outside the x86 and ISA architectures, OSes are just algorithms. All the magic goes into probing devices and chanting legacy BIOS incantations :-| The first seconds, from moment you press ON until you see the OS splash screen, the machine runs through 30 years of PC history.
Protected mode programming and O/S development
My question is: Other than the obvious educational value, is there something concrete a beginner can do with a minimal kernel? What beginner projects would you recommend?
The problem is drivers - unless you manage to port Linux drivers or something to your OS, it's never going to be able to use more than an extremely narrow cross-section of hardware.
It very good for the educational value though! Making a kernel that boots a simple shell, and eventually runs statically linked executables is possible in a few months if you spend a lot of time on it (and a lot of that time is research, not coding).
It's important mostly not to worry about the finer details/getting things perfect - you almost certainly won't be able to make anything which is practically useful but it's an awesome learning experience :)
One thing that is very helpful to stop you from tearing your hair out is getting hold of a function to do sprintf() early on - it's no fun to write, just messy, and it lets you do primitive debugging. This seems like a good shot, despite the sketchy looking URL: http://read.pudn.com/downloads97/sourcecode/unix_linux/39644...
ARM is generally a lot more sane than x86 when it comes to writing close to the metal, although there's a lot less info about stuff out there. Often reading the manuals for the chipset will get you what you want though..
So, on a related note, would you be suitably impressed with a resume if it lists that it has a bare bones file system / shell implemented ?
Is anyone aware of a similar site for compilers? Or anything else? I've never liked wikipedia's wiki books, their coverage can be spotty, but I like that idea too.
Last summer I got inspired by this article and stumbling on the intel processor manuals (http://www.intel.com/products/processor/manuals), which I kept on reading for a few weeks and then I started hacking with my own hobby OS project.
First I created an all-assembly boot sector mini-kernel that booted into 64-bit long mode and then did a small multitasking test case , first co-operatively and then pre-emptively using timer interrupts.
Then I started over, this time with C and using a proper multiboot bootloader like Grub. I hacked with it for a while but my x86_64-specific code and kernel code were all over the place and it needed a reorganization.
So, recently I reorganized my code, added a CMake-based build system and put it in a Git repo, here: http://github.com/rikusalminen/danjeros
It doesn't do a whole lot, but it's a solid base I intend to continue when I have some time for kernel hacking. I'm sorry there's nothing in the README-file, I should at least add instructions for building the required cross-compiler (for TARGET x86_64-pc-elf), building (requires CMAKE_TOOLCHAIN_FILE for cross-compiling) and running with qemu and debugging with gdb.
If someone actually read this far and got inspired from the osdev articles, like I did, why not take a look at my DanjerOS project.
One of these years I'd like to create a mini Lisp multi-threaded kernel.