Re: RAM or "empty"?

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

 



Ribamar Santarosa de Sousa wrote:
In subsection "Probing for ISA Memory" of section Using I/O Memory ( http://www.xml.com/ldd/chapter/book/ch08.html#t4 ) of Device Drivers
Book, by Rubini, there is a code that reads a byte from memory, change
this byte by a know pattern (it toggles every bit of the byte), write
this changed byte to memory and read, ever in the same memory position.
Then it unchanged the new-read byte to see if it is equal to old-read
byte. If it is equal, then the book concludes that the memory region is RAM. Else book concludes the memory region is "empty".


What does mean an "empty" region of memory? Why and how can a
non-existing memory region be mapped? (below is the code in rubini's
book):
An empty region of memory is where there exist no physical ram / io memory.
I can quote a real life example.
I had a pci bridge and some devices on the secondary side of the bridge. I configured 1 MB
starting from 0x8000_0000 for the bridge. i.e, any access to this address will fetch data from the pci devices
then I do a request_mem_region (0x80000000, 0x00100000, "pci_non_trans");
An ioremap () on the returned address will give a virtual address which can be used for accessing it.
now assume that the same code is run without the bridge present, the above code will succeed, but
the read / write into the memory obtained will not make any effect. Because it is empty. No physical
memory corresponds to it.


HTH.
om.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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