[SOLVED] How to compile Linux Kernel and write it to a 1.44M floppy disk?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You built the kernel, build all the needed drivers in, then there is no need for modules and/or initramfs.
I second that. The drivers you really need are those for your drive controller (in my case xhci) and root filesystem. Once the kernel has access to your root partition, it can load drivers for less fundamental things like sound or network. Drivers for hardware you don't even have shouldn't be built at all.
I wasn't able to get the bzImage down enough with kernel 6.5 so I decided to go with putting it on a CD. One more question, how would I go about putting network card drivers in the CD? Is there a file I need to put in the initramfs or something?
That, IMHO, is crazy to even try. There's been so much added to that kernel since the '486 days with security enhancements, protocols, the conversion to 64-bit, etc. I know from being on the Tomsrtbt forum when it was a thing that Tom had tried and failed to get even a 2.2 kernel into his 1.82MB floppy. Libc6 was out in 2000, but Tom didn't have the space to update. Knock yourself out out if you want to, but it's unfair to waste the time of other folks without being open with them.
What did you get the 6.5 kernel down to? 5MB? Go on - how near are you?
In post #27 I linked the Tomsrtbt-2.0.103 archive which formats a floppy to 1.82MB and will dd a disk to it. Also instructive is to reverse engineer early distros which were put out on floppies.
For the record, I have a 5.15.63 kernel source here. I ran the following
Code:
cd /usr/src/linux-5.15.63
make distclean
make allnoconfig
make -j12
The resulting bzImage in arch/x86/boot was a bit over 1.3MB (1348880 bytes). That leaves you 100k for everything else on your 1.44MB floppy. It drives nothing. It won't boot. It won't handle the ISA bus, serial/parallel ports, even the floppy drive once you're going. That's booted from the BIOS, but needs a module to run once the kernel is up.
Post #27? Or knock yourself out with a 2.2 kernel.
Can't unneeded features and drivers be disabled (or stripped out) from the kernel to keep the image small?
Well of course you'd do that. The whole point of compiling your own kernel is not to build the bits you don't want. But with a modern kernel, even the stripped down version won't fit on a floppy
Since OP is trying to re write the wheel on old gear. So not sure if helpful not
8 bit gear is getting harder to deal with as time moves along.
antiX was full install was a no go on that 8 bit machine, Probably a core iso like a Debian net install but I am not sure of OP linux skill set. Talking about a net install and build from scratch from there kind of skills.
Well of course you'd do that. The whole point of compiling your own kernel is not to build the bits you don't want. But with a modern kernel, even the stripped down version won't fit on a floppy
Can I remind you guys that the OP has had the solution since post #27 and isn't currently contributing? Tom Oehser couldn't even squeeze the 2.2 kernel onto his 1.82MB (=1.44MB but more densely formatted) floppy without dropping something he considered more important.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.