inturrupt by key
inturrupt by key
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?
- alethiophile
- Member
- Posts: 90
- Joined: Sat May 30, 2009 10:28 am
Re: inturrupt by key
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.
If I had an OS, there would be a link here.
Re: inturrupt by key
sorry if i am not clear
i want to know if i can trigger an inturrupt in real mode by just hitting a key?
i want to know if i can trigger an inturrupt in real mode by just hitting a key?
- alethiophile
- Member
- Posts: 90
- Joined: Sat May 30, 2009 10:28 am
Re: inturrupt by key
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.
If I had an OS, there would be a link here.
Re: inturrupt by key
thanks, now i can stop the user from restarting the computer, or i might not use this yet, thanks anyway
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: inturrupt by key
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.
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.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Re: inturrupt by key
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
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