KolibriOS is an open-source Operating System for x86 (32-bit, 586-class and above). It is entirely written in assembly (assembled with FASM). It requires only 8MB of RAM to boot. It has a TCP/IP stack and USB support. It has a graphical user interface which is actually on par with most of the "lightweight" Linux window managers, such as LXDE (but I think LXDE is probably larger than this entire OS lol). It fits on a single floppy.
I remember when I could (and did) run Linux on a 486 with 8MB of RAM and 200MB of HD. Ran X11, fvwm, emacs, Netscape. It used to be possible. These things were done in the 90s :-)
For anyone interested in trying, remember to cut down your kernel. The default kernel on my (64 bit, granted) laptop is 12MB, compressed, without any modules.
NetBSD is a bit easier to run on 8MB systems these days. Still not super easy, but less fat to trim off. I think you might still need to trim down the default kernel, but at least there is a premade config for that (GENERIC_TINY)
If you're daring, it should work on 4 MB machines... ;)
The modern NetBSD kernel is is over 30MB and around 10 to 13 MB compressed in size on i386 and x86_64. So idk were you are getting its going to run in 8MB of memory without major swap slowdowns if it boots at all.
That's why I said you'd probably need to use a GENERIC_TINY kernel, which is "supposed" to work on 4MB systems.
Now, it's entirely possible that even with this minimal config it'll take up too much space, but it may work. I got NetBSD 8 to run on a VAX with 8MB of RAM, although that kernel has many fewer drivers/modules.