Closed microspino closed 3 years ago
Bare metal is currently less developed than the support that exists for userspace. Our support on metal is currently limited to read() / write() to serial uart and mmap() / malloc() are supported too. I'd like to have e1000 and virtio at some point too so we can run redbean on metal in the cloud without needing linux as a dependency.
The closest thing we have to a walkthrough at the moment is this: https://justine.lol/cosmopolitan/deathstar.html which shows how to get a demo from rosetta code to boot in qemu. It's also possible to run any of the programs in this repository inside the blinkenlights emulator too. For example:
make -j8 o//tool/build/blinkenlights.com o//examples/hello.com
o//tool/build/blinkenlights.com -rt o//examples/hello.com
Let me know what you think!
The main blocker at the moment in terms of developing this support further is simply my lack of experience in operating system development. It's something I've been gradually learning for fun and that's been a slow process, which could easily be sped up if we could attract some seasoned kernel devs to the project.
What about UEFI? It's mostly seen as an operating system itself, and provides "protocols" to access to the hardware, including graphics and networking. Think of them like standarized BIOS calls on esteroids :-) This way it could be possible to run on real hardware too without needing to write (too much) drivers, not just only emulators... A different topic would be the quality of these drivers, or the lack of hardware acceleration...
https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/3_foundation/36_protocols_and_handles https://archive.fosdem.org/2018/schedule/event/hwenablement_uefi_for_dummies/attachments/slides/2381/export/events/attachments/hwenablement_uefi_for_dummies/slides/2381/Programming_UEFI_For_Dummies.pdf
https://wiki.osdev.org/UEFI#Developing_with_POSIX-UEFI https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/examples
@piranna as far as i know It has ben already explored succesfully in #12 as an alternative to windows support. It would be nice to see an example of it with readbean. It's above my head but, maybe, UEFI has more juice than BIOS for a webserver.
It's above my head but, maybe, UEFI has more juice than BIOS for a webserver.
Yes, it have, starting from the networking support :-) There are in fact some Rust crates that allow to create HTTP servers and other things using standard tools :-)
I understand also that Libreboot comes with ROM images built for QEMU. That could be another way to explore. I will dig more about it in my spare time.
As soon as I have time I will try with UEFI. I think closing this would help focus all the efforts on other cosmopolitan issues.
Hi this thing is super cool. Super super cool! I've read it could run ALSO on bare metal. It's not clear how. I know you guys are busy making this thing better and better but if you ever find some spare time, would you mind adding an example of running it, maybe on a bare metal x86? I have a few thin clients, mostly by 10Zig and I've been dreaming about running with something like redbean. I know you completed integrating Lua and that Janet is not far away therefore i think i could use them on the server side as well...Maybe... I will be more than happy to test this configuration and report feedback. Feel free to close this issue if you think I'm out of my mind.