interrupts

How do I identify device specific interrupts on x86?

In the Intel software developers manual it says that interrupt vectors 32-255 are usually user defined for external IO devices. In my systems programming class I must develop a simple device driver. My question is how can I define a specific interrupt vector to be used for a specific device? Is this done with the BIOS? Note: we are deve...

Threading in Java

I am trying to have my main thread spawn off a new thread and, after some time, raise the interrupt flag. When it does so, the spawned thread should see that flag and terminate itself. The main thread looks something like this: final Thread t = new Thread() { @Override public void run() { f(); } }; t.start(); try { t.join(time);...

How could an assembly OUTB function cause a triple fault?

In my systems programming class we are working on a small, simple hobby OS. Personally I have been working on an ATA hard disk driver. I have discovered that a single line of code seems to cause a fault which then immediately reboots the system. The code in question is at the end of my interrupt service routine for the IDE interrupts. Si...

Why would an end-of-interrupt for the master PIC cause a triple fault (reboot)?

Ok, in school we are developing an operating system. My project has been to develop an ATA hard disk driver. I thought I had my interrupt service routine working quite well when my professor pointed out that I was only sending end-of-interrupt commands to the slave PIC, and not the master as well. My problem is that whenever I send the ...

Interrupt Handling on SMP Systems

Are Interrupts assigned to a fixed CPU (always handled by the same CPU)? To put my question in context: From: http://msdn.microsoft.com/en-us/library/ms795060.aspx The spin lock that protects the shared area has an IRQL equal to the DIRQL at which the device interrupts. As long as the critical-section routine holds the spin lock and a...

Assembly Programming and Interrupt Handling

I'm writing a program in assembly using MIPS architecture for a class, and I'm having trouble figuring out how to grab an input character by a user and store it in a register to process. The program would open a console, output a message, the user can then input a character and then this determines what is supposed to happen next in the...

Extended Interrupt 13, Reading an unformatted Disk.

It's been a while since I did any ASM, and decided to once again try and write a small bootloader, testing with qemu. My issue is with interupt 13, for some reason the carry flag is being set, so the read is failing. Currently, my disk image looks like: 512 Byte BootLoader <- This (as far as I'm aware) Is block 0 in LBA Main Function <...

PIC 16F684 Microcontroller Interupt Handling

I just finished up my Microprocessors class in college just a few weeks ago, there we programmed in assembly only. We learned a fair amount (IMHO) about interrupts. Here is my question: I am programming in C using the HiTech Compiler for the 16F684, in the datasheet section discussing the interrupts (PIC 16F684 Datasheet Section 12.4) ...

8086 assembly right mouse click interrupts

Hi guys I am working on a project in 8086 assembly on windows machine and I need to know which mouse button has been clicked. What are the interrupts for this? or how do I go about finding this out? Thanks ...

How CPU finds ISR and distinguishes between devices

I should first share all what I know - and that is complete chaos. There are several different questions on the topic, so please don't get irritated :). 1) To find an ISR, CPU is provided with a interrupt number. In x86 machines (286/386 and above) there is a IVT with ISRs in it; each entry of 4 bytes in size. So we need to multiply int...

How to call DOS Interrupts within a C/C++ program using Inline Assembly ?

Hi, everyone ! I need to call some DOS interrupts (Services) from a C/C++ program, I tried the following inline asm code: (Read a character) int main() { asm( "movb $0x01, %ah;" "int $0x21" ); system("PAUSE"); } But it did not work ! I would like to know what have i done wrong here ! Also if there is another way to call dos interr...

Passing parameters between interrupt handlers on a Cortex-M3 ...

I'm building a light kernel for a Cortex-M3. From a high priority interrupt I'd like to invoke some code to run in a lower priority interrupt and pass some parameters along. I don't want to use a queue to post work to the lower priority interrupt. I just have a buffer and size to pass to it. In the proramming manual it says that the ...

Which Cortex-M3 interrupts can I use for general purpose work?

I'd have some code that needs to be run as the result of a particular interrupt going off. I don't want to execute it in the context of the interrupt itself but I also don't want it to execute in thread mode. I would like to run it at a priority that's lower than the high level interrupt that precipitated its running but also a priorit...

How to modify Keyboard interrupt (under Windows XP) from a C++ Program ?

Hi everyone ! We have been given a little project (As part of my OS course) to make a Windows program that modifies keyboard input, so that it transforms any lowercase character entered into an uppercase one (without using caps-lock) ! so when you type on the keyboard you'll see what you're typing transformed into uppercase ! I have do...

Trace interruption on a linux system

Hi, The command strace is mainly for tracing system call. Does someone know the equivalent for tracing interruption like IRQ14... Thanks ...

Access to two variables safely when an interrupt might occur between them.

First of all I'd welcome edits to the title of this question, I couldn't think how to word it better but I'm not too happy with what I came up with. This is a question about concurrency, my application is on a microcontroller in C but I don't think that matters a great deal. I have an interrupt routine which can change the values of tw...

Get interrupt counters like /proc/interrupts from code?

Hi, I may miss the obvious, but how/is it possible to retrieve interrupt counters for a specific interrupt without manually parsing /proc/interrupts from inside a C/C++ program? Thanks in advance! Best regards, Martin ...

Interrupt in C++

Hi, I am trying to understand interrupts and am looking for a simple code that uses interrupts. Could somebody please help me with it? ...

How to implement a timer with interruption in C++?

I'm using the GCC compiler and C++ and I want to make a timer that triggers an interruption when the countdown is 0. Any Ideas? Thanks in advance. EDIT Thanks to Adam, I know how to do it. Now. What about multiple timers running in parallel? Actually, these timers are for something very basic. In NCURSES, I have a list of things. W...