Hello,
I've spent some time reading about how paging is required in long mode but I don't like the indirection of having both physical and virtual addresses. Is there a way around this that doesn't involve going with 32-bit flat mode?
I would be fine with only being able to map 1 GB.
Thanks.
How do I avoid virtual addressing in long mode (x86-64)?
-
- Posts: 1
- Joined: Thu Jul 16, 2020 11:07 am
- Libera.chat IRC: TanookiSuit
-
- Member
- Posts: 5885
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How do I avoid virtual addressing in long mode (x86-64)?
Why don't you like virtual addressing? Unless you have a very good reason to avoid it, you should use it.
If you do happen to come up with one such good reason, you can set up the page tables so that virtual addresses are equal to physical addresses and then never worry about it again. If you decide to use 2M or 1G pages, avoid using them to map address ranges that span a boundary between RAM and not-RAM. In most cases, it won't work correctly, and probably crash as a result.
If you do happen to come up with one such good reason, you can set up the page tables so that virtual addresses are equal to physical addresses and then never worry about it again. If you decide to use 2M or 1G pages, avoid using them to map address ranges that span a boundary between RAM and not-RAM. In most cases, it won't work correctly, and probably crash as a result.
Re: How do I avoid virtual addressing in long mode (x86-64)?
Paging and virtual addressing are required for Long Mode. If you don't want to use them, stay in 32 bit mode.
- bellezzasolo
- Member
- Posts: 120
- Joined: Sun Feb 20, 2011 2:01 pm
Re: How do I avoid virtual addressing in long mode (x86-64)?
You could identity map all memory, but virtual memory rocks.
My kernel is based at 0xFFFFC00000000000, with the standard library dynamically linked at 0xFFFFC00080000000
Using UEFI, so the loader isn't higher half, but is an ideal place to put a dynamic linker!
https://github.com/ChaiSoft/ChaiOS/blob ... ientry.cpp
My kernel is based at 0xFFFFC00000000000, with the standard library dynamically linked at 0xFFFFC00080000000
Using UEFI, so the loader isn't higher half, but is an ideal place to put a dynamic linker!
https://github.com/ChaiSoft/ChaiOS/blob ... ientry.cpp
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
https://github.com/ChaiSoft/ChaiOS
Re: How do I avoid virtual addressing in long mode (x86-64)?
Even if you identity map all memory, you are still using virtual addresses. It's just unavoidable in long mode. And the advantages are so compelling that you seriously need to consider whether your design is fatally flawed.