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.
I just wasted ~2 hours reading various pages of this wiki, it's a great resource.
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?
My plan for a summer project is going to be to first make a really basic OS. Then I'm going to bootstrap my own language from nothing like this guy:
http://homepage.ntlworld.com/edmund.grimley-evans/bcompiler....
Then I'm going to make graphics with something like mode 13h. Maybe not beginner projects, but extremely interesting and challenging.
Perhaps for something that was embedded (like an OS for ARM microcontrollers or something), but a desktop or server OS is unrealistic.
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).
I'd say handling interrupts, paging/the memory subsystem, filesystems and scheduling were all pretty worthwhile.
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..
ARM's problem is that every board has a slightly different variant...different instruction sets present or absent, different boot code, and the like. Linus was throwing a fit a few days ago about merge conflicts in a bunch of tables (which he thinks should not even be in the kernel), and noted that 35% of platform-specific code in the kernel is ARM-specific.
Whenever I hear about Operating Systems, it reminds me of a comic on how a programmer evaluates the resume of another programmer and one of the items is OS / Compiler development experience is highly valued.
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 ?
What a great site. Besides the subject matter, I like the general idea of focused breadth and participation.
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.
This could be useful for embedded development. Booting a new kernel on any embedded device is tough. This could be handy if you're new trying to debug why your board isn't booting up.
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.
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.
No one here has mentioned Minix, so I'll go ahead. It's another fun system to play around with, and quite accessible. It's also enough to do 'real things', to some degree.
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.