Thanks for those who answer my previous address space mapping question
But I met new problems about mapping.
Sample PC: 64M RAM(0x00000000 - 0x03FFFFFF), 16M video
RAM(0x00000000-0x00FFFFFF)
- Real mode
My understanding are:
- The physical address space is 0x00000-0xFFFFF. VGA uses
0xA0000-0xBFFFF.
- Only 0xBFFFF - 0xA0000 + 1 = 0x20000(128k) video RAM is used. The
others is wasted. It’s in video RAM from 0x00000000 to 0x0001FFFF.
- Only 0xFFFFF - 0x00000 + 1 = 0x100000(1M) RAM is used. The others
is wasted. In this 1M RAM, range 0xA0000-0xBFFFF always has the
same value as range 0x00000-0x1FFFF in video RAM. Hardwares
synchronize their contents. In another word, there are always two
copies of something, one in RAM, the other in video RAM; they are
the same by hardware synchronization mechanism.
- NT protected mode
My understanding are:
- The 16M video RAM has logical address 0x000000-0xFFFFFF.
- The physical address space is from 0x0000000-0x4FFFFFF, where
0x4000000-0x4FFFFFF is a map of video RAM. OS uses many a base
register to realize the mapping. There is only one copy of the
content to be displayed and it’s in video RAM.
- The registers on the video card are mapped to, for example,
0x0000000-0x0000300, with some hardware synchronize mechanism,
the same as real mode VGA memory mapping I described previous.
There are always two copies of those registers’ values, one is
RAM, the other in video card registers.
Please correctify me if I’m wrong somewhere. Thanks a lot.
>Sample PC: 64M RAM(0x00000000 - 0x03FFFFFF), 16M video
RAM(0x00000000-0x00FFFFFF)
- Real mode
My understanding are:
- The physical address space is 0x00000-0xFFFFF. VGA uses
0xA0000-0xBFFFF.
The physical address space is still 0 to 0xFFFFFFFF, it’s just values above
0xFFFFF are tricky to access. There is a thing called super real mode (I’m
sure there is a more official term) where the whole 4GB is accessable. You
have to enter protected mode first to return back to super real mode, then
you use 32-bit offset’s.
- Only 0xBFFFF - 0xA0000 + 1 = 0x20000(128k) video RAM is used. The
others is wasted. It’s in video RAM from 0x00000000 to 0x0001FFFF.
Well, no. Video hardware has what are called bank registers, which control
which window of 128k you can access. By flipping around these bank
registers you can access all 16MB. The defintion of the bank registers is
video card specific. I suppose some video cards may no longer support
banking, ans just assume you can map the whole buffer at higher addresses.
- Only 0xFFFFF - 0x00000 + 1 = 0x100000(1M) RAM is used. The others
is wasted. In this 1M RAM, range 0xA0000-0xBFFFF always has the
same value as range 0x00000-0x1FFFF in video RAM. Hardwares
synchronize their contents. In another word, there are always two
copies of something, one in RAM, the other in video RAM; they are
the same by hardware synchronization mechanism.
Nope, there is only one copy of the video data, there is no magic to copy
it from ram to video memory. There is no normal ram above 0x9FFFF, it’s
video ram or device rom or a system rom or a ram shadow of system rom.
- NT protected mode
My understanding are:
- The 16M video RAM has logical address 0x000000-0xFFFFFF.
Yes, I suppose that’s one what to look at it.
- The physical address space is from 0x0000000-0x4FFFFFF, where
0x4000000-0x4FFFFFF is a map of video RAM. OS uses many a base
register to realize the mapping. There is only one copy of the
content to be displayed and it’s in video RAM.
As in real mode, only one copy of video data. The address of the video
memeory may NOT be just above RAM. It’s PROGRAMMABLE where it’s located in
the physical address space by registers on the video card.
- The registers on the video card are mapped to, for example,
0x0000000-0x0000300, with some hardware synchronize mechanism,
the same as real mode VGA memory mapping I described previous.
There are always two copies of those registers’ values, one is
RAM, the other in video card registers.
No, only one copy of video control registers. They also may be mapped to
I/O space or to memory space, at almost any address, and are video
controller specific to what they do. Note that x86 processors have two
physical address spaces, the I/O port space and the memory space. Different
instructions are used to access each.
Passing interface to out-of-proc local COM server> My understanding are:
- The physical address space is 0x00000-0xFFFFF. VGA uses 0xA0000-
0xBFFFF.
Videocards (since S3 Trio) usually map ALL their memory to the CPU’s
physical addresses somewhere near 0xf0000000 physical.
The 32bit OSes access the video memory there and do not use the old VGA
framebuffer.
Max