From e766be6af916645348beaa2785e09cd11ae689f2 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 4 Nov 2022 16:09:20 -0700 Subject: [PATCH] Add LE/LX Fix-up page table --- .../LinearExecutable/Executable.cs | 8 +++-- .../LinearExecutable/FixupPageTableEntry.cs | 36 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 BurnOutSharp.Models/LinearExecutable/FixupPageTableEntry.cs diff --git a/BurnOutSharp.Models/LinearExecutable/Executable.cs b/BurnOutSharp.Models/LinearExecutable/Executable.cs index 84d09c59..c4962f7d 100644 --- a/BurnOutSharp.Models/LinearExecutable/Executable.cs +++ b/BurnOutSharp.Models/LinearExecutable/Executable.cs @@ -59,7 +59,11 @@ namespace BurnOutSharp.Models.LinearExecutable /// public PerPageChecksumTableEntry[] PerPageChecksumTable { get; set; } - // TODO: Fix-up page table + /// + /// Fix-up page table + /// + public FixupPageTableEntry[] FixupPageTable { get; set; } + // TODO: Fix-up record table /// @@ -81,7 +85,7 @@ namespace BurnOutSharp.Models.LinearExecutable /// public NonResidentNameTableEntry[] NonResidentNameTable { get; set; } - // TODO: Non-resident directives data + // TODO: Non-resident directives data (Undefined) /// /// Debug information diff --git a/BurnOutSharp.Models/LinearExecutable/FixupPageTableEntry.cs b/BurnOutSharp.Models/LinearExecutable/FixupPageTableEntry.cs new file mode 100644 index 00000000..ca85fa93 --- /dev/null +++ b/BurnOutSharp.Models/LinearExecutable/FixupPageTableEntry.cs @@ -0,0 +1,36 @@ +using System.Runtime.InteropServices; + +namespace BurnOutSharp.Models.LinearExecutable +{ + /// + /// The Fixup Page Table provides a simple mapping of a logical page number + /// to an offset into the Fixup Record Table for that page. + /// + /// This table is parallel to the Object Page Table, except that there is + /// one additional entry in this table to indicate the end of the Fixup + /// Record Table. + /// + /// The fixup records are kept in order by logical page in the fixup record + /// table. This allows the end of each page's fixup records is defined by the + /// offset for the next logical page's fixup records. This last entry provides + /// support of this mechanism for the last page in the fixup page table. + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public class FixupPageTableEntry + { + /// + /// Offset for fixup record for this page. (1 to n) + /// Offset to the end of the fixup records. (n + 1) + /// + /// + /// This field specifies the offset, from the beginning of the fixup record + /// table, to the first fixup record for this page. (1 to n) + /// + /// This field specifies the offset following the last fixup record in the + /// fixup record table. This is the last entry in the fixup page table. (n + 1) + /// + public uint Offset; + } +}