Hook 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.
User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Post by Pitchu »

AJ wrote:The gist of it is - the ISR is installed by the operating system. You will need to use your IRQ 0x01 handler. In real mode, it may well be Int 0x09.

Cheers,
Adam
I believe ISR for int 0-10h is installed by bios?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Pitchu wrote:
AJ wrote:The gist of it is - the ISR is installed by the operating system. You will need to use your IRQ 0x01 handler. In real mode, it may well be Int 0x09.

Cheers,
Adam
I believe ISR for int 0-10h is installed by bios?
the IVT is indeed installed by the bios, but is useless once you move to 32 bit mode.
User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Post by Pitchu »

Yeah exactly :D

Please Dont take my words otherwise, what i wanna know is that i believe that the jmp instruction to reboot is also loaded/placed in memory by bios which gets executed once sombody presses ctrl+alt+del.

If I am correct then this instruction will be a part of some ISR that is invoked by atleast a single key press....I believe ISR for keyboard.
Now to do something else for that event(i.e. ctrl+alt+del) i think i should hook keyboard ISR.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

You were told that in the first few replies. I suggest you read before ranting.
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post by lukem95 »

your chatting a whole heap of crap, youv had very clear answers. When any key is pressed, it fires an interrupt. Using ISR's you can run code when this interrupt is fired, and get the scancode (a unique code for the key, every key has a different one - lists are available if you google for them).
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Post by Pitchu »

Well I dont think what I was chatting was rubish as i wasnt able to get the clear working of ctrl+alt+del key combination rebooting the system.

I knew that i can alter its working but was confused where to put that code that will pop-up a box like other OSes do.

Still, If you people think I was doing this for fun then U people are wrong.

Well, I shouldnt mention but I cant live with that, this isnt still clear and I need not to get clear it for insults.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

If you have read the Intel Manuals and have read up information from the wiki, the replies you have had should make this perfectly clear. We can give you pointers in the right direction, but can't give you the full background knowlege required or implement the solution for you.

You need to know how the IVT works (RMode) or how the IDT works (PMode) and be able to create handlers based on this.

Cheers,
Adam
User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Post by Pitchu »

OK!
Considering the Real Mode of Intel Processor I believe:

1. Int 09H ISR checks for the key combination of Ctrl+Alt+Del and reboots it my making a far jmp.

2. Hooking this Int 09H will mean installing a KeyBoard driver there.

Consider the PMode :

1. I need to Remap the PIC.
2. Hook the int Corresponding to IRQ 01 and install keyboard driver there.

Hope this time I am correct :?:
User avatar
t6q4
Member
Member
Posts: 25
Joined: Thu Feb 14, 2008 3:56 pm

Post by t6q4 »

Hello,
To add to your list of things needed to hook up a keyboard driver in PMode, my list is:
1) Remap the PIC (Because otherwise the IRQ 1 is Interrupt 9, and as you may know Ints 0-31 are reserved to service exceptions)
2) Set up your GDT (Or get your bootloader to do this if you are using your own, otherwise do it in your kernel)
3) Set up the IDT (This is important. You will also need to create entries for the first 32 exceptions and the 16 IRQs. Maybe make one for system calls)
4) NOW you can hook up a handler to IRQ 1.
[ The entire list is covered in Bran's Kernel Development Tutorial on http://www.osdever.net/ ]
User avatar
zaleschiemilgabriel
Member
Member
Posts: 232
Joined: Mon Feb 04, 2008 3:58 am

Post by zaleschiemilgabriel »

I have a feeling we're not in Kansas anymore...
cyr1x
Member
Member
Posts: 207
Joined: Tue Aug 21, 2007 1:41 am
Location: Germany

Post by cyr1x »

Pitchu wrote:OK!
1. Int 09H ISR checks for the key combination of Ctrl+Alt+Del and reboots it my making a far jmp.
Not "int 0x9" does the "far jmp", but it invokes "int 0x19" which does the "far jmp".
User avatar
Pitchu
Member
Member
Posts: 56
Joined: Tue Feb 12, 2008 3:16 am
Location: Kashmir - Paradise On Earth

Post by Pitchu »

Hi Cyr1x & T6q4
yep its int 19h that does far jmp.
And thanks for reply n link.
Lol
Post Reply