manipulate on chip cache of HDD

Tag: caching , kernel , hdd Author: xuerong5369 Date: 2013-07-02

I'm a newbie on Linux kernel development. I've read that i/o ports could be ioremap to virtual memory address space.

One of the specifications of HDD is cache - 32MB/64MB is not rare.

Here's my questions:

How should driver developer handle such cache?

Are they transparent for the devs?

Or shall we map those cache into kernel address space, so that we can use them directly?

Any explanation/source code would be appreciated.

Best Answer

The cache on a HDD is RAM that is physically located within the drive (down the SATA/PATA/USB cable) and therefore is not part of the RAM located on the motherboard.

TBH, if you are struggling with this, I would recommend something a bit simpler as your first kernel hack :-)


Neil, What I'm asking is about the virtual memory space. I/O Bus ports could be mapped to virtual memory address. How do they handle the cache on the HDD? Is it mapped to the virtual memory space?
There is no physical or virtual connection between the memory cache on the HDD and the memory on the motherboard, it's all done down the drive cable. If you imagine the HDD cache is a separate PC (connected by a network cable), there is no way to map the RAM from that PC to your local PC with virtual addressing is there?