Quote:
Originally Posted by vkmgeek
Hi,
Can anyone relate hardware and OS? How do they work?
Suppose I have one board containing any micro controller. I have external switches which gives external interrupt to that. I have any embedded OS on that board. I have a program in C to handle interrupt..
Now when I press a switch.....what are the consequence things that will happen if C code is to handle the interrupt. I mean I want to know how board will handle that inerrupt or What an OS will doand what that C code will do?
|
To rephrase, just to make sure I understand exactly what you are asking.
You want to know how a c programm will react to a key press in an embedded device, like a cell phone?
The exact answer will depend on the os embedded on the cell phone, this controls the application and has a huge impact.
but basically, the "switches" are stdin, so getch will take the switch action, and put it into a variable for you to have the program do whatever is needed.
[ in the cell phone example, echo the key press to stdout to display the number, if it's a number.
if it's the call button, then it would hand the array of numbers in ram to the dialer function. ]