nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

its related to linux , interrupts..

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 ...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-08-2005, 02:43 PM
venkateswarlu
Guest
 
Posts: n/a
Default its related to linux , interrupts..

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,
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-08-2005, 02:54 PM
venkateswarlu
Guest
 
Posts: n/a
Default interrupts

how to use this function:call_usermodehelper(),
how to pass interrupt request to user space
Reply With Quote
  #3 (permalink)  
Old 07-08-2005, 11:18 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

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
Reply With Quote
  #4 (permalink)  
Old 12-11-2007, 05:28 PM
Junior Member
User
 
Join Date: Dec 2007
My distro: SUSE
Posts: 1
Rep Power: 0
kkumarp is on a distinguished road
Question How to disable/enable interrupts permanently in linux

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.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT +5.5. The time now is 04:31 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36