News for hackers. Stuff that matters.
Re:Busybox-based Linux distro from scratch by splitbrain on Tuesday December 01, 2020 @08:28AM (#25264905)
"Maybe some people know, some does not, that Linux is itself a boot loader of some kind. At least, when using UEFI and this is what I want to use, it can be loaded directly by UEFI firmware. [...] it won’t be as simple as that, for legacy BIOS."

Hmm I remember it being that easy back in the early 2000s. IIRC it was enough to copy the kernel to a floppy disk and have it boot. Well, back then the Kernel and Busybox fit easily on a single 1.5MB disk...

Re:Busybox-based Linux distro from scratch by thesuperbigfrog on Tuesday December 01, 2020 @09:54AM (#25265663)
Many years ago I ran muLinux (http://www.linfo.org/mulinux) on an old desktop that I was gifted.

It was surprisingly capable for being so tiny and eventually led me to install Slackware (https://en.wikipedia.org/wiki/Slackware) on a better machine that had a CD-ROM drive.

Re:Busybox-based Linux distro from scratch by jrwr on Tuesday December 01, 2020 @09:48AM (#25265609)
There still was a tiny bootloader happening on that floppy. I /think/ back then it was still lilo (slackware boot floppies) OR syslinux bootloaders
Re:Busybox-based Linux distro from scratch by splitbrain on Tuesday December 01, 2020 @10:07AM (#25265777)
I'm relatively sure it worked without lilo (but that's so long ago I might be wrong).

This stackoverflow question suggests support for this was explicitly dropped from the linux kernel: https://superuser.com/questions/415429/how-to-boot-linux-ker...

Re:Busybox-based Linux distro from scratch by 0xbadcafebee on Tuesday December 01, 2020 @11:20AM (#25266531)
Yep, you had to modify the kernel to set some options so that it would know what device held the initrd (and where on the disk), and then you could dd that to the floppy and dd the initrd after it. At boot time the BIOS would load the kernel from the floopy, Linux would open the fd device, adjust the device to seek to the beginning of the initrd, mount the initrd, then load and execute init.

But the later convention was to create a loopback device tied to a disk image, mkfs.minix it, mount it, copy the kernel and an initrd, and run lilo on the loopback device. Then unmount and decouple the loopback from the disk image and dd that to the floppy. It didn't really take up any extra space and made it easier to update your initrd or kernel.

Re:Busybox-based Linux distro from scratch by 0x0 on Tuesday December 01, 2020 @02:02PM (#25268557)
The BIOS only loads a 512 byte sector, never a whole kernel. So if you want to directly boot a zImage, the first 512 bytes of the zImage would need to implement floppy sector reading loops to load the rest of the kernel block by block.
Re:Busybox-based Linux distro from scratch by 0xbadcafebee on Tuesday December 01, 2020 @10:38PM (#25272989)
I think you're right, it could be I used uncompressed kernels for the first example (it's been a few years...)