LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-02-2010, 12:17 PM   #1
skyte
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Mouse event handling and interrupts in linux.


Here's the thing; I come from dos-land,c,c++, and
assembly language. I just wrote a c program using int86
to do software interrupts to read the mouse status.
This doesn't seem to be straightforward in linux.
This because of: ncurses,script languages,etc. which
to me seem vague; that is, does,say, ubuntu linux have
mouse reading functions 'built in' that can be accessed from the plain old bash console? I see references to
structs, etc., but *I can't even figure out what they are referencing!*
I'm really asking can I just access a standard int
routine like in dos? Thank you. skyte.
 
Old 03-02-2010, 02:45 PM   #2
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Rep: Reputation: 51
Quote:
can I just access a standard int
routine like in dos
If you mean something like DOS' int 21h, then it's int 80h in Linux.
If you mean direct IRQ handling etc. from user program, then no, you can't. DOS is an unprotected OS where you do what you want with the hardware and memory. Linux, as any modern OS, has several levels of security, one of which is restricting user mode programs from *direct* hardware access. You can though go into kernel mode by writing a driver and do what you need including servicing IRQs, accessing I/O ports etc.
Quote:
does,say, ubuntu linux have
mouse reading functions 'built in' that can be accessed from the plain old bash console
Most devices in Linux are represented by their corresponding device files. These are usually located in /dev directory.
The files which correspond to mice and keyboards usually are in /dev/input directory.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP w/: Script for EVENT Handling!!! vitoal18t Programming 2 06-24-2009 02:36 PM
Userspace handling of driver interrupts AustinMarton Linux - Kernel 12 01-14-2009 08:48 PM
Handling hardware interrupts zvivered Linux - Embedded & Single-board computer 2 12-11-2008 11:34 AM
Handling of Interrupts in thread context asurya Linux - Newbie 1 04-05-2006 09:15 AM
pygtk event handling pita Programming 1 10-20-2005 01:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration