Open ApplePieCodes opened 2 weeks ago
Interesting, and not too far-fetched. Currently the compiler can produce ELF and Mach-O x86-64 binaries. In both cases, the compiler inserts only a little bit of startup asm code, and the rest of the runtime system and GC is written in Virgil. There are a handful of syscalls in the compiler-inserted asm code to set up signal handling and the stack, but the rest is in Virgil using Linux.syscall
or Darwin.syscall
. So switches to turn off that would allow generating a standalone ELF file, which a bootloader could load into memory.
If possible, could you attempt to implement this feature. It would make Operating System Development much easier.