|
|
|
|
|
by 1fishe2fishe
799 days ago
|
|
That was actually a very easy part of EXODUS. Since TempleOS is basically a unikernel, it doesn't need any code for per-process virtual address space. 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...