From: John Hodge Date: Sun, 1 Aug 2010 05:17:22 +0000 (+0800) Subject: Working on NTFS driver X-Git-Tag: rel0.06~68 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=69d13fa90dcafe634de07081b2577ca7eb81e601;p=tpg%2Facess2.git Working on NTFS driver --- diff --git a/Modules/Filesystems/NTFS/common.h b/Modules/Filesystems/NTFS/common.h index 8456910e..a51c7d1e 100644 --- a/Modules/Filesystems/NTFS/common.h +++ b/Modules/Filesystems/NTFS/common.h @@ -40,9 +40,10 @@ typedef struct sNTFS_BootSector Uint8 MediaDescriptor; Uint16 Unused2; Uint16 SectorsPerTrack; + Uint16 Heads; Uint64 Unused3; - Uint32 Unknown; + Uint32 HEad; // 38 Uint64 TotalSectorCount; // Size of volume in sectors @@ -57,7 +58,7 @@ typedef struct sNTFS_BootSector Uint64 SerialNumber; - Uint8 Padding[512-72]; + Uint8 Padding[512-0x50]; } PACKED tNTFS_BootSector; diff --git a/Modules/Filesystems/NTFS/main.c b/Modules/Filesystems/NTFS/main.c index d316f00c..175e6167 100644 --- a/Modules/Filesystems/NTFS/main.c +++ b/Modules/Filesystems/NTFS/main.c @@ -60,10 +60,23 @@ tVFS_Node *NTFS_InitDevice(char *Device, char **Options) bs.Jump[0], bs.Jump[1], bs.Jump[2]); - Log_Debug("FS_NTFS", "SystemID = %02x%02x%02x%02x%02x%02x%02x%02x", + Log_Debug("FS_NTFS", "SystemID = %02x%02x%02x%02x%02x%02x%02x%02x (%8C)", bs.SystemID[0], bs.SystemID[1], bs.SystemID[2], bs.SystemID[3], - bs.SystemID[4], bs.SystemID[5], bs.SystemID[6], bs.SystemID[7] + bs.SystemID[4], bs.SystemID[5], bs.SystemID[6], bs.SystemID[7], + bs.SystemID ); + Log_Debug("FS_NTFS", "BytesPerSector = %i", bs.BytesPerSector); + Log_Debug("FS_NTFS", "SectorsPerCluster = %i", bs.SectorsPerCluster); + Log_Debug("FS_NTFS", "MediaDescriptor = 0x%x", bs.MediaDescriptor); + Log_Debug("FS_NTFS", "SectorsPerTrack = %i", bs.SectorsPerTrack); + Log_Debug("FS_NTFS", "Heads = %i", bs.Heads); + Log_Debug("FS_NTFS", "TotalSectorCount = 0x%llx", bs.TotalSectorCount); + Log_Debug("FS_NTFS", "MFTStart = 0x%llx", bs.MFTStart); + Log_Debug("FS_NTFS", "MFTMirrorStart = 0x%llx", bs.MFTMirrorStart); + Log_Debug("FS_NTFS", "ClustersPerMFTRecord = %i", bs.ClustersPerMFTRecord); + Log_Debug("FS_NTFS", "ClustersPerIndexRecord = %i", bs.ClustersPerIndexRecord); + Log_Debug("FS_NTFS", "ClustersPerIndexRecord = %i", bs.ClustersPerIndexRecord); + Log_Debug("FS_NTFS", "SerialNumber = 0x%llx", bs.SerialNumber); disk->ClusterSize = bs.BytesPerSector * bs.SectorsPerCluster; Log_Debug("NTFS", "Cluster Size = %i KiB", disk->ClusterSize/1024); @@ -116,7 +129,7 @@ void NTFS_DumpEntry(tNTFS_Disk *Disk, Uint32 Entry) VFS_ReadAt( Disk->FD, Disk->MFTBase*Disk->ClusterSize, Disk->ClusterSize, buf); Log_Debug("FS_NTFS", "MFT Entry #%i", Entry); - Log_Debug("FS_NTFS", "- Magic = 0x%08x", hdr->Magic); + Log_Debug("FS_NTFS", "- Magic = 0x%08x (%4C)", hdr->Magic, &hdr->Magic); Log_Debug("FS_NTFS", "- UpdateSequenceOfs = 0x%x", hdr->UpdateSequenceOfs); Log_Debug("FS_NTFS", "- UpdateSequenceSize = 0x%x", hdr->UpdateSequenceSize); Log_Debug("FS_NTFS", "- LSN = 0x%x", hdr->LSN);