有没有大佬知道C++如何读取硬盘缓存信息

有没有大佬知道C++如何读取硬盘缓存信息 ,就是鲁大师的那个

这个可以用汇编语言直接读取硬盘控制器,相关的代码如果需要的话请采纳

这个问题和不同os有关系吧

http://www.codeguru.com/forum/showthread.php?t=415882
http://home.no.net/tkos/info/fat.html
http://www.pjrc.com/tech/8051/ide/fat32.html
http://www.microsoft.com/whdc/system...re/fatgen.mspx
http://www.nongnu.org/ext2-doc/

你说的是什么信息,请举例说明一下。
硬件这东西 Windows 会有 API 来获取,没有的话一般只能用汇编。C++可能没那个本事。而且还要分不同种类硬盘采取不同的处理方式。需要很大的工程量!

这种信息都是操作系统提供的,所以需要调用windowsAPI进行获取,下面这段代码时再MFC下面运行的,控制台应用程序的话需要稍加修改,但是系统调用函数是一样的。
void LogSystemMemoryInfo()
{
MEMORYSTATUSEX sysMemStatus;
sysMemStatus.dwLength = sizeof (sysMemStatus);
if (!GlobalMemoryStatusEx (&sysMemStatus))
{
DWORD errCode = GetLastError();
DEBUG_TRACE("GlobalMemoryStatusEx fail, lastErrorCode:%d",errCode);
return;
}

int DIV = 1024*1024;

CString strInfo;
//物理内存已使用得百分比
strInfo.Format("percent of memory in use:%ld\n",sysMemStatus.dwMemoryLoad);
OutputDebugString(strInfo);

//物理内存得总大小
strInfo.Format("total MB of physical memory:%I64d\n",sysMemStatus.ullTotalPhys/DIV);
OutputDebugString(strInfo);

//物理内存可用大小
strInfo.Format("free  MB of physical memory:%I64d\n",sysMemStatus.ullAvailPhys/DIV);
OutputDebugString(strInfo);

//系统整个虚拟内存总大小(物理内存+页文件)
strInfo.Format("total MB of paging file :%I64d\n",sysMemStatus.ullTotalPageFile/DIV);
OutputDebugString(strInfo);

//系统可用虚拟内存大小
strInfo.Format("free  MB of paging file :%I64d\n",sysMemStatus.ullAvailPageFile/DIV);
OutputDebugString(strInfo);

//当前进程虚拟内存大小(32位程序通常是2G,还有2G被内核占用)
strInfo.Format("total MB of virtual memory:%I64d\n",sysMemStatus.ullTotalVirtual/DIV);
OutputDebugString(strInfo);

//当前进程可使用得虚拟内存大小(32未程序通常小于2G,我得电脑显示1.8G,但实际调用new时只能分配大约1.5G,有300G不知道什么原因被预留了。
strInfo.Format("free  MB of virtual memory:%I64d\n",sysMemStatus.ullAvailVirtual/DIV);
OutputDebugString(strInfo);

//扩展内存,预留字段,当前固定为0
strInfo.Format("free  MB of extended memory:%I64d\n",sysMemStatus.ullAvailExtendedVirtual/DIV);
OutputDebugString(strInfo);

}