
Bare Bones OS Kernel Tutorial - fogus
http://wiki.osdev.org/Bare_bones
======
mahmud
There is a Phrack article with a full kernel.

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.

~~~
kqr2
Is this the Phrack article you are referring to?

 _Protected mode programming and O/S development_

[http://www.phrack.org/issues.html?issue=52&id=17#article](http://www.phrack.org/issues.html?issue=52&id=17#article)

~~~
mahmud
yes

------
Jun8
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?

~~~
zerd
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....](http://homepage.ntlworld.com/edmund.grimley-
evans/bcompiler.html) Then I'm going to make graphics with something like mode
13h. Maybe not beginner projects, but extremely interesting and challenging.

~~~
jgnahz
Nobody wants to take a look at pintos? <http://www.scs.stanford.edu/10wi-
cs140/pintos/pintos.html>

------
njs12345
I like this series; it covers getting a bare metal kernel running on ARM
QEmu:[http://balau82.wordpress.com/2010/02/28/hello-world-for-
bare...](http://balau82.wordpress.com/2010/02/28/hello-world-for-bare-metal-
arm-using-qemu/)

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..

~~~
koenigdavidmj
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.

------
tejaswiy
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 ?

~~~
dfox
File system: yes. Shell: no.

~~~
aaronblohowiak
A shell is a dsl for calling fork/exec.

------
cefarix
I developed a kernel during most of my teen years. The source is still up on
sourceforge at <http://cefarix.cvs.sourceforge.net/viewvc/cefarix/source/> .
Hopefully it can be of some help to you!

------
sixtofour
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.

------
braindead_in
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.

~~~
mjschultz
Unfortunately, this is very x86 device dependent and most embedded devices are
not x86.

------
exDM69
tl;dr: my hobby OS: <http://github.com/rikusalminen/danjeros>

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.

------
davidw
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.

------
pnathan
Bringing a CPU up to run a program is quite a technical challenge.

One of these years I'd like to create a mini Lisp multi-threaded kernel.

------
robot
not really a kernel. try my microkernel: <http://git.l4dev.org/>

~~~
pharno
sure it isnt a full kernel. Its just a bare bone. Something where you can
expand upon.

------
5teev
Just FYI: this "Bare Bones" does not refer to the long-time Mac OS software
developer responsible for BBEdit, TextWrangler, etc.

~~~
stephen_g
To be honest, "bare bones" is a fairly generic term...

~~~
5teev
Yes, but as a daily BBEdit user, it was the first thing that crossed my mind.
Evidently I am the only one.

