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: add bare metal support #6

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

Godones
Copy link
Contributor

@Godones Godones commented Oct 30, 2024

I want to use this library on an OS implemented in Rust, which is not Linux/macOS/Windows, and the library lacks support for bare metal OS. Since we cannot know how these bare metal OS modify the code segment, I simply overwrite the memory in the ArchCodeManipulator::write_code function. Bare metal OS developers should complete the relevant operations before and after updating the key.

@Evian-Zhang
Copy link
Owner

I'm very glad to merge this PR. However, I know little about bare metal, and before merging this PR, I want to make sure things will go well. My question is about the section naming. Will the bare metal linker generate the correct __start/__stop symbols to mark the start and end of customized section? Is there any way to test in bare-metal environment for GitHub Actions CI? (If not, that's OK still. I will just mention it in the README)

@Godones
Copy link
Contributor Author

Godones commented Oct 30, 2024

Typically, OS or other programs developed on bare metal include a custom linker script, so I think we should add some documentation here to tell people who use this library on bare metal that they should manually add these symbols to their linker script.

@Godones
Copy link
Contributor Author

Godones commented Oct 30, 2024

I can't find a better way to test in bare-metal environment for GitHub Actions CI because this may require a simple OS running on bare metal.

@Evian-Zhang
Copy link
Owner

OK, thank you for your contributions! :)

@Evian-Zhang Evian-Zhang merged commit 8526b17 into Evian-Zhang:master Oct 30, 2024
12 checks passed
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.

2 participants