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

feat: remove NASM dependency #926

Merged
merged 1 commit into from
Sep 21, 2023
Merged

feat: remove NASM dependency #926

merged 1 commit into from
Sep 21, 2023

Conversation

mkroening
Copy link
Member

@mkroening mkroening commented Sep 21, 2023

This migrates the x86-64 application processor boot code from NASM to GNU assembly language.

boot.asm is replaced by boot.s.
Instead of NASM directives, their GNU assembler (as) equivalents are used.
This assembly file is embedded in an LLVM assembly language file with only one module level (global) assembly statement.
Rust bundles llvm-as, which we use to translate the LLVM assembly to LLVM bitcode.
The resulting file is linked to binary using the bundled rust-lld.
The final binary is exactly the same as before, bit for bit.

This finally removes NASM as the last non-Rust toolchain dependency.

Closes #914

This migrates the x86-64 application processor boot code from NASM to GNU assembly language.

`boot.asm` is replaced by `boot.s`.
Instead of NASM directives, their GNU assembler (`as`) equivalents are used.
This assembly file is embedded in an LLVM assembly language file with
only one module level (global) assembly statement.
Rust bundles `llvm-as`, which we use to translate the LLVM assembly to LLVM bitcode.
The resulting file is linked to binary using the bundled `rust-lld`.
The final binary is exactly the same as before, bit for bit.

This finally removes NASM as the last non-Rust toolchain dependency.

Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
@stlankes
Copy link
Contributor

You want that I am not longer able to extend the code? :-)

@stlankes
Copy link
Contributor

Ok, you use "intel syntax"...

@stlankes stlankes added this pull request to the merge queue Sep 21, 2023
Merged via the queue into hermit-os:main with commit 7d9cd98 Sep 21, 2023
9 checks passed
@mkroening mkroening deleted the rm-nasm branch September 21, 2023 20:06
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

Successfully merging this pull request may close these issues.

Remove dependency on NASM
2 participants