mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move common Apple boot block information and structs to its own class.
This commit is contained in:
@@ -146,7 +146,6 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
|
||||
HfsMasterDirectoryBlock mdb = Marshal.ByteArrayToStructureBigEndian<HfsMasterDirectoryBlock>(mdbSector);
|
||||
HfsBootBlock bb = Marshal.ByteArrayToStructureBigEndian<HfsBootBlock>(bbSector);
|
||||
|
||||
sb.AppendLine("Apple Hierarchical File System");
|
||||
sb.AppendLine();
|
||||
@@ -238,51 +237,13 @@ namespace DiscImageChef.Filesystems
|
||||
sb.AppendFormat("{0} blocks in volume common cache", mdb.drCtlCSize).AppendLine();
|
||||
}
|
||||
|
||||
if(bb.bbID == HFSBB_MAGIC)
|
||||
string bootBlockInfo = AppleCommon.GetBootBlockInformation(bbSector, Encoding);
|
||||
|
||||
if(bootBlockInfo != null)
|
||||
{
|
||||
sb.AppendLine("Volume is bootable.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Boot Block:");
|
||||
|
||||
if((bb.bbPageFlags & 0x40) == 0x40)
|
||||
sb.AppendLine("Boot block should be executed.");
|
||||
|
||||
if((bb.bbPageFlags & 0x80) == 0x80)
|
||||
sb.AppendLine("Boot block is in new unknown format.");
|
||||
else
|
||||
{
|
||||
if(bb.bbPageFlags > 0)
|
||||
sb.AppendLine("Allocate secondary sound buffer at boot.");
|
||||
else if(bb.bbPageFlags < 0)
|
||||
sb.AppendLine("Allocate secondary sound and video buffers at boot.");
|
||||
|
||||
sb.AppendFormat("System filename: {0}", StringHandlers.PascalToString(bb.bbSysName, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat("Finder filename: {0}", StringHandlers.PascalToString(bb.bbShellName, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat("Debugger filename: {0}", StringHandlers.PascalToString(bb.bbDbg1Name, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat("Disassembler filename: {0}",
|
||||
StringHandlers.PascalToString(bb.bbDbg2Name, Encoding)).AppendLine();
|
||||
|
||||
sb.AppendFormat("Startup screen filename: {0}",
|
||||
StringHandlers.PascalToString(bb.bbScreenName, Encoding)).AppendLine();
|
||||
|
||||
sb.AppendFormat("First program to execute at boot: {0}",
|
||||
StringHandlers.PascalToString(bb.bbHelloName, Encoding)).AppendLine();
|
||||
|
||||
sb.AppendFormat("Clipboard filename: {0}", StringHandlers.PascalToString(bb.bbScrapName, Encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat("Maximum opened files: {0}", bb.bbCntFCBs * 4).AppendLine();
|
||||
sb.AppendFormat("Event queue size: {0}", bb.bbCntEvts).AppendLine();
|
||||
sb.AppendFormat("Heap size with 128KiB of RAM: {0} bytes", bb.bb128KSHeap).AppendLine();
|
||||
sb.AppendFormat("Heap size with 256KiB of RAM: {0} bytes", bb.bb256KSHeap).AppendLine();
|
||||
sb.AppendFormat("Heap size with 512KiB of RAM or more: {0} bytes", bb.bbSysHeapSize).AppendLine();
|
||||
}
|
||||
sb.AppendLine(bootBlockInfo);
|
||||
}
|
||||
else if(mdb.drFndrInfo0 != 0 ||
|
||||
mdb.drFndrInfo3 != 0 ||
|
||||
@@ -301,7 +262,7 @@ namespace DiscImageChef.Filesystems
|
||||
XmlFsType.BackupDateSpecified = true;
|
||||
}
|
||||
|
||||
XmlFsType.Bootable = bb.bbID == HFSBB_MAGIC || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 ||
|
||||
XmlFsType.Bootable = bootBlockInfo != null || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 ||
|
||||
mdb.drFndrInfo5 != 0;
|
||||
|
||||
XmlFsType.Clusters = mdb.drNmAlBlks;
|
||||
|
||||
Reference in New Issue
Block a user