How to make system calls having 64-bit arguments using 'int 80h' in 32-bit Linux
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > How to make system calls having 64-bit arguments using 'int 80h' in 32-bit Linux




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to make system calls having 64-bit arguments using 'int 80h' in 32-bit Linux  
Visa Inquirer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-07 06:31 AM

If I need to make a system call with 6 arguments I can use the code:
"       push    %esi\n"
"       push    %edi\n"
"       push    %ebx\n"
"       push    %ebp\n"
"       movl    16+ 4(%esp),%eax\n" // syscall_num
"       movl    16+ 8(%esp),%ebx\n" // arg1
"       movl    16+12(%esp),%ecx\n" // arg2
"       movl    16+16(%esp),%edx\n" // arg3
"       movl    16+20(%esp),%esi\n" // arg4
"       movl    16+24(%esp),%edi\n" // arg5
"       movl    16+28(%esp),%ebp\n" // arg6
"       int     $0x80\n"
"       popl    %ebp\n"
"       popl    %ebx\n"
"       popl    %edi\n"
"       popl    %esi\n"
"       ret\n"

But what happens for system calls like 'mmap'?
void  *  mmap(void *start, size_t length, int prot , int flags, int
fd, off_t offset);
It's last argument is off_t which is 64-bit. Where should the high
part of this offset fit in? There is not enough registers...
Same for lseek:
off_t lseek(int fildes, off_t offset, int whence);
how will the high part of 'offset' argument be passed?

Is there any documentation about this?






[ Post a follow-up to this message ]



    Re: How to make system calls having 64-bit arguments using 'int 80h' in 32-bit Linux  
Visa Inquirer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-07 12:32 PM

> Your question is necessarily OS-specific, yet you didn't give any
> indication of which OS you are using.
>
> The UserAgent gives a clue that you might be interested in something
> other than Linux: "Mozilla/5.0 (X11; U; FreeBSD i386...".

I specified in subject: ".. in 32-bit Linux". This + assembly language
used narrows OS down to x86-lInox.
I use FreeBSD for posting but my question refers to Linux.







[ Post a follow-up to this message ]



    Re: How to make system calls having 64-bit arguments using 'int 80h' in 32-bit Linux  
Visa Inquirer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-07 12:22 AM

> But what happens for system calls like 'mmap'?

Thanks for your replies. Now I see that it's impossible to have 64-bit
args in 32-bit Linux and also it's impossible to have syscalls with
more than 6 arguments.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:55 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register