Inspired by UEFI, I want to skip the stage of the bootloader (grub, lilo, syslinux) and boot linux directly. Is this possible? Cant I just boot the kernel directly, or have a minimalistic bootloader that fits in the MBR?

  • 1
    Hmmm: blog.realcomputerguy.com/2012/05/… I'm pretty sure once upon a time I used to boot kernels from floppy disks with no bootloader or filesystem on them; there was a compilation option to tell it where to find the root fs. – goldilocks Feb 17 '14 at 14:34
  • I am just inspired by efi. I still have one of those bios pcs :D – ManuelSchneid3r Feb 18 '14 at 1:18

The space available in the MBR itself is tiny. (About 400 bytes or something.) That's way too small to fit an entire filesystem driver. Without a filesystem driver, there's no way to figure out where on disk the kernel is stored, and hence you can't load the kernel.

You could try hard-coding the location of the kernel into the MBR itself. But then if the file ever moves on disk (e.g., you defrag the disk), the system stops booting.

EFI apparently includes a FAT driver, meaning you can put a bunch of files on a partition that's formatted with FAT and load executables from there. So you could maybe put the Linux kernel onto that somehow... I don't know enough about EFI to say much about it.

|improve this answer|||||
  • 1
    +1 great post and MBR is 446 bytes exactly... :) – Sepahrad Salour Feb 17 '14 at 12:35
  • See here for technical info on MBR: en.wikipedia.org/wiki/Master_boot_record – slm Feb 17 '14 at 12:36
  • This is correct. Regarding EFI, compiling the Linux kernel with CONFIG_EFI_STUB=y will make it a valid EFI executable. You could then put that on a vfat partition for the EFI loader firmware. – JoshuaRLi Jan 15 '19 at 20:11

The same question has already been asked. I cannot flag it as a duplicate since the original was on superuser, not on unix. Here's the link: https://superuser.com/questions/415429/how-to-boot-linux-kernel-without-bootloader

|improve this answer|||||
  • The question here was explicitly if one can boot Linux from MBR (what implies not using UEFI), so the first answer applies. – soulsource Feb 18 '14 at 8:27
  • Thank you for explaining and you are right. My comment was not about your answer but really about the linked answer. In that Q OP had asked if it was possible and how. But he was never told how concretely. – user44370 Feb 18 '14 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.