Page 1 of 1
inturrupt by key
Posted: Sun Jun 14, 2009 6:51 pm
by VolTeK
is there a way i can make a key trigger an inturrupt other than ctrl - break? or should i make a keyboard driver to control that?
Re: inturrupt by key
Posted: Sun Jun 14, 2009 8:46 pm
by alethiophile
I'm not sure what you're asking. In case it helps, whenever a key is pressed it fires IRQ #1, which should be mapped to somewhere in your interrupt space. The handler for that interrupt can get the key pressed, and do whatever it wants with it.
Re: inturrupt by key
Posted: Sun Jun 14, 2009 9:04 pm
by VolTeK
sorry if i am not clear
i want to know if i can trigger an inturrupt in real mode by just hitting a key?
Re: inturrupt by key
Posted: Sun Jun 14, 2009 9:06 pm
by alethiophile
It's the same thing in real mode--the keyboard fires an interrupt when a key is pressed, the handler for that interrupt can read the scancode from input port 0x60, and you do with that scancode what you want. There's an example of a simple real-mode keyboard driver on the wiki, in the 'Baby step x' tutorials.
Re: inturrupt by key
Posted: Sun Jun 14, 2009 9:14 pm
by VolTeK
thanks, now i can stop the user from restarting the computer, or i might not use this yet, thanks anyway
Re: inturrupt by key
Posted: Wed Jun 17, 2009 7:49 am
by gravaera
Sorry: Honestly, I think I've figured out why you want to do this: you've probably got a config file to write, or something, during boot, that you don't want to have interrupted, for fear of corrupting sys5tem settings.
There are smarter ways top alleviate concerns over this problem.
You can use an alternate form a Grandfather, Father, Son backup techniques, where you keep one version of the file as an ultimate backup. Then you can have a temporary version of the file for editing. This is actually just Father, Son, seeing as there are only two versions. Only edit one,. amnd every time you successfully edit the settings at bootup, just overwrite the Father File.
You could also have a third one which you could use as the "Last Saved Safe Settings" option or something.
But wasting interrupts on just disabling Ctrl-Alt-Del is not very useful overall.
You could do much cooler things with that interrupt.
I currently use some of my interrups to cause the system to halt, and print the contents of the registers. *shrug*. Just temporary for development.
Re: inturrupt by key
Posted: Wed Jun 17, 2009 11:26 am
by VolTeK
um you dont get what i am wanting to do, but the whole config idea was pretty good but i dont know what i would use it for
i just wanted the user to restart from my control panel
as for the grandfather father son backup, dont worry i will already have that in mind when i think of how to backup my backups