x86_64 icon indicating copy to clipboard operation
x86_64 copied to clipboard

How do I map to a virtualized physical address?

Open stevefan1999-personal opened this issue 2 years ago • 1 comments

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.

stevefan1999-personal avatar Sep 05 '23 06:09 stevefan1999-personal