Curing the cancer called GRUB

My custom Linux kernel takes 3 secs to boot on my Thinkpad. The BIOS takes around 5 to get to the 1st stage boot loader. GRUB takes 10 to load itself.

I was thinking the following: Write a bootloader that takes the kernel and initrd from the raw hard drive like an embedded system. So it would go like this:

MBR_PARTTABLE_KERNEL_INITRD_FIRSTPART

That way it does not need to mount a partition, read from it, read the 2nd stage bootloader, read that one and then load kernel and boot. This way i can just load in the kernel raw from the SSD.

Any thoughts?

Other urls found in this thread:

github.com/wiktor-b/mlb
twitter.com/SFWRedditVideos

What does "boot" mean?

the first stage of the bootloader is limited to 510 bytes.

there's a reason the second stage exists.

Use LiLO

Good luck doing all that in 510 bytes mate. There's a reason there's 2 stages.You could definitely write your own minimal second stage but trust me when I say it's not worth the effort.

GRUB is a 2 stage bootloader. MBR stage 1 reads disk and loads GRUB stage 2 into memory from disk, as a kernel and initrd cant fit into the mbr

move kernel from disk to memory and execute it

my point was that you're not going to fit your entire boot loader into the mbr - you will still need 2 stages.

just use efi :^)

>The BIOS takes around 5 to get to the 1st stage boot loader. GRUB takes 10 to load itself.
What the fuck did you fuck up? Even on an HDD GRUB never took that long to start up.

is it really worth it though? how often do you restart your computer?

works on my musheen.

>10 seconds to load
My shitbox at home boots grub in like three seconds.

Get rid of the initramfs (make sure you compile anything you need for booting like filesystems and sata drivers statically, i.e not as modules) and use lilo.

Compile your kernel as an efi executable and boot it directly from EFI.

My Libreboot BIOS uses GRUB as the bootloader. It's nice.

Never turn off your computer.

It's orphaned and no longer being maintained by the developer.

Just use GRUB2.

>GRUB takes 10 to load itself
What

MBR isn't fixed size though?

Are you sure you're not confusing the wait time of GRUB?
You can adjust that, you know?

If you have EFI capability, switch to an EFI Stub Loader like rEFInd and a GUID Partition Table. Otherwise, just stick with Grub. It sucks but it works.

What's the problem with efi? I have found refind the most straight forward

Encrypted drive

if using an old thinkpad and it works, what does it matter that it is not maintained?

Install freedos and use loadlin ;^)

I stole and partially rewrote something close:

github.com/wiktor-b/mlb

INSTALL WINDOWS

Libreboot won't support booting it.

On my T60p Grub takes like 2~3s to load (even when I installed a custom theme).
The fuck you've done op?

Syslinux is fast as fuck

That might be a shitpost, but this is kinda what gahnoo+linucks is made for, so OP should try this.

I boot from a ssd and its almost instantaneous. Fast as shit

install refind