[clug] Booting without a bootloader & alternatives to /init
bob at cs.anu.edu.au
Wed May 20 23:41:59 GMT 2009
Ben Coughlan wrote:
> Hi All,
> 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? I've seen
> HOWTOs discussing how to do this with floppy disk, but I'm wondering how
> it can be done from a hard drive, or a compact flash card.
> Secondly; can I have the kernel run something other than /init when it's
> done booting? Ideally I would just like to call my application binary.
> Are there any services I'll be missing if I don't use /init? I don't
> need to spawn a shell anywhere, but I would like some DHCP action. I
> would also enjoy being able to pass arguments to this binary if at all
> 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.
> Ben Coughlan
Depending upon the BIOS features of your "very small/embedded" system,
you may want to look at replacing it with openbios, which is essentially
a BIOS replacement using a Linux kernel.
Essentially, you start the kernel "in place" in FLASH ROM (as opposed
to loading it from a FLASH device with a filesystem) and have it do all
your hardware initialisation etc. You obviously need a way to program/
reprogram your FLASH ROM without help from your main CPU (in case you
stuff up and "brick" your "very small/embedded" system...). If it is a
socketed ROM that is not so hard. Otherwise you may need a JTAG
interface to write the image to the FLASH ROM.
Advantages: saves lots of memory and boots _really_ fast...
Disadvantages: kernel upgrade takes on a whole new meaning...
More information about the linux