Hi there,
I was thinking about how to stop the computer when my OS panics or shuts down, and I thought seeming "hlt" stops the processor until an interrupt occurs, and if i disable interrupts well it won't start again.
I noticed a lot of people do something like "while(1);" to halt, but I was thinking that the processor would be running all the time getting hot when it was supposed to be shut down, which is why i thought hlt would be a good idea.
Bochs doesn't like it though, it panics and quits. Have I done something bad? or do I need to upgrade bochs or something?
Thanks
>>PANIC<< WARNING: HLT instruction with IF=0!
Re:>>PANIC<< WARNING: HLT instruction with IF=0!
No you did nothing wrong I think.
I have the same with my code. I believe Bochs just know that the CPU is halted forever And that's what you want isn't it ?
However I added a while(1) loop around the HLT since it seems on some hardware the CPU is able to go out of the HLT even if you mask interrupts.
I have the same with my code. I believe Bochs just know that the CPU is halted forever And that's what you want isn't it ?
However I added a while(1) loop around the HLT since it seems on some hardware the CPU is able to go out of the HLT even if you mask interrupts.
Re:>>PANIC<< WARNING: HLT instruction with IF=0!
Its proberbly the way bochs i configured for you. when i execute
cli
hlt
bochs says:
warning: hlt instruction when if=0
you should be able to change the way it responds to cli hlt in bochsrc.txt. It should tell you what to do in the documentation.
cli
hlt
bochs says:
warning: hlt instruction when if=0
you should be able to change the way it responds to cli hlt in bochsrc.txt. It should tell you what to do in the documentation.
Re:>>PANIC<< WARNING: HLT instruction with IF=0!
Try (in your bochsrc):
debug: action=ignore
panic: action=ask
error: action=report
info: action=report
-or-
debug: action=ignore
panic: action=fatal
error: action=ask
info: action=report
I think, though I'm not sure, it's the "debug" action that will be invoked when this warning is raised. The first of the 2 is from my bochsrc, the second I think I found on an FAQ somewhere. Play around with the actions and see what you get.
Setting these actions also helps with the "CPU_LOOP 1" messages and even fixed a segfault on my machine so I consider it good practice to always set the actions to what you want instead of relying on the defaults.
debug: action=ignore
panic: action=ask
error: action=report
info: action=report
-or-
debug: action=ignore
panic: action=fatal
error: action=ask
info: action=report
I think, though I'm not sure, it's the "debug" action that will be invoked when this warning is raised. The first of the 2 is from my bochsrc, the second I think I found on an FAQ somewhere. Play around with the actions and see what you get.
Setting these actions also helps with the "CPU_LOOP 1" messages and even fixed a segfault on my machine so I consider it good practice to always set the actions to what you want instead of relying on the defaults.
- spix
- Member
- Posts: 128
- Joined: Mon Jun 26, 2006 8:41 am
- Location: Millicent, South Australia
- Contact:
Re:>>PANIC<< WARNING: HLT instruction with IF=0!
Thanks for the info, I'll fix the debug settings. I just wasn't sure if I was doing the right thing because it paniced.
Thanks again
Thanks again
Re:>>PANIC<< WARNING: HLT instruction with IF=0!
yes notice it says warning instead of error
btw
IF is Interrupt Flag
btw
IF is Interrupt Flag