Re: Calling syscalls through int 0x80 documentation?

2007-10-19 Thread Yuri
Yuri, Sorry I wasn't more help. I'm an old assembler programmer, but have not done much of that under FreeBSD. Glad you got it solved. -Derek This no problem at all Derek. Thank you for answering me anyway. Now I solved my problem and moved on. Have a good weekend! Yuri

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Derek Ragona
At 01:12 PM 10/18/2007, Yuri wrote: Hi, Is there a documentation on how to call system calls via 'int 0x80'? Which registers should contain which values. BTW I am well aware of system call 'syscall' but still need to use 'int 0x80' :-) Thanks, Yuri You can try here:

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Yuri
You can try here: http://www.ctyme.com/intr/int-80.htm Thanks Derek. This site just says: parameters on stack. So when following this I write the function 'mysyscall' (below) it doesn't work. It should return 3 but returns 14. And I am on i386. So something is missing. Yuri --- code

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Derek Ragona
At 01:47 PM 10/18/2007, Yuri wrote: You can try here: http://www.ctyme.com/intr/int-80.htm Thanks Derek. This site just says: parameters on stack. So when following this I write the function 'mysyscall' (below) it doesn't work. It should return 3 but returns 14. And I am on i386. So

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Yuri
I guess I'd ask why you want to use syscall at all to just open a file? I thought you wanted to access some hardware and had no other way to do that. Derek, Opening a file is just an example. I want to be able to make any system call this way since my program for whatever reasons has to be

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Yuri
By experimenting I found the working version now. I still don't understand why first element on stack while going into 'int 0x80' should be stack pointer. asm( .text\n mysyscall:\n movl%esp,%eax\n push28(%eax)\n push24(%eax)\n push20(%eax)\n push

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread icantthinkofone
Yuri wrote: I guess I'd ask why you want to use syscall at all to just open a file? I thought you wanted to access some hardware and had no other way to do that. Derek, Opening a file is just an example. I want to be able to make any system call this way since my program for whatever

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Mak Kolybabi
Lack of documentation causes me to ask this kind of question here. http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86.html Have you looked at the documentation there? Has a section on system calls and return values. ___

Re: Calling syscalls through int 0x80 documentation?

2007-10-18 Thread Yuri
http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/x86.html Have you looked at the documentation there? Has a section on system calls and return values. Thank you Mak! This is what I was looking for. Somehow I have oversaw it myself. Yuri