I\'m writing a small bootloader for an x86 based PC. The problem is that the CPU is somehow still active after executing these instructions:
sti
hlt
<
I would like to add a comment about 'cli' as I have been bitten by this a couple of times in the past. The 'cli' instruction does not block all interrupts--it only blocks the maskable ones. Conceivably, the system could still be woken up due to a non-maskable interrupt (NMI).
As one of the comments indicates that the computer is ready to be turned off, I expect that there are no other threads/processes/tasks ready to run in the system (otherwise an NMI could conceivably lead to a reschedule). For the scenario you describe an NMI is unlikely; however depending upon your level of paranoia of things going wrong, you may wish to add a loop to guard against the possibility.
sysSuspend:
cli
hlt
jmp sysSuspend