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

How do I map to a virtualized physical address? #433

Open
stevefan1999-personal opened this issue Sep 5, 2023 · 1 comment
Open

How do I map to a virtualized physical address? #433

stevefan1999-personal opened this issue Sep 5, 2023 · 1 comment

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented Sep 5, 2023

I'm trying to mimic Linux kernel behavior to shift the physical offset to start from 0xffff888000000000. However I'm trying to do this without the OS knowing this proactively (I have a custom UEFI bootloader that sets up an independent page table away from UEFI's influence), so that I can implement KASLR easily later.

I also have a ELF loader to relocate my kernel into the right virtual address, or at least it should somehow work.

The problem is, since all the physical memory will start at 0xffff888000000000, that won't pass PhysAddr::new right? And so it won't be a valid PhysFrame either.

@Freax13
Copy link
Member

Freax13 commented Sep 15, 2023

I think there's a misunderstanding here: PhysAddr is a type used for physical addresses, not the virtual addresses of mappings of physical memory, these should use VirtAddr.

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