Show HN: Running TempleOS in user space without virtualization (github.com)
TempleOS is an experimental OS designed to be simple and self-hosted with a JIT compiler. I was mesmerized by it but didn't like the hassle of using virtual machines to boot it up and move files around from the virtual drive.
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!
38 comments
[ 5.6 ms ] story [ 76.5 ms ] threadSo 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).
https://www.bible.com/bible/114/1SA.13.13
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...
That seems about right[1], but the MAP_FIXED_NOREPLACE flag has been a thing since Linux 4.17. What about using that?
[1]: https://godbolt.org/z/698dPcvf6
[1]: https://old.reddit.com/r/TempleOS_Official/comments/2pzdy6/c...
[2]: https://web.archive.org/web/20170305000952/http://www.temple...
After all, it's EXODUS is an "exodus" of the TempleOS kernel from ring 0 to 3, so I rolled with it.
Now make like your username and do one.
You don’t like it or can’t take it? Don’t dish it out, pal. Hahaha! :)
So which is it? Do you understand that schizophrenia is a serious mental illness that can cripple an individuals ability to process reality and participate in society?