Content Type
Profiles
Forums
Events
Everything posted by Dietmar
-
@reboot12 I tried this, does not work. In "Setup" of Bios CSM is deep integrated. And I dont know, if all the CSM files from EDKII are generic but worth a try Dietmar
-
These EDK II components are required to thunk from UEFI to real-mode (Csm16.bin) and to install legacy boot services: LegacyBiosDxe Main driver that sets up legacy boot interface CsmThunkDxe Manages the switching between UEFI (32/64-bit) and 16-bit BIOS mode LegacyRegion Maps and unlocks legacy memory ranges (0xC0000–0xFFFFF) CsmVideoDxe (Optional but helpful) Legacy video service support CsmKeyboardDxe (Optional) PS/2 keyboard emulation LegacyBiosPlatformDxe Provides platform-specific hooks like where to load Csm16.bin in memory
-
@reboot12 May be, that you can integrate CSM16.bin from source of SeaBios. But you also need to fullfill the other legacy interrupts. This means to integrate via Source Code at minimum CsmThunkDxe LegacyBiosDxe LegacyRegion Dietmar PS: You Do Not Need: Full UEFI firmware source Full SeaBIOS QEMU or Coreboot You only need these DXE drivers + Csm16.bin.
-
@reboot12 No, the idea is nice. And with small changes you can do exact the same, what the UEFI-Bios do with all build in CSM disabled. To give the table with all the legacy Interrupts. For this I use the help of ChatGPT and voila, the whole code in C for the INT13h I put here already and how to put it into the existing code for csmwrap.efi Dietmar
-
@reboot12 Yepp, UEFI tool shows this in "PURE" Uefi in QemuVideoDxe ASCII text "csm" found in PE32 image section at header-offset 9029h Dietmar
-
@reboot12 Very easy, this Bios still builds a table for the legacy INT13 etc. calls. This is the same, as if you disable all CSM on an UEFI-Bios. It still builds this and so you can boot, because it isnt pure UEFI at all Dietmar
-
@reboot12 I look in OVMF_CODE-pure-efi.fd for the words csm LegacyBios Thunk with IDAPro. None of them can be found, no CSM at all Dietmar
-
Native-UEFI INT13h Handler for CSMWrap.efi Here is an integrated native-UEFI “INT 13h” thunk into the existing CSMWrap.efi module so that legacy OS installers (e.g. Windows XP SP3) can call INT13h on a pure-UEFI system (no CSM). You can drop this into your PlatformPkg’s CsmWrapper DXE driver. --- 1) Create a new source file – Filename: CsmWrapper_Int13h_Native.c /* * CsmWrapper_Int13h_Native.c * * Adds a “real-mode” INT 13h handler that talks to UEFI Block I/O, * so legacy installers (e.g. XP SP3) can call INT 13h on a pure UEFI box. */ #include <Uefi.h> #include <Library/UefiBootServicesTableLib.h> #include <Library/BaseLib.h> #include <Library/IoLib.h> #include <Protocol/BlockIo.h> #pragma pack(1) typedef struct { UINT8 AH, AL, CH, CL, DH, DL; // BIOS regs: func, count, CHS, drive UINT64 BufferPtr; // pointer to data buffer UINT8 CF; // carry-flag out UINT8 AH_out; // BIOS error code } INT13_FRAME; #pragma pack() STATIC UINT8 MapEfiStatusToBiosError(IN EFI_STATUS S) { if (S == EFI_NOT_FOUND) return 0x01; if (S == EFI_NO_MEDIA) return 0x02; if (S == EFI_DEVICE_ERROR) return 0x20; return 0xFF; } EFI_STATUS EFIAPI Int13hNativeHandler(VOID *Context) { INT13_FRAME *F = Context; EFI_STATUS Status; EFI_BLOCK_IO_PROTOCOL *BlkIo = NULL; EFI_HANDLE *Handles = NULL; UINTN NumHandles, i; UINT64 Lba; UINTN BufSize; // a) Find all Block I/O devices Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &NumHandles, &Handles); if (EFI_ERROR(Status)) goto Err; // b) Pick the first fixed disk (DL==0x80) for (i = 0; i < NumHandles; i++) { if (gBS->OpenProtocol(Handles[i], &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL) == EFI_SUCCESS && !BlkIo->Media->Removable && F->DL == 0x80) { break; } BlkIo = NULL; } if (!BlkIo) goto Err; // c) CHS→LBA conversion Lba = ((UINT64)F->CH * (BlkIo->Media->Heads + 1) + F->DH) * BlkIo->Media->Sectors + (F->CL - 1); // d) total bytes = AL × block size BufSize = (UINTN)F->AL * BlkIo->Media->BlockSize; // e) do read or write if (F->AH == 0x02) Status = BlkIo->ReadBlocks(BlkIo, BlkIo->Media->MediaId, Lba, BufSize, (VOID*)(UINTN)F->BufferPtr); else if (F->AH == 0x03) Status = BlkIo->WriteBlocks(BlkIo, BlkIo->Media->MediaId, Lba, BufSize, (VOID*)(UINTN)F->BufferPtr); else Status = EFI_UNSUPPORTED; // f) set CF/AH_out F->CF = EFI_ERROR(Status); F->AH_out = F->CF ? MapEfiStatusToBiosError(Status) : 0; Cleanup: if (Handles) gBS->FreePool(Handles); return EFI_SUCCESS; Err: F->CF = 1; F->AH_out = MapEfiStatusToBiosError(Status); goto Cleanup; } // Call this early in your CsmWrapperInitialize(): VOID RegisterNativeInt13Thunk(VOID) { // // 1) Reserve a small real-mode buffer (0–1 MiB window is already mapped) // 2) Copy a tiny real-mode “dispatcher” stub + an INT13_FRAME into it // 3) Compute the physical address (PhysAddr) of that stub // 4) Patch interrupt vector 0x13 in the IVT: // IoWrite16(0x0098, (UINT16)(PhysAddr & 0xFFFF)); // offset // IoWrite16(0x009A, (UINT16)(PhysAddr >> 4)); // segment // 5) Ensure your dispatcher calls Int13hNativeHandler(&MyFrame) // } --- 2) Update your INF/DSC – Add `CsmWrapper_Int13h_Native.c` to the list of sources for your CsmWrapperDxe driver. 3) Rebuild & Deploy 1. Disable Secure Boot (or enroll your key). 2. Rebuild your EDK II firmware package. 3. Flash it or copy the new `CSMWrap.efi` into `EFI\Boot\BootX64.efi`. --- How it works 1. **Struct layout**: Defines `INT13_FRAME` to mirror BIOS INT 13h registers + buffer pointer & flags. 2. **Error mapping**: Converts UEFI errors into BIOS error codes. 3. **Handler**: - Finds all block devices and picks drive 0x80. - Converts CHS to LBA, computes byte count, calls `ReadBlocks`/`WriteBlocks`. - Sets the carry flag and AH error byte so the installer sees expected results. 4. **Thunk registration**: - Reserve memory below 1 MiB, copy in a tiny real-mode stub, patch the IVT vector 0x13. - When the OS does `INT 13h`, the stub packages registers and calls our handler. No BIOS blobs or RETF stubs needed—legacy installers “think” they’re talking to BIOS INT 13h, but it’s pure UEFI under the hood.
-
I try a last time to explain: No 16-bit execution environment UEFI without CSM runs only flat 32- or 64-bit code. SeaBIOS’s INT 13h routines are 16-bit real-mode BIOS code—they simply can’t run in a 64-bit UEFI process. No firmware “thunk” to real mode On CSM-enabled boards, the firmware gives you a tiny real-mode stub (the “thunk”) or leaves paging/PE bits clear so you can drop back to real mode. On UEFI-only boards, firmware locks you into long mode and won’t let you clear CR0.PG or CR0.PE—any attempt to switch to real mode just faults it. No built-in INT 13h handler to steal Legacy BIOS boards and CSM-enabled UEFI boards already initialized an IVT with pointers into their own INT 13h ROM code. UEFI-only boards never set up an IVT for INT 13h at boot, so there’s no existing disk-service entry point to redirect. CSMWrap only provides the handler, not the environment csmwrap.efi bundles SeaBIOS’s disk-service code and IVT-setup logic, but it still needs the ability to: Switch the CPU into 16-bit real mode Take over the Interrupt Vector Table Talk to hardware ports directly Without CSM, the firmware never lets you do any of those three things. CSMWrap isn’t magic—it ships the pieces of a BIOS, but it relies on your motherboard’s firmware to hand it a real-mode CPU and let it install INT 13h vectors. If your UEFI BIOS has no CSM at all, there’s simply no gateway back into real mode and no existing INT 13h hook to hijack. No environment ⇒ no real-mode BIOS interrupts ⇒ no INT 13h. o4-mini
-
@reboot12 Just ask yourself a simple question: Does it work on at least one compi with nativly no CSM support in its Bios Dietmar
-
@GD 2W10 Without CSM in your Bios, this will not work because INT13h runs into nirwana Dietmar
-
1. No Real-Mode Environment BIOS world: 16-bit real mode, flat 0–1 MiB memory, its own stack, segment registers, and interrupt tables (IVT/GDT). UEFI-only world: 32/64-bit protected/long mode, full paging, no real-mode segments, no BIOS stack at 0x0000–0xFFFF. Result: The little RETF instructions in CSMWrap have nowhere valid to return into or switch from—so they never execute. 2. No Legacy BIOS ROM Code BIOS ROM: Carries the actual INT 13h disk routines below 1 MiB. That’s the code CD 13 jumps into to spin the platter and read sectors. UEFI-only firmware: Contains no legacy ROM image under 1 MiB. There is simply no INT 13h handler to call. Result: Even if you could perform CD 13, the CPU would vector to garbage and immediately triple-fault or hang. 3. No IVT Vector Patching CSM-enabled systems: Before loading CSMWrapx64.efi, the firmware patches the IVT at 0x0000:0098/009A so that INT 13h points at the tiny BIOS stub. UEFI-only systems: There is no IVT to patch, and the region at 0x0000–0x03FF isn’t even mapped for interrupts. Result: INT 13h invocation has absolutely nothing registered there—no handler, no fallback. 4. No Mode-Switch Plumbing With CSM: CSM code sets up CR0, paging, GDT entries, and stack pointers so you can do a far switch into real mode and back. Without CSM: The CPU never drops out of 64-bit mode. There’s no mechanism to clear CR0.PE or reload segment descriptors. Result: You can’t magically execute 16-bit BIOS code in a 64-bit world without this plumbing—so the entire stub logic is inert. 5. UEFI’s Native Disk Interface Differs Completely Legacy BIOS: Uses registers and INT 13h for disk I/O. UEFI: Uses EFI_BLOCK_IO_PROTOCOL functions (e.g., ReadBlocks()) in 64-bit code—no interrupts, no registers, no CHS. Result: Even if CSMWrap exists, XP SP3’s INT 13h calls won’t be rerouted to Block I/O because nothing is listening for them. Bottom Line for “Dummies” CSMWrapx64.efi alone is just a collection of 16-bit byte sequences (RETF, INT 13h, RETF). Without CSM, there is no behind-the-scenes BIOS “workshop” to host them: No real-mode memory or stack No BIOS ROM code under 1 MiB No interrupt vectors to catch INT 13h No mode-switch mechanism Therefore, XP SP3’s disk-read calls (INT 13h) simply go nowhere, and the installer cannot load any sectors—so the boot stalls and fails Dietmar
-
1.) What This Patch Does Defines an INT13_FRAME struct mirroring BIOS registers (AH, AL, CH, CL, DH, DL) plus a 64-bit data pointer and CF/AH_out fields. Implements Int13hNativeHandler(), which: Enumerates all UEFI Block I/O devices. Selects the correct HDD by matching DL (0x80 = first fixed disk). Converts CHS to LBA (((CH*(Heads+1) + DH)*Sectors) + (CL-1)). Calls ReadBlocks() or WriteBlocks(). Maps the UEFI EFI_STATUS into BIOS-style CF/AH_out. 2.) Where to Insert Locate the CSMWrap DXE driver directory in your EDK II tree (e.g. PlatformPkg/Features/CompatSupport/CsmWrapperDxe/). Add CsmWrapper_Int13h_Native.c next to the existing source files. Update the INF file: [Sources] CsmWrapper_Int13h_Native.c Update your DSC (under DXE_DRIVER_LIST) so the new INF is built into CSMWrapx64.efi. 3.) IVT Patching (“RegisterNativeInt13Thunk”) CSMWrap already provides a real-mode window below 1 MiB. Reuse it: Place your dispatcher stub + INT13_FRAME in that region (e.g. at physical 0x80000). Patch the IVT vector 0x13 entries at addresses 0x0000:0098 (offset) and 0x0000:009A (segment) using: IoWrite16(0x0098, (UINT16)(PhysAddr & 0xFFFF)); // Offset IoWrite16(0x009A, (UINT16)(PhysAddr >> 4)); // Segment Ensure your dispatcher stub jumps to Int13hNativeHandler(&MyFrame) on INT 13h. Build & Deploy Compile with the EDK II/OVMF toolchain. Disable Secure Boot or sign the updated CSMWrapx64.efi. Place the new CSMWrapx64.efi on your ESP (EFI\Boot\BootX64.efi). Reboot. 5.) Expected Outcome The Windows XP SP3 installer issues INT 13h calls normally. Your native UEFI thunk intercepts and uses Block I/O to service them. XP “thinks” it’s talking to a real BIOS and can read/write disks successfully.
-
Here is a try, to use direct UEFI for to integrate INT13h into the csmwraper.efi /* * CsmWrapper_Int13h_Native.c * * Integrates a native-UEFI “INT 13h” thunk into the existing CSMWrapx64.efi module. * This lets legacy OS installers (e.g. Windows XP SP3) call INT 13h and have it * translated into UEFI Block I/O, without any real-mode RETF stubs or BIOS ROM. * * Build & deploy: * 1. Disable Secure Boot (or enroll your signing key). * 2. Add this file into your PlatformPkg’s CSMWrap DXE driver (e.g. CsmWrapperDxe). * • Update the INF/DSC to compile and link it with CsmWrapperDxe. * 3. Rebuild your firmware/EDK II package. * 4. Flash or drop the new CSMWrapx64.efi into EFI\Boot\BootX64.efi (or your driver store), * ensuring it loads before any OS bootloader. * * Now, XP SP3’s INT 13h calls will be intercepted and serviced via UEFI Block I/O. */ #include <Uefi.h> #include <Library/UefiBootServicesTableLib.h> #include <Library/BaseLib.h> #include <Library/DebugLib.h> #include <Protocol/BlockIo.h> // 1. Thunk frame matching BIOS registers: #pragma pack(1) typedef struct { UINT8 AH; // Function (0x02=read, 0x03=write) UINT8 AL; // Sector count UINT8 CH; // Cylinder UINT8 CL; // Sector (1-based) UINT8 DH; // Head UINT8 DL; // Drive (0x00=A:, 0x80=first HDD) UINT64 BufferPtr; // 64-bit pointer to data buffer UINT8 CF; // Carry Flag (output) UINT8 AH_out; // AH output (error code) } INT13_FRAME; #pragma pack() // 2. Map EFI_STATUS → BIOS AH: STATIC UINT8 MapEfiStatusToBiosError ( IN EFI_STATUS Status ) { if (Status == EFI_NOT_FOUND) return 0x01; // invalid function/device if (Status == EFI_NO_MEDIA) return 0x02; // no media if (Status == EFI_DEVICE_ERROR) return 0x20; // controller failure return 0xFF; // unknown error } // 3. Native-UEFI INT13h handler: EFI_STATUS EFIAPI Int13hNativeHandler ( IN VOID *Context ) { INT13_FRAME *F = Context; EFI_STATUS Status; EFI_BLOCK_IO_PROTOCOL *BlkIo = NULL; EFI_HANDLE *Handles = NULL; UINTN NumHandles, Index; UINT64 Lba; UINTN BufferSize; // 3.a) Enumerate all Block I/O devices Status = gBS->LocateHandleBuffer( ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &NumHandles, &Handles); if (EFI_ERROR(Status)) { F->CF = 1; F->AH_out = MapEfiStatusToBiosError(Status); return EFI_SUCCESS; } // 3.b) Pick the HDD matching DL (0x80 = first fixed disk) for (Index = 0; Index < NumHandles; ++Index) { Status = gBS->OpenProtocol( Handles[Index], &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (!EFI_ERROR(Status) && BlkIo->Media != NULL && !BlkIo->Media->Removable && F->DL == 0x80 /* + partition offset if needed */) { break; } BlkIo = NULL; } if (BlkIo == NULL) { F->CF = 1; F->AH_out = 0x01; goto Cleanup; } // 3.c) Convert CHS → LBA Lba = ((UINT64)F->CH * (BlkIo->Media->Heads + 1) + F->DH) * BlkIo->Media->Sectors + (F->CL - 1); // 3.d) Buffer size = AL * block size BufferSize = (UINTN)F->AL * BlkIo->Media->BlockSize; // 3.e) Execute read/write if (F->AH == 0x02) { Status = BlkIo->ReadBlocks( BlkIo, BlkIo->Media->MediaId, Lba, BufferSize, (VOID*)(UINTN)F->BufferPtr); } else if (F->AH == 0x03) { Status = BlkIo->WriteBlocks( BlkIo, BlkIo->Media->MediaId, Lba, BufferSize, (VOID*)(UINTN)F->BufferPtr); } else { Status = EFI_UNSUPPORTED; } // 3.f) Return CF/AH_out if (EFI_ERROR(Status)) { F->CF = 1; F->AH_out = MapEfiStatusToBiosError(Status); } else { F->CF = 0; F->AH_out = 0; } Cleanup: if (Handles) { gBS->FreePool(Handles); } return EFI_SUCCESS; } // 4. IVT patching stub (to call Int13hNativeHandler): VOID RegisterNativeInt13Thunk ( VOID ) { // // In CsmWrapperInitialize(): // 1. Use the existing real-mode 0–1MiB window (e.g. at 0x80000). // 2. Place your dispatcher stub + INT13_FRAME there. // 3. Compute PhysAddr of the stub. // 4. Patch IVT vector 0x13: // IoWrite16(0x0098, (UINT16)(PhysAddr & 0xFFFF)); // Offset // IoWrite16(0x009A, (UINT16)(PhysAddr >> 4)); // Segment // 5. Ensure your dispatcher calls Int13hNativeHandler(&MyFrame). // // (CSMWrap already sets up identity-mapped pages for 0–1MiB.) } // Hook RegisterNativeInt13Thunk() into your driver’s Init/Entry point.
-
I make a try to explain, why any UEFI-BIOS without INT13h support will fail with this csmwraper. On a legacy BIOS board, the firmware must implement INT 13h or booting raw disk sectors is impossible. A BIOS without INT 13h would be non-functional for disk boot. On a UEFI board with CSM, the firmware provides a small real-mode stub (the “thunk” you saw in CSMWRAPx64.efi in code downwards) so that INT 13h calls are trapped and redirected through UEFI Block I/O under the covers—again, preserving legacy OS compatibility. On a UEFI-only board without CSM, there is no INT 13h. And that’s the problem here if you try to boot a legacy OS that needs INT 13h Dietmar You find this in csmwraper.efi 1.2 C3 ; RET CD 02 ; INT 02h CB ; RETF CD 05 ; INT 05h CB ; RETF CD 10 ; INT 10h CB ; RETF → CD 13 ; INT 13h ← our disk service CB ; RETF CD 15 ; INT 15h CB ; RETF
-
@reboot12 I think, even in the new 1.2 version of the csmwraper there is no INT13h support, https://github.com/FlyGoat/csmwrap/releases/tag/1.2.0 which means, that it cant recognice any boot devices on a compi without any CSM support Dietmar
-
@reboot12 All my Lenovo Flex 10 have UEFI64. I put an UEFI32 Bios on one of them, after this it does not boot anymore Dietmar
-
Re: Missing INT 13h in csmwrapper.efi When you inspect your x86thunk.c, you’ll find this loop around line 312: for (Vector = 0x20, Count = 0; Vector < 0x100; Vector++) { Status = Private->Cpu->RegisterInterruptHandler( Private->Cpu, Vector, LegacyBiosNullInterruptHandler ); … } That only hooks vectors 0x20–0xFF. INT 13h is vector 0x13 (decimal 19), so it never gets handled. As a result, all BIOS disk calls (legacy AH<0x41 and extended AH = 0x41–0x48) fall through to the null handler—hence “No boot device found.” Patch to hook INT 13h Insert this immediately after the null-handler loop in Legacy16Init(): // … existing null-handler registration for vectors 0x20–0xFF … // Hook INT 13h so BIOS disk services reach our real-mode thunk Status = Private->Cpu->RegisterInterruptHandler( Private->Cpu, 0x13, // BIOS Disk Services LegacyBiosDiskInterruptHandler // implement this! ); ASSERT_EFI_ERROR_OR(Status, EFI_ALREADY_STARTED); Next steps Declare the handler prototype near the top of x86thunk.c: VOID EFIAPI LegacyBiosDiskInterruptHandler( IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext ); Add a stub implementation to avoid build errors: VOID EFIAPI LegacyBiosDiskInterruptHandler( IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext ) { // TODO: // 1) Save/restore registers from SystemContext.SystemContextX86 // 2) Decode AH: legacy (AH<0x41) vs. extended (0x41–0x48) // 3) Build/locate Disk Parameter Packet (ES:SI) for extended calls // 4) Call your 16→32→64 UEFI Block I/O thunk // 5) Set CF/ZF/EAX/etc. per BIOS spec and return (IRET) return; } Implement full dispatch by referencing EDK II’s LegacyBiosDxe/Int13Handler: AH = 0x00…0x01 (reset/status) AH = 0x02 (read sectors) AH = 0x41 (install extensions) AH = 0x42 (extended read) AH = 0x48 (get drive parameters) Once your handler is hooked and fully implemented, SeaBIOS will enumerate SATA, USB and NVMe devices normally.
-
Tutorial: Building and Patching csmwrapper.efi to Add INT 13h Disk Services This guide walks you through setting up an EDK II build environment, compiling the original csmwrapper.efi source, and integrating an INT 13h hook so that SeaBIOS can recognize SATA, USB, and NVMe boot devices. —-------------------------------------- 1. Prerequisites • Host OS: Linux (Ubuntu 20.04 or later) or WSL • Packages: git, build-essential (GCC, Make), uuid-dev, iasl, python3, python3-distutils, bzip2, libssl-dev, libncurses5-dev, nasm (optional) On Ubuntu: sudo apt update sudo apt install git build-essential uuid-dev iasl python3 python3-distutils bzip2 libssl-dev libncurses5-dev nasm —-------------------------------------- 2. Obtain EDK II Base Clone the repo: git clone https://github.com/tianocore/edk2.git cd edk2 git checkout edk2-stable202203 Initialize build environment: source edksetup.sh Verify environment: echo $EDK_TOOLS_PATH echo $CONF_PATH —-------------------------------------- 3. Prepare the csmwrapper Sources Copy csmwrap-1.1.0 into edk2/CSMWrap Ensure it contains: CsmWrapper.inf Platform .dsc including this package Source files (.c, .h, optional .asm) Build scripts/Makefile Directory structure example: edk2/ └── CSMWrap/ ├── CsmWrapper.inf ├── Platform.dsc ├── x86thunk.c └── ... —-------------------------------------- 4. Configure INF and DSC – In CsmWrapper.inf: • Add x86thunk.c to Sources • Add dependencies under LibraryClasses: UefiDriverEntryPoint UefiBootServicesTableLib DebugLib CpuIoLib BaseLib LegacyBiosPlatformLib LegacyBiosThunkLib – In your Platform .dsc under Components: COMPONENTS = CSMWrap/CsmWrapper.inf —-------------------------------------- 5. Patch x86thunk.c to Hook INT 13h In Legacy16Init(...), after the null-handler registration loop, insert: // Hook INT 13h for disk services Status = Private->Cpu->RegisterInterruptHandler( Private->Cpu, 0x13, LegacyBiosDiskInterruptHandler ); if (EFI_ERROR(Status) && Status != EFI_ALREADY_STARTED) { return Status; } At the top of the file, declare: VOID EFIAPI LegacyBiosDiskInterruptHandler( IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext ); And add a stub to prevent build errors: VOID EFIAPI LegacyBiosDiskInterruptHandler( IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_SYSTEM_CONTEXT SystemContext ) { // TODO: implement INT 13h dispatch return; } —-------------------------------------- 6. Implement the Disk Handler Inside LegacyBiosDiskInterruptHandler: Save registers from SystemContext.SystemContextX86 Extract AH (RegEax >> 8) to determine function If AH < 0x41, call legacy I/O via Block I/O thunk If 0x41 ≤ AH ≤ 0x48, set up Disk Parameter Packet (DPP) at ES:SI and handle extended calls Set CF/ZF and registers in SystemContext per BIOS spec Tip: Consult EDK II’s LegacyBiosDxe/Int13Handler for reference. —-------------------------------------- 7. Build with EDK II From edk2 root: source edksetup.sh build -a IA32 -p CSMWrap/Platform.dsc -b DEBUG Result: csmwrapper.efi in Build/DEBUG_IA32/CSMWrap/Application/. —-------------------------------------- 8. Test in SeaBIOS Copy the new csmwrapper.efi to your firmware’s CSM path. Boot and verify that SeaBIOS now lists SATA/USB/NVMe devices. Use DEBUG((DEBUG_INFO, ...)) in your handler for logging. —-------------------------------------- 9. Next Steps • Complete full dispatch in the handler (reset, status, etc.) • Validate large-drive support via functions 0x48 (get parameters) and 0x42 (extended read) • Consider upstreaming your patch to the CSM wrapper project
-
reserved
-
On the Asrock z370 k6 board with 8700k cpu it works to full from Sata AHCI via NTLDR. All CSM is disabled on this board. In ´boot.ini you have to set this, because XP SP3 sits on the second partition and the wrapper.efi on the first Dietmar PS: USB3 boot works there also. NVME boot works there also, waooh, 6 sec boottime of XP SP3 to full desktop. [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /noguiboot
-
@reboot12 Waaohh, the too high message about frambuffer is gone. SeaBios starts but tells no Boot Device found. I will try via USB and nvme on the Arrow Lake board Gigabyte B860 DS3H board with 245k cpu and 32Gb ram Dietmar PS: Sata Ahci boot device not recogniced USB3 not recogniced nvme not recogniced. The board always recognices this devices, as you can see on the blinking LED. This means, that without any CSM, an important part is still missed on this CSMWrapper. May be INT13 for boot device.
-
@reboot12 I cant download this new build of the csmwrapper Dietmar
-
@reboot12 After crazy Bios Modd I succeed to disable the "Remap Memory" variable 0x55C. I just test this. But it does not help for to overcome the message about Too high framebuffer. And the compi still shows its full 32 Gb ram. How can this be Dietmar
-
@reboot12 Crazy, of course not. It gives this wrapper a chance to work on Arrow Lake boards Dietmar PS: Here is the modded Bios F6 for Remap Memory disabled, meaning only 4GB. It is for the Gigabyte B860 DS3H board. I test it tomorrow. https://files.catbox.moe/ewsaqs.rom