nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-07-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
  #2 (permalink)  
Old 08-07-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 08-07-2005, 11:18 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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 11-12-2007, 05:28 PM
Junior Member
User
 
Join Date: Dec 2007
OS: SUSE
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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; 11-12-2007 at 07:51 PM.
Reply With Quote
Reply


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 Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Issue related to shells vaibhav.kanchan Getting started tutorials 4 25-03-2008 12:52 AM
How to get xen related api's in Suse sles10 sp1 namitha XEN 1 05-12-2007 03:12 PM
What is heap and how it is a related with gcc? Coding in General 3 03-06-2005 10:41 AM


All times are GMT +5.5. The time now is 10:45 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38