News for hackers. Stuff that matters.
Re:Tinycore Linux by skyde on Saturday November 21, 2020 @11:37AM (#25170645)
it sad that the minimum to boot linux is now 11MB. I recall booting a full QNX desktop demo from a 1.44mb floppy :-(

Why is the kernel so fat ?

Re:Tinycore Linux by G4E on Saturday November 21, 2020 @11:47AM (#25170733)
I guess you're talking about storage size and not RAM, so you should check out openwrt. There are still a lot of micro router which are still 4MB rom / 64 MB ram. I compiled and run the 19.06 release (with a 4.19 kernel) on one of this target, a WR702N, last week actually :)

the kernel itself is about 1MB.

Re:Tinycore Linux by Fnoord on Saturday November 21, 2020 @04:19PM (#25172848)
The QNX 4 demo was astonishing, but after QNX 4 they skipped 5 and 6 was a lot bigger already. One important developer also passed away back in those days (~2001).

There was also BeOS and Amithlon [1], AmigaOS running on x86-32 (IIRC booted up with some patched Linux kernel). Archive.org supposedly preserved this. [2]

20 years ago, one could run a Linux firewall on a floppy. One good thing about that, is that you could have a floppy physically put to read-only mode (SD cards also have this feature).

[1] http://www.hd-zone.com/amithlon/

[2] https://archive.org/details/amithlon

Re:Tinycore Linux by wademealing on Saturday November 21, 2020 @08:43PM (#25174176)
Ive recently learned that the 'write protection' of sd is an honor system.
Re:Tinycore Linux by musicale on Saturday November 21, 2020 @08:47PM (#25174190)
A full Oberon system image is about 1MB, including GUI, utilities, and the compiler, though a 100KB image can boot and run a text editor.

https://schierlm.github.io/OberonEmulator/

The original Oberon system was something like 12,000 lines of code, something you could imagine reading in its entirety.

IIRC most of the Linux kernel source code is device drivers; the linux kernel also has a huge amount of functionality, much more than you need just to boot a PC into a GUI. Much of Linux user code is bloated libraries with a good deal of duplicated functionality.

Many GUI-based systems from the 1980s and 1990s were very compact by modern standards. (Even a full Smalltalk-80 system image is less than 2MB including the source code.) You can still run RISC OS on the Raspberry Pi to try out a 1980s/90s-style PC OS. Classic text-based UNIX OSes were obviously also dramatically smaller than modern Linux distributions.

Regarding device drivers, I wonder if the BIOS approach is better - assume the hardware vendor supplies the device drivers, and let the OS use those drivers rather than supplying its own. Someone will probably argue that "oh legacy BIOS is 16-bit, doesn't support [caching/acceleration/scatter-gather/async/polling/ feature x] or hardware vendors don't know how to write drivers or it's closed source or blah blah blah" but that would be missing the point that the idea of separating the driver subsystem from the OS might not be such a bad one.

Re:Tinycore Linux by neurostimulant on Saturday November 21, 2020 @11:41AM (#25170685)
You should be able to reduce the size by compiling the kernel yourself and disable features you don't need. Not sure how far you can shrink it down though, probably not enough to fit in a floppy anymore.
Re:Tinycore Linux by skyde on Saturday November 21, 2020 @12:24PM (#25171039)
thanks it’s good to know the fat can be opted out at compile time. I am very curious what a modern kernel contain that an old linux kernel did not that would make it more than 30 times bigger
Re:Tinycore Linux by Teknoman117 on Wednesday November 25, 2020 @04:54PM (#25214708)
Three major areas - Device Drivers, Virtualization, and Network Filtering

It's not so much fat as it is feature support and what's enabled by default. Most people want the "default" configuration to work out of the box on whatever computer they have. E.g. If you take a look at "x86_64_defconfig", nearly every Ethernet card that Linux supports is enabled. Odds are you only have one of those in your (desktop) system. However, unless you shopped around for specific NICs, odds are you don't own two systems that use the same ethernet driver.

For those of us who want to only compile the support for exactly what we use, it is still possible to compile the kernel small enough to boot off of a 1.44 MiB floppy with a minimal initial ramdisk, assuming the system you want to use it on is old. Modern systems require so much more code to use the hardware in them, and as Linux has become the single most used operating system kernel on the planet, the amount of code for device drivers has grown astronomically.

The kernel contains a minimal configuration called "tinyconfig" which turns off literally anything that be while retaining a functioning kernel. A tinyconfig kernel + TTY support compiles to about 500 KiB. Enabling all of the drivers to support hardware via the BIOS (AT style disk control, floppy, display out, etc.), and ELF support will yield a kernel of ~790 KiB, a little more than half of your 1.44 MiB floppy. Assuming you can fit useful userspace tools in the remaining space, you could still load from a floppy.

Re:Tinycore Linux by jlgaddis on Saturday November 21, 2020 @01:09PM (#25171435)
> I am very curious what a modern kernel contain that an old linux kernel did not ...

Um, perhaps support for all of the hardware, filesystems, network protocols, etc., that did not exist?

Re:Tinycore Linux by Teknoman117 on Wednesday November 25, 2020 @05:01PM (#25214782)
The only measure by which I believe it would be acceptable to judge Linux "fat" would be to compare the size of kernels generated using "tinyconfig". Basically, everything that can be disabled without rendering the kernel useless it turned off. You're only left with the core of the kernel. At this point in time, you get a kernel image that's like ~450 KiB.

If you actually want to boot that on real hardware, you can enable the drivers that are stubs into the BIOS calls for classic devices (disks, serial ports, SVGA graphics, etc.) for another ~100 KiB. It's extremely limited though - no specific PCIe support, ACPI, networking, etc.

Re:Tinycore Linux by neurostimulant on Saturday November 21, 2020 @08:20PM (#25174051)
Raspberry pi kernel 4.14 on my pihole is around 4-5MB, linux 4.4 generic kernel in ubuntu 16.04 on one of my older box is around 6-7MB, and Linux 5.4 generic kernel on ubuntu 20.04 on my vps and desktop is around 12MB. Tuning down the size of the compiled linux kernel seem to be a sport of some sort, with many guides like this [0] available online.

[0] https://elinux.org/Kernel_Size_Tuning_Guide

Re:Tinycore Linux by forty on Saturday November 21, 2020 @01:09PM (#25171428)
Drivers for all the hardware that was created in the meantime for example :)
Re:Tinycore Linux by megous on Saturday November 21, 2020 @01:33PM (#25171651)
That's usually compiled as modules.
Re:Tinycore Linux by StreamBright on Saturday November 21, 2020 @01:47PM (#25171758)
Because of lack of modularity. Drivers became really big over time and those usually live in the kernel. It would be great to see a more detailed breakdown of the actual space usage of recent kernels.
Re:Tinycore Linux by jecel on Saturday November 21, 2020 @02:28PM (#25172124)
You can run Linux off of a single floppy (though formatted as a bit more than 1.44MB):

http://www.toms.net/rb/

Text-only, however, unlike the QNX demo.

Re:Tinycore Linux by dredmorbius on Saturday November 21, 2020 @03:17PM (#25172459)
Tomsrtbt is based on a 2.2 kernel which may have problems with modern CPUs and devices. It remains amazing for what it does.