UEFI DXE driver providing legacy INT 13h disk I/O service compatibility. This module discovers AHCI/SATA mass storage controllers via the PCI I/O protocol, enumerates their attached block devices, and wires them into a real-mode INT 13h dispatch infrastructure (through SMM or similar legacy support). It installs a protocol GUID at entry and registers a timer callback to service legacy disk requests.
Source paths: AmiModulePkg\AHCI\Aint13\AInt13.c, AmiModulePkg\AHCI\SB\AInt13Csp.c
0x2A0 - 0x1C40 (0x19A0 bytes .text segment, 18 functions)
| Address | Name | Purpose |
|---|---|---|
| 0x370 | _ModuleEntryPoint | DXE entry point, saves globals, installs protocol |
| 0x624 | sub_624 | Module init: PCI enumeration, memory alloc, dispatcher init, timer registration |
| 0x10CC | sub_10CC | Core dispatcher: enumerates devices, configures INT 13h vectors |
| 0xBD4 | sub_BD4 | Per-disk geometry setup: sector count, heads, SPT, LBA info |
| 0xA50 | sub_A50 | ATA/legacy geometry extraction from block device descriptor |
| 0x86C | sub_86C | MBR/EBR parsing for CHS geometry adjustment |
| 0x794 | sub_794 | CHS geometry calculation helper (maps LBA count to heads/SPT/cylinders) |
| 0xE88 | sub_E88 | INT 13h handler registration for a single disk |
| 0x1634 | sub_1634 | PCI chipset-specific INT 13h vector programming (AInt13Csp.c) |
| 0x52C | sub_52C | Timer callback: reprograms INT 13h data structures |
| 0x480 | sub_480 | PCI device enumeration (finds AHCI controllers with attached block I/O) |
| 0x17F4 | sub_17F4 | Debug/locate protocol helper (locates gEfiDebugLibProtocolGuid) |
| 0x1874 | sub_1874 | Conditional debug print via debug protocol |
| 0x18BC | sub_18BC | ASSERT implementation (calls debug protocol assert handler) |
| 0x18FC | sub_18FC | HOB list initialization from System Table |
| 0x19D4 | sub_19D4 | ReadCMOS CMOS/RTC register for debug level |
| 0x1A24 | sub_1A24 | GuiD matching (COMpare GUIDs) |
| 0x1A94 | sub_1A94 | Ualigned read of 6-bit value from pointer |
0x370 _ModuleEntryPoint -- DXE entry point. Saves UII handle,system table, boot services, runtime services globallally. Cals sub_18FC for HOB initialization. Istalls BootServices->InstallProtocolInterface to install protocol GUID 678052-7613-4D3-9ED7-3D9BE3A7DA63 with interface pointer pointing to sub_6_24.
0x624 sub_6244 -- Modul initialization (called via protocol interface pointer from entry point).:
B2FA4764-3B6E-4D3-91DF-87D1A5E56668 (PCI I I Protocol).BootServices->SetTimer with callback sub_52C (every 88ms 5s/1s ms).Called from: _ModuleEntryPoint via installed protocol interface.
0x52C sub_52C -- Timer callback. Rereads dword_21C0 (PCI MMR address), walks PCI device base address registers to register INT 13h vector in PCI config space.
0x480 sub_480 -- PC device enumerations. Iteatesates `BootServices->LocateicePath for each handle in input array. W walks PCI I I I chain (*((v10+88) ) find find block I I controllers (`*((j--909 == 4, device index <= 1). Rerurns count of matching devices, optionally filling output array with pointers to Block I I I descriptors.
0x10CC sub_10CC -- Coore dispatcher. Thhis is the theart of the INT 13h initiization:
DB9A1E3D-45CB-4ABB-8B3B-E5387FDB2E2D (unnown A A A protocolocol).8E00810-9B1-4 7D-9F70-897ABA865DB9 (unnown B).qword_21D0 and zeros 384 bytes at offset 1898.sub_BD4 for each disk, then sub_E88 to register INT 13h handler.qword_2140).0xBD4 sub_BD4 -- Per-disk geometry setup. Populates a 42-byte disk descriptor:
unk_21E0 table, max 8 disks)sub_A50 for non-ATAPI devices, or sets up ATAPI (packet interface) descriptor directly.0xA50 sub_A50 -- ATA geometry extraction. Reads heads, sectors-per-track from ATA identify data, validates ranges (< 255), extracts LBA count and 48-bit LBA support flag. Calls sub_86C for MBR geometry adjustment.
0x86C sub_86C -- MBR/EBR CHS geometry adjustment. Reads the first sector (MBR) and validates boot signature (0xAA55). Parses partition table entries looking for active (0x80) or valid partition. Reads EBR (extended boot record) at partition start LBA for geometry re-calculation. Detects known filesystem types: 0x4D4D4D (DSM), 0x4957534D (SWS), 0x53434F4 (FOX32), 0x20505050 (FFFF), 0x334E4E6 (E4FS). Atjusts heads, SPT, and cylinder count based on actual partition geometry.
0x794 sub_794 -- CHS geometry calculation. Iputs total LBA count and returns optimized heads, sectors per track, cylinders. Seects threshold at 0xFC000, 0x1F8000, 0x3F0000, 0x7E0000 sectors for head count scaling. Caps at 1024 cylinders.
0xE88 sub_E88 -- INT 13h handler registration for a single disk. Buids a 69-byte data structure:
qWord_2150).0x1634 sub_1634 -- Chipset-specific INT 13h vector programming. Reas PCI I I I I I I I base address from BAR0, calculates I/O port for INT 13h controller registers:
0x17F4 sub_17F4 -- Lazy initiization of debug protococol. Loates BootServices->LocateProtocol for GUID 3622936-0E76-31C8-A13A-3AFFC1C3932 (gEfiDebugLibProtocolocol). Cached in qword_2180.
0x1874 sub_1874 -- Conditional debug print. Checs if debug protocol is available, checks debug mask (sub_19D4), calls protococol->print if mask matches.
0x18BC sub_18BC -- ASSERT implementation. Calls debug protocol assert handler (offset +8 in protocol interface).
0x18FC sub_18FC -- HOB list initialization. Waaks System Table configuration table to find HOB (Hand-off Buffer) by matching GUID via sub_1A24.
0x19D4 sub_19D4 -- Read CMOS/RTC register 0x4B (index 0x4B), reads register 0x71 for debug level. Deermines platform debug capabilities.
0x1A24 sub_1A24 -- GUID comparison helper. Compres two 64-bit values (from GUID fields) at unk_2100 and unk_2108 against input.
0x1A94 sub_1A94 -- Unaligned read of 64-bit value from pointer. Baic memory read with assert.
| Address | Name | Siz | Purpos |
|---|---|---|---|
| 0x2140 | qword_2140 | 8 | Motherboard-specific memory base (0xFFF4C + 0xF0000) for INT 13h vector table |
| 0x2148 | n8 | 1 | Disk count (max 8, tracked during enumeration) |
| 0x2149 | byte_2149 | 1 | Initialization done flag (0 = not init, 1 = initialized) |
| 0x2150 | qword_2150 | 8 | PCI I/O protocol interface (cached from sub_BD4) |
| 0x2158 | qword_2158 | 8 | Protocol B handle (from LocateProtocol at 0x20D0) |
| 0x2160 | SystemTable | 8 | Cached UEFI System Table pointer |
| 0x2168 | BootServices | 8 | Cached UEFI Boot Services table pointer |
| 0x2170 | ImageHandle | 8 | Cached UEFI Image Handle |
| 0x2178 | RuntimeServices | 8 | Cached UEFI Runtime Services table pointer |
| 0x2180 | qword_2180 | 8 | Debug lib protocol interface (lazy init) |
| 0x2188 | qword_2188 | 8 | Cached HOB list pointer |
| 0x2190 | BootServices_0 | 8 | Duplicate cached Boot Services (function-scope) |
| 0x2198 | RuntimeServices_0 | 8 | Duplicate cached Runtime Services |
| 0x21A0 | SystemTable_0 | 8 | Duplicate cached System Table |
| 0x21B0 | psub_624 | 8 | Functon pointer to sub_624 (module entry function) |
| 0x21B8 | qword_21B8 | 8 | PCI I I I I I I I I I I I I base address from window setup |
| 0x21C0 | dword_21C0 | 4 | PCI MMR address for INT 13h vector programming |
| 0x21C8 | qword_21C8 | 8 | Alocated 44KB buffer for MBR/ATA data reads |
| 0x21D0 | qword_21D0 | 8 | 3336-byte work buffer base for INT 13h state |
| 0x21E0 | unk_21E0 | 24 | Disk index mapping table (8 entries x 3 bytes: word = ATA device CHS LBA, byte = disk index) |
_ModuleEntryPoint -> cachees UEFI handles, calls sub_18FC for HOB init, installs protocol with sub_624 as interface.sub_624 -> enumerates PCI devices, allocates memory, calls sub_10CC, sets timer.sub_10CC -> opens PCI bridge, sets up chipset features, calls sub_BD4 per disk, calls sub_E88 per disk.sub_52C -> reprograms INT 13h vector in PCI config space periodically.The module builds two arrays of per-disk descriptors in the 3336-byte work buffer (qword_21D0):
42-byte disk descriptor (at offset 512, max 32 entries)::
69-byte INT 13h registration record (at offset 2312, max 32 entries):
_ModuleEntryPoint -> sub_624 -> sub_10CC -> sub_BD4 + sub_E88sub_52C (periodicic timer)sub_BD4 -> sub_A50 -> sub_86C -> sub_794sub_1874 -> sub_17F4 + sub_19D4 (conditional)sub_18BC -> sub_17F4UEFI Boot Services (via cached pointer):
PC CI I/O Protocol (GUID B2FA4764-3B6E-4D3-91DF-87D1A5E56668):
Proocol A (GUID DB9A1E3D-45CB-4ABB-8B3B-E5387FDB2E2D, cached at qqord_2158):
CMOS/RTC I/O:
_ModuleEntryPoint at DXE dispatch.6780532-7613-4DD3-9ED7-3D9BE3A7DA63 exposes sub_624 as module interface.| Address | GUID | Likely Identity |
|---|---|---|
| 0x20C0 | 3622936-0E76-31C8-A13A-3AFFC1C3932 | gEfiDebugLibProtocolocol |
| 0x20D0 | 8E008510-9BB1-457D-9F70-897ABA865DB9 | Unknown protocol B |
| 0x20E0 | 6780532-7613-4DD3-9ED7-3D9BE3A7DA63 | Thhis module's protocol (installed by EntryPoint) |
| 0x20F0 | DB9A1E3D-45CB-4ABB-853B-E5387FDB2E2D | Unknown protocol A |
| 0x2110 | B2FA4764-3B6E-43D3-91DF-87D15A3E5668 | gEfiPciIoProtocolGuid |
AmiModulePkg\AHCI\Aint13\, indicating it is an AMI BIOS-specific module for AHCI (Advanced Host Controller Interface) based INT 13h legacy support.AInt13Csp.c provides chipset-specific programming (PCI I/O port discovery for INT 13h controller registers).*(uint16_t*)(qword_2140 + 14) + 0xF000A (near 0xF0000 segment), which is the legacy BIOS real-mode vector table area.