Hi all,
I'v two questions:
1) What is the purpose (benefit, interret) of the Mode 2 of the Intel TIMER 8253/8254 ?
2) I need to write "hello" on /home/test.txt. When pressing CTRL+C Cominaison.
I did it by derouting the SIGINT signal.
Now i cant to do it by reprogramming the PIC (to modify an entry on the vector of interrupt) of my computer.
Some ideas ? examples ?
thanks a lot.
=== in french ===
Bonjour tout le monde,
voila en fait j'ai deux questions;
1) je voulais savoir l'interret du mode 2 du timer 8253 de intel. Il existe plusieurs modes, mais je voulais savoir a quoi bon en avoir plusieurs, si ils peuvent pratiquement tous faire la même chose.
Le plus important pour moi est de savoir pourquoi ce mode 2 existe lol.
2) je voulais savoir si on peut reprogrammer le pic de mon ordinateur afin de dérouter une interruption, par exemple utiliser la 50H pour ecrire dans un fichier, et la provoquer par un signal quelconque (style SIGINT, du a la combinaison ctrl+c).
Merci de l'aide, je n'arrive pas a m'y retrouver.
Nelson
PIC and TIMER
Re: PIC and TIMER
Hi,
Firstly, reading your french text you add a little more information in there than the English translation, so I'll attempt another translation using my awful schoolboy french:
The PIC deals with much much lower level signals. Really, IRQs can be described as "action" lines. When one is logic high, it signals that the device attached to it needs some sort of attention.
The keyboard controller is attached to IRQ1, and possibly this is where you're getting confused - it raises an IRQ when a key is pressed, or released (or held down, if repeat keys is on). The operating system's interrupt handler then asks the keyboard controller (via a port read) what happened. The keyboard responds with a 'scancode', which then needs to be converted into proper ASCII, after modification due to whatever modifier keys are already pressed (like CTRL, SHIFT etc).
So you're talking about two completely different areas of the OS stack, it's not possible to do what you want by hooking the PIC.
(not only that, but you'd need kernel-mode privileges to do so, which means a kernel module).
Cheers,
James
Firstly, reading your french text you add a little more information in there than the English translation, so I'll attempt another translation using my awful schoolboy french:
----1) I'd like to know the benefit of Mode 2 of the 8253 timer from Intel. There are many modes, but I would like to know what is good about having many; if they can all practically do the same thing.
The most important thing for me is to know why mode 2 exists [lol].
2) I'd like to know if one can reprogram the PIC on my computer to hook an interrupt, for example to use the 50H for writing in a file, and cause a signal (like SIGINT, from the CTRL+C keycombo).
Thanks for your help, I didn't find anything [from a search].
I point you to http://www.brokenthorn.com which has an extremely good and in-depth article about the PIT. It explains all the modes there.nelsooon wrote:Hi all,
I'v two questions:
1) What is the purpose (benefit, interret) of the Mode 2 of the Intel TIMER 8253/8254 ?
You're talking about signals at hugely different levels of the OS stack here. SIGINT is a software (POSIX) signal dispatched by the operating system to your process when the keyboard driver recognises the SIGINT character combination (ctrl+c). The PIC deals with signals (called IRQs or interrupt requests) sent directly to the processor, which then passes to the operating system.2) I need to write "hello" on /home/test.txt. When pressing CTRL+C Cominaison.
I did it by derouting the SIGINT signal.
Now i cant to do it by reprogramming the PIC (to modify an entry on the vector of interrupt) of my computer.
Some ideas ? examples ?
thanks a lot.
The PIC deals with much much lower level signals. Really, IRQs can be described as "action" lines. When one is logic high, it signals that the device attached to it needs some sort of attention.
The keyboard controller is attached to IRQ1, and possibly this is where you're getting confused - it raises an IRQ when a key is pressed, or released (or held down, if repeat keys is on). The operating system's interrupt handler then asks the keyboard controller (via a port read) what happened. The keyboard responds with a 'scancode', which then needs to be converted into proper ASCII, after modification due to whatever modifier keys are already pressed (like CTRL, SHIFT etc).
So you're talking about two completely different areas of the OS stack, it's not possible to do what you want by hooking the PIC.
(not only that, but you'd need kernel-mode privileges to do so, which means a kernel module).
Cheers,
James