Kolodez wrote:
Hi, on my (real) PC, I boot my OS and perform the APM installation check (INT 0x15, AX=0x5300, BX=0x0), but the BIOS returns the error "APM not present" (CF set, AH=0x86). If APM v1.2 was present, I could shut down my PC from real mode by calling INT 0x15, AX=0x5307, BX=0x1, CX=0x3.
But how can I shut down the PC without APM and without using ACPI? The problem why I cannot use ACPI is that the RSDP says that the addresses of the RSDT and the XSDT are above 0x10FFEF, so I cannot access them in real mode, can I? And an answer like "you cannot shut down from real mode, you must enable protected mode first" seems very unsatisfying. Why would they make it so complicated?
Thank you for your help!
I would understand your objection if it was about long mode (which requires setting up paging, which admittedly is a bit of a hurdle to overcome). But protected mode? Set up a GDT, load it, set the PM bit, long jump, done. Literally 5 instructions and 24 bytes of data. And then you can even use 32-bit assembly, which allows you to use all registers as pointer registers (16-bit mode only allows you to use BX, BP, SI, and DI, and the some of one of the former two and one of the latter two).
No, the complicated part is parsing enough of the ACPI tables to send the system into S5 state.