Boot loaders and Ctrl+Alt+Del

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Boot loaders and Ctrl+Alt+Del

Post by Antti »

What would be the best way to prevent "Ctrl+Alt+Del" from doing warm reboot (or doing anything) while still in real mode and interrupts enabled? As far as I understand, this warm reboot does not restore interrupt vector entries or anything. It is a problem if a user hits the magic buttons at wrong time because I have modified some of those.

I have read about INT 0x19 etc.
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: Boot loaders and Ctrl+Alt+Del

Post by alexfru »

I'd try either disabling IRQ1 or installing an ISR for it that would just read and drop input data.
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: Boot loaders and Ctrl+Alt+Del

Post by Antti »

alexfru wrote:disabling IRQ1
Yes, I was thinking this. I would simply run this code snippet at early startup:

Code: Select all

Opcodes         Mnemonic                Comments

E4 21           in al,0x21              get current Master PIC mask
0C 02           or al,0x02              set mask "???? ??1?"
E6 21           out 0x21,al             set new Master PIC mask
Looks simple and compact 6-byte snippet but I am not very comfortable with this. Is it acceptable to assume that PIC exists? Is this going to mess up the BIOS?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Boot loaders and Ctrl+Alt+Del

Post by Brendan »

Hi,
Antti wrote:What would be the best way to prevent "Ctrl+Alt+Del" from doing warm reboot (or doing anything) while still in real mode and interrupts enabled? As far as I understand, this warm reboot does not restore interrupt vector entries or anything. It is a problem if a user hits the magic buttons at wrong time because I have modified some of those.
For warm reboot, the BIOS should restore interrupt vectors.

If you do something that the BIOS doesn't reset during warm reboot (e.g. messing with MTRRs and PCI configuration space); the best option would be to replace the keyboard IRQ handler with your own, detect "Ctrl+Alt+Del" yourself, and reset the system yourself (so that the behaviour the user expects still occurs).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: Boot loaders and Ctrl+Alt+Del

Post by Antti »

Brendan wrote:For warm reboot, the BIOS should restore interrupt vectors.
Good! Then there is no problem at all. From some source I read that warm reboot did not restore the vector but I cannot find it again. By the way, I have not tried what happens to the memory content in general.
Brendan wrote:messing with MTRRs and PCI configuration space
At that point we have crossed the point of no return.
Post Reply