inturrupt by key

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
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

inturrupt by key

Post 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?
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Re: inturrupt by key

Post 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.
If I had an OS, there would be a link here.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: inturrupt by key

Post 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?
User avatar
alethiophile
Member
Member
Posts: 90
Joined: Sat May 30, 2009 10:28 am

Re: inturrupt by key

Post 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.
If I had an OS, there would be a link here.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: inturrupt by key

Post by VolTeK »

thanks, now i can stop the user from restarting the computer, or i might not use this yet, thanks anyway
User avatar
gravaera
Member
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

Post 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.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: inturrupt by key

Post 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 :D
Post Reply