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

[question]about virtual adress convert #840

Closed
luck71 opened this issue Oct 9, 2023 · 2 comments
Closed

[question]about virtual adress convert #840

luck71 opened this issue Oct 9, 2023 · 2 comments

Comments

@luck71
Copy link

luck71 commented Oct 9, 2023

hello! i have a confusion about convert to va
why when enable long mode the current instruction address(rip register) still look like a physical address in gdb,
image

and untill these instructions be excuted, then all address show in gdb is virtual address
image

another question:
image
in long-mode(.code64), call __startup_64 still use pa 0x1000014 call 0x10001d0, while $1f is va movq $1f, %rax

at this moment, PG is already enabled, why call instruction still use pa 0x10001d0 (__startup_64)

or i make a mistake, 0x10001d0 is already a va, if so, how can i find corresponding pa by boot page table manually

@luohuang
Copy link

luohuang commented Oct 9, 2023 via email

@luck71 luck71 changed the title [virtual adress convert]question [question]about virtual adress convert Oct 9, 2023
@luck71 luck71 closed this as completed Oct 10, 2023
@luck71
Copy link
Author

luck71 commented Oct 11, 2023

  1. this call is near call, address show in gdb is plused with $pc + instruction length
  2. 0x10001d0 is a va, same as pa at this moment
  3. movq $1f, %rax $1f is signed 32bit number, convert to signed 64 with fff padding

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