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

kernel image fields & zero out rbp #346

Merged
merged 3 commits into from
Aug 14, 2023

Conversation

devsnek
Copy link
Contributor

@devsnek devsnek commented Mar 5, 2023

these changes stemmed from my efforts to add stack traces to my kernel

  • kernel_addr + kernel_len for building a slice that holds the elf
  • kernel_image_offset for computing offsets from the instruction pointers in stack frames
  • convention says that you should zero rbp before jumping into your actual code so that you know where to stop the stack trace

@devsnek devsnek changed the title kernel image fields kernel image fields & zero out rbp Mar 5, 2023
Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this PR! Looks good overall, but we need to be more explicit about the different address spaces.

common/src/lib.rs Outdated Show resolved Hide resolved
common/src/lib.rs Outdated Show resolved Hide resolved
api/src/info.rs Outdated Show resolved Hide resolved
@phil-opp
Copy link
Member

There is some prior discussion about a similar change in #177. Back then I argued that might not want to guarantee that we keep the full kernel ELF file in physical memory and instead make it configurable. My original thought was that we might want to optimize the memory consumption. However, we haven't implemented such an optimization in the past two years, so I think I'm fine with merging this as-is now.

@devsnek
Copy link
Contributor Author

devsnek commented Jul 29, 2023

@phil-opp is anything still remaining here? could it be merged?

@phil-opp phil-opp merged commit 7c8e2ca into rust-osdev:main Aug 14, 2023
8 checks passed
@phil-opp
Copy link
Member

Thanks for the adjustments! Looks good, sorry for the slow review.

@devsnek devsnek deleted the x/kernel-image-fields branch August 14, 2023 17:21
@phil-opp phil-opp mentioned this pull request Dec 28, 2023
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.

None yet

2 participants