0
\$\begingroup\$

As we know that every Processor/Microcontroller has a memory map which is divided into different regions. on each region a peripheral is mapped like RAM etc. following is the memory map of general x86 processor.

enter image description here

As one can see there is memory range for RAM, DMA, PCI etc. My question is Where is Hard drive mounted in this memory map??? and how is it accessed?

\$\endgroup\$

closed as off-topic by Chris Stratton, W5VO Jun 1 '17 at 19:19

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on the use of electronic devices are off-topic as this site is intended specifically for questions on electronics design." – W5VO
If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ If there is some window of mapping for access, that would be unique to a given hardware configuration. And if virtual memory extends onto disk, that depends on both the operating system and the file(s) mapped by the current program. Therefore this question is unanswerable. \$\endgroup\$ – Chris Stratton May 31 '17 at 7:09
  • \$\begingroup\$ @ChrisStratton Virtual memory has nothing to do with hard drives. You could (however stupid it might be) put your swap file on a RAM disk or a network disk, or your mobile phone connected as mass storage. Modern versions of windows would prohibit this, but it was possible to do some time ago, and it's still possible in Linux (e.g. check out zram). \$\endgroup\$ – Dmitry Grigoryev May 31 '17 at 7:47
  • \$\begingroup\$ @DmitryGrigoryev - the point is that there are two ways that a hard drive (or any storage device) can end up with a memory mapping - one is a window to access the mechanism, another is for specific blocks to have an effective memory address. Virtual memory is the second - but no claim was made that this was unique to a hard drive. Indeed the reason the question is unanswerable is that it depends on details of a specific system which have not been provided. Don't forget virtual memory is not just swap, it also means things like open files being memory mapped. \$\endgroup\$ – Chris Stratton May 31 '17 at 14:01
4
\$\begingroup\$

HDDs are not directly mapped to CPU memory space. Instead they are attached to an intermediate interface of some sort (PATA, SATA, SCSI, USB etc.), and are accessed via the corresponding interface controller. Those controllers have memory-mapped space for data transfer, and/or are capable of acting as masters, reading and writing data from arbitrary RAM locations. Example from my laptop:

enter image description here

\$\endgroup\$
0
\$\begingroup\$

In old good XT/AT days HDD access was I/O-based. I assume that in modern PCs access addresses are dynamically allocated; if you use Windows machine you can see them if go to Device Manager, and click Properties -> Resources tab of the respective controller.

\$\endgroup\$
-1
\$\begingroup\$

Hard Disks are controlled using Disk controller hardware, usually present on the motherboard these days as well as via firmware on the disk itself that deals with lower level operations. Hard Disks are therefore treated as IO devices, and the operating system will have a driver to send commands to read and write data on it etc using the appropriate commands (usually using AHCI). Hard disks themselves are not memory mapped.

\$\endgroup\$
-1
\$\begingroup\$

HDD data is mapped into user "Main" memory space by OS which is OS specific.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.