This is a discussion on its related to linux , interrupts.. within the Coding in General forums, part of the Development/Scripting category; Hi , I have a question on interrupts: how to pass interrupts from kernel mode to user mode.. details: i would ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Hi ,
I have a question on interrupts: how to pass interrupts from kernel mode to user mode.. details: i would like to run spesific appication at user level, after receiving hard ware interrupt, i have a method i am not sure about it?if anybody know about this please ans. my ans: after receiving interrrupt, i am calling a function user_mode_helper(), this run the specific applicaion in kernal mode, |
|
||||
|
Well I'm not C/C++ guru but you can use following google.com link to get http://www.google.com/search?hs=2Hb&...ce&btnG=Search
Also see free book (Linux Device Drivers, Third Edition) http://www.oreilly.com/catalog/linux...book/index.csp -- it has info on Interrupt Handling (chapter 10) If you have any futher question reply back |
|
|||
|
Hi,
I want to mask some hardware interrupts (selectively). I'm using below code to mask interrupt 10. #include <stdio.h> #include <stdlib.h> #include <sys/io.h> int main() { int slave; //Change the IO privilege level of current process. if (iopl(3) < 0) { perror("cannot get i/o privileges"); return 1; } slave = 0; slave = inb_p(0xA1); //get the contents of Interrupt Mask Regester (IMR) printf("Before changing...\n"); printf("IMR :: %x\n",slave); slave |= 0x4; //Mask interrupt 10 outb_p(slave,0xA1); //write new flag to IMR slave = 0; slave = inb_p(0xA1); //get the contents of Interrupt Mask Regester (IMR) printf("After changing...\n"); printf("IMR :: %x\n",slave); sleep(5); //Sleep for 5 seconds printf("After sleep...\n"); printf("IMR :: %x\n",slave); return 0; } This is user level application. It first changes the privilege level from 0 to 3. Then reads the contents of Interrupt Mask Register (IMR), which contains the status of interrupts 8 to 15. It then sets bit 3 (interrupt 10) and rewrites the value back to IMR. When I run the application, it change the mask in IMR. But the mask gets reset to old value immediately, before exiting from the application. I want to keep the new mask till the completion of application. Can anybody help me, how to do this? Last edited by kkumarp; 12-11-2007 at 07:51 PM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Issue related to shells | vaibhav.kanchan | Getting started tutorials | 4 | 03-25-2008 12:52 AM |
| How to get xen related api's in Suse sles10 sp1 | namitha | XEN | 1 | 12-05-2007 03:12 PM |
| What is heap and how it is a related with gcc? | Coding in General | 3 | 06-03-2005 10:41 AM | |