我昨天也想到这个问题. 与是我在分配一个1M的RAM空间做硬盘时候. 在这个空间起始处在驱动程序中直接将这个空间格式化为fat格式.人为加了MBR等信息进入.可是后来发现还是不行.一定要将AutoMount/AutoPart/AutoFormat 全部要设置为1才可以. 以下是全设置为1时候从串口输出的调试信息. AutoFormat : 1 / AutoPart:1 / AutoMount:1 DllMain RAMDISK: DLL_PROCESS_ATTACH RAMDISK: DSK_Init entered: 602ed68 CreateDiskObject RAMDISK : ActiveKey = DriversActive 8 RAMDISK : ActiveKey (copy) = DriversActive 8 (@ 0x00037FC0) RAM: No Size entry specified in the registry RAM: No Address entry specified in the registry RAM: No SectorSize entry specified in the registry RAMDISK: sectors = 2048 RAMDISK: RAMInit returning 0x37f50 RAMDISK: DSK_Open returning 229200 DSK_IOControl --- DISK_IOCTL_INITIALIZED RAMDISK: DSK_Close entered RAMDISK: DSK_Open returning 229200 DSK_IOControl --- DISK_IOCTL_GETINFO DSK_IOControl --- IOCTL_DISK_DEVICE_INFO DSK_IOControl (device info) GetDeviceInfo--diskio.c DSK_IOControl --- the others IOCTL DSK_IOControl --- DISK_IOCTL_GETINFO DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 0 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 0 DSK_IOControl --- DISK_IOCTL_FORMAT_MEDIA DSK_IOControl --- DISK_IOCTL_GETINFO DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 4096 RAMDISK:DoDiskIO - writing 4096 bytes at sector 0 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 0 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 0 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 0 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 2 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 3 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 4 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 5 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 6 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 7 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 8 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 9 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 1 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 2 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 3 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 4 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 5 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 6 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 7 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 8 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 9 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 1 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 1 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 0 DSK_IOControl --- IOCTL_DISK_GETINFO DSK_IOControl --- DISK_IOCTL_GETINFO DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 2 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 3072 RAMDISK:DoDiskIO - writing 3072 bytes at sector 3 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 16384 RAMDISK:DoDiskIO - writing 16384 bytes at sector 9 DSK_IOControl --- DISK_IOCTL_WRITE RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - writing 512 bytes at sector 2 DSK_IOControl --- the others IOCTL DSK_IOControl --- IOCTL_DISK_DEVICE_INFO DSK_IOControl (device info) GetDeviceInfo--diskio.c DSK_IOControl --- IOCTL_DISK_GETINFO DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 2 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 2 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 3 DSK_IOControl --- DISK_IOCTL_READ RAMDISK:DoDiskIO - Number of scatter/gather descriptors 1 RAMDISK:DoDiskIO - Bytes left for this sg 512 RAMDISK:DoDiskIO - reading 512 bytes at sector 9