Do you plan on writing your own tcp/ip stack with cosmopolitan? Why not pull in the networking stack and syscall libraries from MirageOS?
Just double-checking--it is still written in c?
A battery discharge rate of 0.5%/h in sleep is just great... but I think I can do better: I'm now trying for 0.25%/h.
Imagine if you could immediately resume your foldable oled tablet, and it'd have only lost like 6% of the battery. With a 20% hibernate trigger, it would remain immediately available for over 3 days straight!
> It'll be nice to know that any normal PC program we write will "just work" on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn't need to be installed beforehand. The tradeoff is that, if we do this, binaries will only be 10x smaller than Go's Hello World, instead of 100x smaller. The other tradeoff is the GCC Runtime Exception forbids code morphing, but I already took care of that for you, by rewriting the GNU runtimes.
Also this, from a GitHub issue (https://github.com/jart/cosmopolitan/issues/354#issuecomment...):
> Probably related to #399. The recommended approach would be to use a full emulator like Bochs. It's not something we use at the moment so we can't provide support on this. Although we do intend to have APE support ARM at some point in the future.
I love the spirit :)
> The main blocker is figuring out how to get an e1000 and/or VirtIO driver in there with a TCP/IP stack.
Why? Is it for performance reasons or security reasons? (or both)
> Right now Cosmopolitan bare metal support is only adequate for stdio applications, which use the serial port and read from the zip fs.
I'd suggest you "think different", and use instead something like ppp to create a TCP/IP stack over a serial link.
Modern btuart implementations already routinely achieve >1Mbps on commercial devices. The GSI as seen on the Intel Serial IO devices support bitrates over 20Mbps.
This could buy you time until you find a better solution, if it's ever needed (which I doubt as back of the envelope estimations make me believe you'll hit other limitations before)
I can have a look at using ppp for creating a network connection using stdio. It doesn't look very complicated.
> it's hard to test kernel code
Exactly why I suggest pppd (userland) instead of VFIO
> So I not only need to build the kernel but I need to emulate the CPU features the kernel needs too
You have stdio? No need for anything else.
My comment about not knowing if running redbean on bare metal was sarcasm was a comment about me, not about redbean or Justine, so no disrespect intended.
There's a lot of "turtles all the way down" today (a web server compiled to WASM so it runs in a browser running on a OS hosted in QEMU that's running on another host OS that's a virtual machine running in a linux container on top of a hypervisor running on an X86 simulator...) so I quite honestly couldn't tell if the idea of running redbean on bare metal was sarcasm or a joke.
But Justine says its true, so I guess it's not a joke. Consider me schooled.