How to boot linux kernel without bootloader?

8,458

Solution 1

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

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

Solution 3

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.
Share:
8,458

Related videos on Youtube

Ravi D. Borse
Author by

Ravi D. Borse

Updated on September 18, 2022

Comments

  • Ravi D. Borse
    Ravi D. Borse over 1 year

    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?

    • Ernest Friedman-Hill
      Ernest Friedman-Hill about 12 years
      Off topic, but: just go back to an older version of Linux.
  • CMCDragonkai
    CMCDragonkai almost 10 years
    How would you set this up?
  • Ciro Santilli Путлер Капут 六四事
    Ciro Santilli Путлер Капут 六四事 almost 4 years
    I'd say though that the only reason we don't call EFI a "bootloader" is because it is as large as Linux :-)