Detecting CPUID and CPU Features in a Real-Mode DOS Program
Gate CPUID safely, enumerate only supported leaves, and translate processor feature bits into conservative DOS execution requirements.
tag
12 posts
Gate CPUID safely, enumerate only supported leaves, and translate processor feature bits into conservative DOS execution requirements.
Inspect DOS program memory and bytes with DEBUG's dump, register, and disassembly commands while avoiding execution and raw-sector writes.
Build a reliable DOS child-process call around EXEC, its parameter block, inherited environment and handles, memory requirements, and one-time return status.
Use DOS directory-search calls without overwriting the command tail, losing continuation state, misreading attributes, or confusing end-of-search with a fatal error.
Read the INT 21h AH=36h register contract correctly, calculate free bytes without overflow, and handle invalid drives and changing volumes.
Understand the DOS extended open/create call, its action result and compatibility caveats, including FreeDOS kernel flags that remain incomplete.
Use DOS INT 21h AH=42h safely by handling signed CX:DX offsets, carry-flag errors, past-EOF writes, and version-dependent large-file boundaries.
Understand DOS absolute disk reads and writes, logical drive-relative sectors, extended descriptors, stack quirks, cache hazards, and safe image-based testing.
Use DOS INT 21h functions 48h, 49h, and 4Ah safely by sizing paragraphs, interpreting MCB chains, handling fragmentation, and validating ownership.
Read the DOS PSP as a process ABI: map parent, environment, handle, FCB, and command-tail fields while avoiding unsafe assumptions about private bytes.
Diagnose x87 arithmetic faults using status and control words, sticky exception flags, synchronization points, and CPU-specific DOS handling.
Understand what x87 environment and full-state saves actually preserve, when save instructions reset the unit, and how DOS code avoids corrupting callers.