Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assembly calls,,

 
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop
View previous topic :: View next topic  
Author Message
Ooyama



Joined: 24 Nov 2007
Posts: 2

PostPosted: Sat Nov 24, 2007 4:25 pm    Post subject: Assembly calls,, Reply with quote

Having used Syllable for some time, and being an Assemblycoder, i'd like to know; is it planned (at some point soon) to let guys/girls like me to get into the action Smile . Also, as thing are going atm (everything moving towards increased *nix-compatability, i guess it won't be a problem) i'd like to know when i'd be able to use my NASM-code (as noone i've contacted (on the old forum) sofar can give me the syscalls for anything in ASM) Wink !

Best regards (and in the hope of some SYS_CALL info),,

Ooyama,,

TY
Back to top
View user's profile Send private message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Sat Nov 24, 2007 5:35 pm    Post subject: Reply with quote

Syllable uses the same SySV IA-32 int 0x80 interface that pre-SYSENTER Linux kernels used. A maximum of 5 arguments are pushed onto the stack and the syscall number goes in EAX.

The C library code that defines the syscall interface for libc can be found in /syllable/system/apps/utils/Builder/packages/glibc-2.4/patches/syllable/sysdeps/unix/sysv/syllable/i386/sysdep.h, sysdep.S and syscall.S. The syscall numbers are defined in /system/include/atheos/syscall.h

From the comments in sysdep.h:

[code:1]
Syllable takes system call arguments in registers:

syscall number %eax call-clobbered
arg 1 %ebx call-saved
arg 2 %ecx call-clobbered
arg 3 %edx call-clobbered
arg 4 %esi call-saved
arg 5 %edi call-saved

The stack layout upon entering the function is:

20(%esp) Arg# 5
16(%esp) Arg# 4
12(%esp) Arg# 3
8(%esp) Arg# 2
4(%esp) Arg# 1
(%esp) Return address

(Of course a function with say 3 arguments does not have entries for arguments 4 and 5.)
[/code:1]

On return from the kernel EAX contains the syscall return value (Although see syscall.S for a special note on this) and the caller must pop the syscall arguments off the stack.
Back to top
View user's profile Send private message Send e-mail
Ooyama



Joined: 24 Nov 2007
Posts: 2

PostPosted: Sat Nov 24, 2007 5:47 pm    Post subject: Reply with quote

Thank you very much Vanders, exactly what i needed Smile ,, as i'm looking into AI work on this Smile (curious by nature,, you know).


Thank you,

Ooyama.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group