keyboard driver: How does os send data to program
keyboard driver: How does os send data to program
The keyboard driver catches the interrupt, figures out which key was pressed, then sends a message to the user program. How do I send it to that message?
Re: keyboard driver: How does os send data to program
Hi,
How do you do your normal IPC?
Cheers,
Adam
How do you do your normal IPC?
Cheers,
Adam
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: keyboard driver: How does os send data to program
The way that I see it, the kernel does not send the data - the process retrieves the data through some sort of read call. The way I see it, the key is pressed and the kernel catches the int and then stores the pressed key to a buffer. Then the user process performs a system call and the kernel returns one (or more) keys stored in the buffer.
Of course, this isn't the only way, you could send a pressed key to a process by means of a signal or message...
-JL
Of course, this isn't the only way, you could send a pressed key to a process by means of a signal or message...
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: keyboard driver: How does os send data to program
Or you could have your application (when initializing) perform a system call that registers an event handler function, which is called when a keyboard interrupt occurs (à la Win32?).
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.