8 ms·
To be clear, this is a tech demo; we're long past the point where running anything useful on a system with graphics and 4MB (8MB with expansion) of RAM under Li
by marcan_42 6y ago
To be clear, this is a tech demo; we're long past the point where running anything useful on a system with graphics and 4MB (8MB with expansion) of RAM under Linux is reasonable. You can barely get the kernel itself that small. There's a reason why even cheapo consumer routers have at least 64MB of RAM.
So it's for fun; you won't be able to run any existing "normal" Linux emulators and you'd be better off porting stuff to run on bare metal than trying to squeeze it in under Linux on an N64. Cool project, fun, great that it's getting upstreamed... just keep in mind it's not really useful for end users for anything (unlike, say, Wii Linux, where with ~80MB of RAM you can actually get somewhere, though still with many limitations).
OTOH, as other people have mentioned, it makes a good test case for N64 emulators. If they can run this, that's good validation.
- tutfbhuf 6y agoA microkernel would be a good fit for such constrainted environments.
- marcan_42 6y agoOS design methodology doesn't really have anything to do with its suitability for constrained environments. There are plenty of small monolithic and microkernel designs around.
- tutfbhuf 6y agoI would argue that a microkernel would be a good fit because: "Traditional operating system functions, such as device drivers, protocol stacks and file systems, are typically removed from the microkernel itself and are instead run in user space." - https://en.wikipedia.org/wiki/Microkernel https://en.wikipedia.org/wiki/Microkernel You want to throw out as many functionality as possible to get your kernel down in size to fit into e.g. 1 MiB of memory.
- marcan_42 6y agoThose operating system functions still need to exist and still consume RAM. It doesn't matter whether they run in userspace or kernel space. If you don't need those functions, you can remove them from kernel space in a monolithic kernel. It's possible to build Linux without TCP/IP support and with no on-disk filesystems.
- tutfbhuf 6y agoYes, it is possible to strip out subsystems from the linux kernel, but there are limits. For example: https://weeraman.com/building-a-tiny-linux-kernel-8c07579ae79d https://weeraman.com/building-a-tiny-linux-kernel-8c07579ae7... They achieved a compressed linux kernel size of just 749 kB which additionally requires at least 12 MB of RAM to boot. This is very impressive, but there a constrained systems with 1 MB or less of memory.
- laumars 6y agoThat’s a different argument to the one you opened with. The OP had already made the point that Linux isn’t really practical. But that doesn’t mean that a micro kernel OS would be any better than GNU/Linux. Ultimately you still have the same data stored into RAM (as others have said). What nobody has (yet) mentioned is that micro kernels typically run slower than monolithic kernels because user space / kernel space memory swapping is expensive compared to running everything in kernel space. This overhead would kill any performance you might get from a system with the hardware specs of an N64. So a monolithic design is absolutely the way to go (in facts that’s how N64 games are actually written —- one monolithic code base with shared memory). Pragmatically the only way to write software for the N64 is to go bare metal. As the OP said, this Linux port is a fun technical challenge but no OS would be practical (that is unless you’re just using it as a boot loader for other software).
- tutfbhuf 6y ago> That’s a different argument to the one you opened with. "A microkernel would be a good fit for such constrainted environments." No, that's exactly my argument. My argument is that the linux kernel (even if you strip everything out and create the most tiny linux kernel) is still too big for many constrained environments, e.g. a old router with 512 KiB memory (there are many devices that cannot run linux). However, it is possible to run a small microkernel on such a router, that's my point, nothing more nothing less, that's why I consider using microkernel a good fit. Then people argued that mircokernels can be as big as a linux kernel and that you can strip the linux kernel down in functionality and I agreed with them, but this does not contradict the point I made.
- zokula 6y agoYou assume microkernel means small, which is a bad assumption. Microkernels can be fat too, There are dozens of monolithic kernels smaller than the average microkernel.
- tutfbhuf 6y agoThere are always exceptions to the rules. As from Wikipedia: "In terms of the source code size, microkernels are often smaller than monolithic kernels. The MINIX 3 microkernel, for example, has only approximately 12,000 lines of code". But to satisfy your definition needs, I refer to small microkernels.
- marcan_42 6y agoThe kernel is small, because all the extra stuff is outside the kernel. It's still stuff that exists and consumes RAM.
- tutfbhuf 6y agoNo, because e.g. the monolithic linux kernel is filled with many things that you do not need (but others do) in very constrained environments. If you have a very small microkernel, then you can very explicitly only install the software in user space that you need, without having them pre-installed via kernel.
- hkt 6y agoReally, the term "micro" is about size, not functionality. The fact is, the Linux kernel can be compiled with features to suit constrained environments. It is just that these features are determined at build time, not run time.
- tutfbhuf 6y agoYes, that is true but there are limits as I've explained here: https://news.ycombinator.com/item?id=25544271 https://news.ycombinator.com/item?id=25544271 Also quite interesting this question already came up on Quora https://www.quora.com/What-is-the-smallest-in-size-Linux-kernel https://www.quora.com/What-is-the-smallest-in-size-Linux-ker... and also on many other websites: https://superuser.com/a/370588 https://superuser.com/a/370588