228 points · by 1fishe2fishe · 2y ago · 36 comments
My project lets you run TempleOS as an app of some sort instead of using a virtual machine to run it - this brings a lot of benefits like speed, seamless filesystem integration (virtual machine development with stock TempleOS is really a pain.), command-line mode where you can code in HolyC on the command line instead of TempleOS' GUI.
Its user-space nature lets it do networking quite easily with the FFI - it even features an IRC server, client and a wiki server!
I've also added a bunch of third-party games and software written for TempleOS on the Community folder, I hope you people take a look and enjoy!
After all, it's EXODUS is an "exodus" of the TempleOS kernel from ring 0 to 3, so I rolled with it.
So I can just map some pages in the host process and the host process' address space becomes the HolyC kernel's entire address space, which is ironic since Terry was always adamant about how he disliked modern isolated per-process address spaces and that turned out to be a key to porting his OS to Ring 3.
I did need some code for "code pages" though - since all function calls in TempleOS use the 32 bit relative call instruction, all compiled HolyC code go in the lower 32 bit address space. Some Linux distros like to map the ELF binary at that address range too, so I have a routine to read /proc/self/maps and avoid mmapping those areas (I was surprised mmap can overlap without any signs).
I bookmarked their Mac workaround around here: https://github.com/wine-mirror/wine/blob/b2a099b3ceec6fef05c... which involves rearranging the zero page and creating a big WINE_RESERVE section.
On Linux it appears they use a -Ttext linker flag to reposition the code location, but I haven't read it too carefully: https://github.com/wine-mirror/wine/blob/b2a099b3ceec6fef05c...
[1]: https://github.com/1fishe2fishe/EXODUS/blob/90f70386b8ac6bd0...
[2]: https://github.com/1fishe2fishe/EXODUS/blob/90f70386b8ac6bd0...
[3]: https://github.com/torvalds/linux/blob/8f2c057754b25075aa3da...
[1]: https://old.reddit.com/r/TempleOS_Official/comments/2pzdy6/c...
[2]: https://web.archive.org/web/20170305000952/http://www.temple...