![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2005
Posts: 11
Rep Power: 0
![]() |
int 80h
Hello everyone. new guy in the neighbourhood.
i am starting to program in asm exclusively in linux, but i haven't found good information about the int 80h, just some vague notes. Could anybody tell me of a paper or a site where i can find good information about this interruption. Thanks in advance |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Depends entirely upon the implementation and the last code that set it up.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Oct 2005
Posts: 11
Rep Power: 0
![]() |
yes, i read that. But i heard that there are more than less estandarized formats. For example on linux x86, there ought to be a minimum standar, because if there were not, a program wouldn't be portable from one machine to another.
In /usr/include/asm/unistd.h there are the numbres of every single system call. I just need to know the parameters and the locations of them for every system call. |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Nov 2005
Posts: 4
Rep Power: 0
![]() |
Hi,
http://www.lxhp.in-berlin.de/lhpsysc0.html There's a lot of stuff at www.linuxassembly.org too. On a side note, I would not perform system calls directly if there's a chance to use libc. Doing so only requires linking with the library itself and the C runtime support module and specifying a runtime linker to use: /home/splyxx [0]> cat test.asm
extern puts
global main
section .text
msg db 'hello world', 0
main:
push dword msg
call puts
add esp, 4
mov eax, 0
ret
/home/splyxx [0]> nasm -f elf test.asm -o test.o
/home/splyxx [0]> ld test.o -o test /usr/lib/crti.o /usr/lib/crtn.o /usr/lib/crt1.o -lc --dynamic-linker /lib/ld-linux.so.2
/home/splyxx [0]> ./test
hello world
/home/splyxx [0]>(The details may differ if you're using a new Linux system - this one is almost three years old - but you should be able to reverse-engineer what gcc does to link applications. If you link with libc, your assembly code will be portable to FreeBSD, NetBSD, OpenBSD (If you prepend libc functions with a ``_'' character even to a.out-based OpenBSD) and perhaps other x86 systems your assembler runs on.) In fact you should invoke gcc instead of ld to link your application, unless you're writing your own compiler ![]() |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Oct 2005
Posts: 11
Rep Power: 0
![]() |
ok, that trick of linking the program against glibc, works just fine. But i am doing some research, and every single program in asm for linux x86 that i find uses the int 80h, and they are not so self-explanatory, so it would be nice to have some docs about it.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|