Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Compile to standalone x86_64 code for bare metal. #251

Open
ApplePieCodes opened this issue Jun 16, 2024 · 2 comments
Open

Feature: Compile to standalone x86_64 code for bare metal. #251

ApplePieCodes opened this issue Jun 16, 2024 · 2 comments

Comments

@ApplePieCodes
Copy link

If possible, could you attempt to implement this feature. It would make Operating System Development much easier.

@titzer
Copy link
Owner

titzer commented Jun 16, 2024

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.

@ApplePieCodes
Copy link
Author

Maybe add an asm running command like rust's asm!().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants