views:

377

answers:

3

I am developing a compiler for my senior project in school, and I am using AS (GNU Assembler) to assemble. All of my tests have been fairly successful, but no interrupt lists I have seen have seemed to work or match up with my test code.

The relevant information for this version of AS:

GNU assembler 2.17 Debian GNU/Linux Copyright 2005 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. This assembler was configured for a target of `i486-linux-gnu'.

A: 

IMHO the way interrupts are hooked up is hardware specific. It may be educational to look how the Linux kernel deals with interrupts on the hardware you are targeting.

lothar
+1  A: 

Linux does not use interrupts for system calls the same way DOS does. It uses an architecture-dependent method to make system calls, which on x86 can be int 0x80, but modern (Pentium+) CPUs should use the SYSENTER instruction instead. Other software interrupts aren't used.

Normally you don't worry about this, because even in assembly language, you'll probably still want to use the C library, which wraps these.

MarkR
A: 

In linux, you use one interrupt: 80h. The syscall which that interrupt corresponds to can be found in this table.

rascher