Re: Stack at high memory locations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06-05-08 05:15, Peter Teoh wrote:

Greg: added to the CC as one of the LDD3 authors. perhaps it's interesting to note for a possible followup edition.

Please be aware that /proc/iomem lists physical addresses, while his
request was for availability of a virtual address.

I was aware of the difference, that is why before I posted, I referred
to LDD3, and found this mapping between /proc/*/maps (which is virtual
address) and iomem.   And since Greg in the book speaked as if the two
address are the same (they are identical in the first place - could it
be due to identity mapping for the low mem?   I suspect so.....) and
that's where I deduced that it is virtual memory.

Here (the whole paragraph under "The mmap Device Operation"):

http://people.freedesktop.org/~nagappan/LDD3/LDD3.html

Ok...logically it should physical address....being IOMEM...and being
process independent....

Ah, I see. That "definitive" example is actually a fairly poor chosen one due this exact potential for confusion indeed. If I remember right the fact that (in the book) you see that identify for the first megabyte is only due to the X server setting up a VM86 environment ("a DOS box", if that terminology still means anything to you) in which to call the VGA BIOS. The VGA BIOS expects to find a real-mode environment; specifically, expects to be called in an environment where it itself lives at 0xc0000 (expressed in real-mode terms as 0xc000:0x0) and the VGA videomemory at 0xa0000 (0xa000:0x0).

These days it appears X is either no longer using VM86 or using segmentation register tricks (google for "unreal mode" if you're interested) to get around that issue:

root@7ixe4:~# cat /proc/$(pidof X)/maps | grep /dev/mem
b4a24000-b5224000 rw-s ef000000 08:05 905647     /dev/mem
b5224000-b5264000 rw-s 000c0000 08:05 905647     /dev/mem
b5b14000-b5b24000 rw-s 000a0000 08:05 905647     /dev/mem
b5b24000-b7b24000 rw-s e4000000 08:05 905647     /dev/mem
b7b24000-b7b28000 rw-s efefc000 08:05 905647     /dev/mem

Not much into X, so I don't know. In any case, in the book it's a very non-generic example indeed. Badly picked.

Rene.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux