How to boot linux kernel without bootloader?

3

By default to boot image bzImage of a Linux kernel you need to use the bootloader. If you try to boot the image directly it will give the error:

Booting from Hard Disk...
Direct booting from floppy is no longer supported.
Please use a boot loader program instead.
Remove disk and press any key to reboot . . .

In the older versions of Linux it was possible with:

make zImage

Is it possible to boot without a bootloader in the newer versions of the kernel? If so, how?

Ravi D. Borse

Posted 2012-04-22T11:16:06.410

Reputation: 61

1Off topic, but: just go back to an older version of Linux. – Ernest Friedman-Hill – 2012-04-22T11:20:54.037

Answers

2

If you have a EFI based and configured system, you can compile or get a EFI enabled kernel (https://wiki.archlinux.org/index.php/EFISTUB). You can apply these tips to most if not all more recent distro's. I personally tried a full Linux from scratch build and a basic kernel with Busybox in a initramfs (pretty useless). Arch Linux works like a charm.

Either use a EFI bootloader like Grub or Clover, or make use of the EFISTUB ability of the kernel to directly boot the kernel and pass the kernel commands by use of a efi-variable. Again, Arch's wiki worked like a charm for me.
Note, I disabled Secureboot.

Or, besides various bootloaders that can be put in either the MBR or as an optionrom, you could try look at Coreboot (or libreboot) and make Linux your payload. I consider the EFISTUB option the easiest if your system supports it. You might want to check as well if the system has some kind of bootmenu to switch between OS at boot and to disable the secureboot option.

CodeAsm

Posted 2012-04-22T11:16:06.410

Reputation: 29

2

It's not possible. At least, not with the not-so-old kernels unpatched.

You have these options:

  1. use a bootloader.
  2. use an old version of linux.
  3. hack direct booting (ie a built-in bootloader) into the kernel source so it works more-or-less like floppy booting in the old days.

Michael Slade

Posted 2012-04-22T11:16:06.410

Reputation: 139

2

If you have an EFI based system, starting with Linux kernel 3.3 the firmware can directly load and execute the kernel.

Andreas Florath

Posted 2012-04-22T11:16:06.410

Reputation: 173

How would you set this up? – CMCDragonkai – 2014-07-02T07:23:14.000