Hi Guys,
Are GDT addresses logical or physical once paging is enabled?
I've been looking for an answer to this as most sources just say "address" and don't tell you if that is relative to the real memory position or in the logical space. I'm looking for the best way to control port access to user space drivers in a micro kernel and I'm thinking about having the OS map different IOPB pages for each process depending upon what ports have been granted access (rather than have a TSS for every process that needs its own IOPB). The idea being that the kernel will map all ports other than what it needs to sigma0 on startup. Any process that owns a port can pass it to another process via a syscall. Sigma0 accepts requests from the root task to transfer ports (so the root task kicks off the serial port driver and immediately requests all the ports for that process). All dead processes get their ports allocated back to sigma0.
Obviously this only works to begin with if the GDT offset is into the current logical space and not into the physical one.
Thanks in advance.
Are GDT addresses logical or physical when paging is on?
Re: Are GDT addresses logical or physical when paging is on?
Virtual (in segment descriptors and GDTR). LGDT still takes a logical address (which then translates into virtual and so on).GMorgan wrote:Are GDT addresses logical or physical once paging is enabled?
Re: Are GDT addresses logical or physical when paging is on?
Thanks. This raises the question of what the difference between a logical and virtual address is. Does logical contain a segment and a pointer?
-
- Member
- Posts: 5581
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Are GDT addresses logical or physical when paging is on?
There's no such thing as a "logical" address in x86. Maybe you're thinking of linear addresses?GMorgan wrote:Are GDT addresses logical or physical once paging is enabled?
Segmentation is used to translate from virtual to linear addresses, and paging is used to translate from linear to physical addresses. This means addresses in the GDT and GDTR will be linear addresses.
Re: Are GDT addresses logical or physical when paging is on?
There is.Octocontrabass wrote:There's no such thing as a "logical" address in x86.
Section 3.3.1 IA-32 Memory Models of Intel® 64 and IA-32 Architectures Software Developer’s Manual Combined Volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D and 4 wrote: To address a byte in a segment, a program issues a logical address. This consists of a segment selector and an offset (logical addresses are often referred to as far pointers).
-
- Member
- Posts: 5581
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Are GDT addresses logical or physical when paging is on?
Whoops, that's what I get for reading too many MIPS manuals.
Segmentation is used to translate from logical to linear addresses, and paging is used to translate from linear to physical addresses.
There's no such thing as virtual addresses in x86.
Segmentation is used to translate from logical to linear addresses, and paging is used to translate from linear to physical addresses.
There's no such thing as virtual addresses in x86.
Re: Are GDT addresses logical or physical when paging is on?
You'll be surprised.Octocontrabass wrote:There's no such thing as virtual addresses in x86.