Would ah 02h al 01h ch 0h cl 02h dh 0h dl 80h bx 0h int 13h work on an ssd as expected…
- User
Would ah 02h al 01h ch 0h cl 02h dh 0h dl 80h bx 0h int 13h work on an ssd as expected to load a kernel
- Assistant
Would ah 02h al 01h ch 0h cl 02h dh 0h dl 80h bx 0h int 13h work on an ssd as expected to load a kernel
Using the BIOS interrupt int 13h with the parameters you've specified—particularly AH = 02h for reading sectors using Cylinder-Head-Sector (CHS) addressing—may not work as expected on a modern SSD to load a kernel. Here's why:
CHS Addressing Limitations: The AH = 02h function of int 13h relies on CHS addressing, which was suitable for older hard drives with simpler geometries. Modern storage devices, especially SSDs, use Logical Block Addressing (LBA) instead of CHS. CHS parameters may not correctly map to the actual physical or logical sectors on an SSD, leading to incorrect data being read or a failure in the operation.
BIOS vs. UEFI: Many modern systems have transitioned from BIOS to UEFI (Unified Extensible Firmware Interface). UEFI uses a different method for booting and interacting with storage devices, often not supporting traditional BIOS interrupts in the same way. Relying on BIOS interrupts like int 13h may not be compatible with UEFI-based systems.
Compatibility Support Module (CSM): Some UEFI systems include a CSM to provide legacy BIOS compatibility. However, even with CSM enabled, not all BIOS interrupt functions are guaranteed to work with modern hardware interfaces like NVMe SSDs.
Drive Numbering and Boot Process: The drive number DL = 80h typically refers to the first hard drive in BIOS interrupts. In systems with multiple storage devices or complex configurations, DL = 80h might not correspond to the SSD you're targeting. Additionally, SSDs connected via interfaces like NVMe may not be accessible through traditional BIOS interrupts.
Protected Mode and Modern Operating Systems: Modern operating systems and bootloaders often switch the CPU to protected mode early in the boot process, limiting or eliminating the availability of BIOS interrupts like int 13h, which are only available in real mode.
Conclusion: Using int 13h with AH = 02h and CHS parameters is not reliable for loading a kernel from an SSD in modern systems. It's recommended to use LBA addressing with extended BIOS functions (such as AH = 42h for extended read) or, better yet, utilize the interfaces provided by UEFI for accessing storage devices. This ensures compatibility with modern hardware and firmware, and aligns with the way contemporary systems handle boot processes and disk access.
Recommendation: Update your code to use extended LBA functions or UEFI services for disk access when working with SSDs on modern systems.
Answer: No—because it uses old BIOS calls with CHS addressing, which don’t work reliably with modern SSDs; so invoking int 13h this way likely won’t load the kernel from an SSD as expected.
Not yet included in a published release.