Skip to content

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

Open
@stevefan1999-personal

Description

@stevefan1999-personal

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.

Activity

Freax13

Freax13 commented on Sep 15, 2023

@Freax13
Member

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Freax13@stevefan1999-personal

        Issue actions

          How do I map to a virtualized physical address? · Issue #433 · rust-osdev/x86_64