[clug] Booting without a bootloader & alternatives to /init

Daniel Pittman daniel at rimspace.net
Wed May 20 12:04:00 GMT 2009

Ben Coughlan <ben.coughlan at anu.edu.au> writes:

> I'm working on using linux in very small/embedded environments and I'm
> currently in the process of stripping linux down to fit a specific
> system, and I have a couple of questions:
> Is it possible to boot the kernel without using a bootloader?

Technically speaking, maybe, because it really depends on your
platform.  On x86, no, not really, because the BIOS interface isn't all
that rich.

You are better off sticking with a standard booting mechanism ... but,
at the end of the day, if you can get your kernel into memory and get it
to execute from the appropriate entry point all is well.


> Secondly; can I have the kernel run something other than /init when
> it's done booting?

Well, it can run /linuxrc, but ... um ...

> Ideally I would just like to call my application binary.

... why don't you just place your application on disk as /sbin/init?

> Are there any services I'll be missing if I don't use /init?

Yes.  Something needs to be the ultimate parent of everything(tm), and
whatever runs as init is it.  It also enjoys other elevated privileges
and special behaviour that, if you don't understand them, you don't want
to try and implement yourself.

Um, and you get to take responsibility for all the console setup, too,
if you run as init. :)

> I don't need to spawn a shell anywhere, but I would like some DHCP
> action.

Is that built in to your system?

> I would also enjoy being able to pass arguments to this binary if at
> all possible.

Um, where from?  If you want the kernel to boot directly, and the
application to start instantly, isn't it just as easy to configure the
arguments directly rather than hard-coding them on the "command line"?

Specifically, I guess, where do you imagine these arguments would ever
be able to vary?

> And while I'm here; I've compiled my kernel by starting with 'make
> allnoconfig' and then rebooting/recompiling until I have a system
> running with the required drivers.  Can anyone think of any boxes I
> might want to tick that may not have been noticed in this process,
> keeping in mind I want it as small and uncluttered as I can make it.

Yes.  You probably want a few of the optional features that your
application expects, and you want the "EMBEDDED" option that allows you
to disable a whole bunch more features that you don't need in a deeply
embedded environment.


You are probably better off picking up a freely available embedded Linux
kit from the OpenWRT, Midori, Moblin or similar projects, you know.

More information about the linux mailing list