读/写FAT32引导记录的保留扇区 [英] Read/Write in Reserved Sectors of FAT32 Boot Record

查看:84
本文介绍了读/写FAT32引导记录的保留扇区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在开发与笔式驱动器接口的应用程序.我已掌握并成功阅读并阅读了该书.写入扇区.我需要在驱动器的保留空间中读取/写入值.在FAT32引导记录中,在偏移量0Eh中有保留的扇区.我可以在这些保留的扇区中进行读取/写入吗?如果可以,我该怎么办?

问候
Mohan

Hi,
I''m developing an application for interfacing with pen drive. I got handle and successfully Read & Write into the sectors. I need to Read/Write values in the reserved space of the drive. In the FAT32 Boot Record, there are reserved sectors in the offset 0Eh. Can i read/write in these reserved sector?. If so how can i do it?

Regards
Mohan

推荐答案

您可以使用 [ ^ ]的文章,了解有关访问磁盘扇区的信息直接.

考虑到您特别询问有关写入保留扇区的问题,我假设您熟悉FAT32文件系统.无论哪种方式,备份驱动器都是一个好主意.
You can use this[^] article to learn about accessing sectors on disk directly.

Considering you specifically ask about writing in reserved sectors, I''ll assume you''re familiar with the FAT32 file system. Either way, making a back-up of the drive would probably be a good idea.


再简短一点的说明
http://support.microsoft.com/kb/100027 [ http://en.wikipedia.org/wiki/FAT32#FAT32 [
Once more a short description
http://support.microsoft.com/kb/100027[^].

Here is a link that you will find usefull:
http://en.wikipedia.org/wiki/FAT32#FAT32[^]

Regards
Espen Harlinn


提到的0Eh偏移量是包含保留扇区数的引导记录中的字节偏移量.

第一个保留扇区是扇区0,因此从0到保留扇区数乘以扇区大小(以字节为单位)的任何偏移量都将在保留扇区中.

使用我链接到的文章中的代码,您想要在Windows NT读/写函数中指定偏移量,如下所示:

The mentioned 0Eh offset is a byte offset within the boot record containing the number of reserved sectors.

The first reserved sector is sector 0, so any offset from 0 to the number of reserved sectors multiplied with the sector size in bytes, will be in a reserved sector.

Using the code from the article I linked to, you''d want to specify the offset in the Windows NT read/write functions like so:

SetFilePointer(hFloppyDisk,offset,0,FILE_BEGIN);



例如,假设我们有一些扇区,每个扇区的大小为512字节,并假设您要访问扇区3.您希望像这样设置文件指针:



For example, let''s assume we have sectors with a size of 512 bytes each and let''s say you''d want to access sector 3. You''d want to set the file pointer like so:

SetFilePointer(hFloppyDisk,3*512,0,FILE_BEGIN);


这篇关于读/写FAT32引导记录的保留扇区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆