4 ms·
> A minimal bootable image, including bootloader, operating system components and a complete C++ standard library is currently 693K when optimized for size. WO
by meesterdude 11y ago
> A minimal bootable image, including bootloader, operating system components and a complete C++ standard library is currently 693K when optimized for size.
WOW. That's just nuts! I mean I know linux can be slim, but thats less than a meg!
Really very exciting stuff. I don't know if I should play JC3 or tinker with this.
- Sir_Cmpwn 11y agoThis isn't Linux.
- andresmanz 11y agoI think that was just a comparison, because Linux can be very small.
- creshal 11y agoI'm pretty sure you can find MIPS Linux images with Busybox et. all. that weigh less than that. A lot of routers run Linux on 2M eproms including user space.
- david-given 11y agoI have a port of Alan Cox's Fuzix for the MSP430 where the entire bootable ROM image is 27kB. (That's actually quite big for a tiny-computer OS, although it's the smallest Unix I know of.)
- DiabloD3 11y agoFor those who don't know who Alan Cox is, he was the Linux 2.2 branch maintainer, is still heavily involved in Linux, and also does lots of other neat shit.
- cbsmith 11y agoI seem to recall the QNX kernel is pretty slim as well.
- pjc50 11y agoI used to have a 1.44Mb floppy that booted QNX to a desktop environment. Of course, that's not so unusual historically: both Amiga and GEM had single-floppy desktop enviroments (or did the Amiga require two to get to Workbench?)
- david-given 11y agoThat's just the microkernel, though --- it didn't contain any functionality other than sending messages (and a few other things, microkernels very). Fuzix' 27kB contains the scheduler, drivers, tty, file system and Posix subsystem!
- cbsmith 11y agoFuzix definitely was end to end. On the other hand, the QNX kernel is a more capable foundation to build on.
- pantalaimon 11y agoEmCraft shows a 594kB linux image for Cortex M4 http://www.emcraft.com/stm32f429discovery/what-is-minimal-footprint http://www.emcraft.com/stm32f429discovery/what-is-minimal-fo...
- deleted 11y ago[deleted]
- wtallis 11y agoYou won't find anything remotely recent squeezing into a mere 2MB. You can't really get Linux that slim anymore without cutting out major things like the network stack. 4MB is still (just barely) enough ROM for a real router, if you're judicious about what features to include, and don't mind the lack of a browser-based configuration interface.
- pantalaimon 11y agoIt still needs a 'real' OS (e.g. Linux) running as the Hypervisor. The entire concept appears to me like a fancy ELF, cause we couldn't solve the problem of packaging software in a portable way before, apparently.
- nathankunicki 11y agoNot strictly, no. While currently they only support the "hardware" in KVM/QEMU/VirtualBox, there's nothing stopping anyone implementing drivers for whatever hardware they want to run on, even bare metal. This probably means integrating whatever Ethernet adapter you have, and some way of sending/receiving stdio, probably over serial or something. Sideline: I'm particularly intrigued by the idea of implementing drivers for AWS EC2, so you can run this as your AMI.
- cbsmith 11y ago> I'm particularly intrigued by the idea of implementing drivers for AWS EC2, so you can run this as your AMI. Yup. Kind of like a skimpy version of OSv.
- uxcn 11y ago> Not strictly, no. While currently they only support the "hardware" in KVM/QEMU/VirtualBox, there's nothing stopping anyone implementing drivers for whatever hardware they want to run on, even bare metal. Exokernels (https://en.wikipedia.org/wiki/Exokernel https://en.wikipedia.org/wiki/Exokernel) essentially implement this. Hardware has been adding more support for virtualization though, so I imagine unikernels are better able to take advantage of things like virtualized page tables, virtualized io-mmu, etc... I'd be curious to see benchmarks for something generally IO bound like PostgreSQL or HyperTable. IO scheduling isn't trivial, so it might give a good idea of what some of the trade-offs might be.
- nickpsecurity 11y agoShould look at systems of the past for inspiration on that. Remember that old systems couldn't waste MB on stuff. So, they got clever. Hansen's Solo had 4KB trusted kernel with whole OS being 21Kloc of readable Pascal with total image size of 110KB. That includes kernel, filesystem, I/O, editor, and two compilers. Result was type-safe, mostly memory-safe, and concurrency-safe (deadlock & race condition free specifically). People could copy and update old approaches like that for OS side of things then they don't even need a unikernel. ;) Now, wanting strong separation mechanisms and so on would complicate things. The old security kernels, like STOP OS and GEMSOS, used MMU's, segments, MAC policies, covert channel suppression... you name it. STOP was still only 21,000 Kloc in total: http://www.cse.psu.edu/~trj1/cse544-s10/slides/cse544-lec9-10-security-kernel.pdf http://www.cse.psu.edu/~trj1/cse544-s10/slides/cse544-lec9-1... So, monolithic or micro-kernel route, you can get things way smaller at the foundation than what we use today. Add basic TCP/IP stack, Ethernet driver, and runtime it should still be way smaller than 693K unless that's tons of error or security handling code to increase robustness.