How to completely suspend the processor?

前端 未结 3 1768
鱼传尺愫
鱼传尺愫 2020-12-18 01:37

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
<         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 02:25

    I think you are a bit confused about both of these commands.

    The sti command enables interrupts and the cli command disables them.

    The halt state is similar to an idle loop, so it doesn't suspend the processor.

    Here are some links that may help you: Info on the STI/CLI commands: http://en.wikipedia.org/wiki/STI_%28x86_instruction%29

    Info on the x86 instructions: http://en.wikipedia.org/wiki/X86_instruction_listings From here there is a link to the hlt command that may help.

    If you suspend the processor, how do you wake it up again, if you disable the interrupts?

提交回复
热议问题