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
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:
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
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
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
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
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
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.
___
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