Bona Fide OS Development

OS with Linux Kernel Tutorial
Page 1 of 1

Author:  arcandersen [ Sun Jul 18, 2010 11:58 am ]
Post subject:  OS with Linux Kernel Tutorial

Can anyone point me to a tutorial that shows the steps for using the linux kernel as the basis for a custom OS.

Author:  Ford [ Tue Jul 20, 2010 1:57 pm ]
Post subject:  Re: OS with Linux Kernel Tutorial

That largely depends upon what you mean by "custom OS". if you are looking for information on creating a Linux distribution you may want to look at linux from scratch. Otherwise, you would want to grab a book on Linux kernel development, and look into what sys calls Linux supports and what POSIX compliance it has.

Author:  arcandersen [ Tue Jul 20, 2010 2:13 pm ]
Post subject:  Re: OS with Linux Kernel Tutorial

Thanks, I just bought the books Profession Linux programming and Linux Kernal Architecture today.

I'm not really interested in a custom distribution, here is what I'm after: I have some server software that runs on has been tested on OpenSuSe and Fedora. What I would like is to turn it into some sort of linux appliance (virtual or other wise.)

So what I was thinking is if I could find out a little about what I need to know in order for the kernel to load and start my framework piece (which would be my os (shell and support apps))

I thought about the linux from scratch approach but it seems like all I really need is the kernel, the boot loader (grub) and someone/thing to show me a way to load my application after the kernel is loaded.

Any assistance would be greatly appreciated, or am I way off base?

Author:  Ford [ Tue Jul 20, 2010 8:08 pm ]
Post subject:  Re: OS with Linux Kernel Tutorial

well, you would need to map every single dependency that the server software has. Typically, this isn't much. For example, if you were setting up a webserver you might have:

Linux 2.6.33, BusyBox, Iana-Etc, zlib, e2fsprogs, perl/php5/python/falconpl/ruby, openssl, openssh, termcap, iptables, and nginx (though busybox does have an httpd in it already)

Adding to this you will have to create a root file system, get a cross compiler set up, write some boot scripts, and configure everything.

your main issue here is that open source software is mostly built on top of other open source software. the web of dependencies is vast, complex, and often the source of endless frustration. this is made especially poignant when developers either do not release all of the dependencies of a given piece of software, or when they neglect to mention a dependency and are insanely difficult to get in touch with.

Now, if the server software you use does not have ANY dependencies, you could get away with only having busybox and a kernel... You could also simply create all of the tools you need, which is where the books you bought will come in handy. Those books will also come in handy in the case that you would like to tailor the kernel, the init system, and everything else to you own liking for this server software.

Linux is structured in a somewhat odd way if you are coming from the Windows world. Basically, the boot loader puts the kernel in memory. Linux separates memory into user space and kernel space, where drivers are loaded as modules and run as user mode processes. The kernel, once loaded, looks for an init system. The init system loads services (daemons in UNIX talk). By default the kernel will look at /sbin/init which normally doesn't happen. Most distributions use either sysvinit or upstart, neither of which are simple. Init will launch getty at some point. Getty will wait for input of a username, and once that input is given it will launch login and pass the user name to login. Login will then compare that input to the password file, upon a match it will fire up a shell, upon mismatch it will die and return control to getty. If you are looking to essentially create a non-GNU/Linux you would need to write the init system, the getty program, the login program, and the shell. The shell could be a single executable with all of the commands built into it (like busybox), or it can be several small programs that are accessed through a command interpreter (like bash) (coreutils, linux-utils, asmutils all expect bash or some other command interpreter to be present). These things alone would not be enough either. You would need a way to activate and setup your network connection. This is normally done by ifconfig and dhclient/dhcpcd. Beyond that, if the server software looks for any other applications, commands, or libraries you may need to write implementations of the things that it depends upon.

Some useful sites: ... -2.6-i386/ ... calls.html

Author:  arcandersen [ Tue Jul 20, 2010 8:34 pm ]
Post subject:  Re: OS with Linux Kernel Tutorial


Thanks for the detailed post. After reading your reply I'm wondering if the easier path is to walk through the linux from scratch and make a "custom scaled distribution", rather than trying to turn my server software into an OS.

I need to read a little, I thought the process was going to be a little easier. I just wanted an easier way to release my software and have it run with just the kernel and the glibc library, but it seems like any way I go will be a little more involved than that.

Author:  Ford [ Wed Jul 21, 2010 8:41 am ]
Post subject:  Re: OS with Linux Kernel Tutorial

What is the server software? Do you know what dependencies it has?

Author:  arcandersen [ Wed Jul 21, 2010 10:32 am ]
Post subject:  Re: OS with Linux Kernel Tutorial

Hello Ford,

The first part is a framework piece, written in C++. It handles things likes the object library, clustering, data access, caching, services and also a httpd

I'm using the libpq to handle data access and also using openldap. The rest is just kernel system calls.

The other pieces are an integration server, commerce server, portal server, customer relationship management server and a web based spreadsheet / data analysis server that operate over this framework.

I also the full product suite written in C# (Mono and Microsoft.Net). I like this version alot better but not sure how I would include Mono in the trimmed OS.

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group