* Understanding Alpha syscalls
@ 1999-06-02 20:55 B. James Phillippe
1999-06-02 21:53 ` Uncle George
0 siblings, 1 reply; 5+ messages in thread
From: B. James Phillippe @ 1999-06-02 20:55 UTC (permalink / raw)
To: AXP list, Linux Alpha
Greetings,
I'm getting quite lost trying to map the sequence of events between a call
to "open" on a device node from user-space to the invocation of the open
method of a file_operations struct. Can anyone bail me out of this mess?
The C library part is understandable (syscall macros, etc). I am sort of
seeing how system calls are entered in the kernel on Alpha, but it's harder
to follow than x86 because it looks like the PAL does some (a lot?) of the
work. The part I am having the most trouble with is finding where kernel C
code is re-entered to dispatch the file_operations methods..
Some pointers or hints of where to look would be helpful. Also, I'm not
sure what mechanism is used to signal the processor/kernel that a system
call has been invoked; on x86 it's something like instruction "int $0x80".
thanks,
-bp
--
# Software Development, WatchGuard Inc.
# Projects, PGP key at http://www.terran.org/~bryan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Understanding Alpha syscalls
1999-06-02 20:55 B. James Phillippe
@ 1999-06-02 21:53 ` Uncle George
1999-06-02 21:57 ` B. James Phillippe
0 siblings, 1 reply; 5+ messages in thread
From: Uncle George @ 1999-06-02 21:53 UTC (permalink / raw)
To: axp-list, B. James Phillippe
most of all the syscall interpretation is done in the assembler file entry.S
in arch/alpha/kernel. if u know ur syscall #, u can look it up at
sys_call_table: + offset(syscall #).
hope this helps.
gat
B. James Phillippe wrote:
> Greetings,
>
> I'm getting quite lost trying to map the sequence of events between a call
> to "open" on a device node from user-space to the invocation of the open
> method of a file_operations struct. Can anyone bail me out of this mess?
>
> The C library part is understandable (syscall macros, etc). I am sort of
> seeing how system calls are entered in the kernel on Alpha, but it's harder
> to follow than x86 because it looks like the PAL does some (a lot?) of the
> work. The part I am having the most trouble with is finding where kernel C
> code is re-entered to dispatch the file_operations methods..
>
> Some pointers or hints of where to look would be helpful. Also, I'm not
> sure what mechanism is used to signal the processor/kernel that a system
> call has been invoked; on x86 it's something like instruction "int $0x80".
>
> thanks,
> -bp
> --
> # Software Development, WatchGuard Inc.
> # Projects, PGP key at http://www.terran.org/~bryan
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Understanding Alpha syscalls
1999-06-02 21:53 ` Uncle George
@ 1999-06-02 21:57 ` B. James Phillippe
0 siblings, 0 replies; 5+ messages in thread
From: B. James Phillippe @ 1999-06-02 21:57 UTC (permalink / raw)
To: Uncle George; +Cc: axp-list
On Wed, 2 Jun 1999, Uncle George wrote:
> most of all the syscall interpretation is done in the assembler file entry.S
> in arch/alpha/kernel. if u know ur syscall #, u can look it up at
> sys_call_table: + offset(syscall #).
> hope this helps.
> gat
I've looked over it several times already; all I see is that sys_open is
call number 45 (IIRC) in the table (osf_open is 5, IIRC, and on the x86
sys_open is 5 as well). But I can't find the definition of sys_open
itself. I can find the definitions of other syscalls, but not this one.
Have any ideas?
thanks,
-bp
--
# Software Development, WatchGuard Inc.
# Projects, PGP key at http://www.terran.org/~bryan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Understanding Alpha syscalls
[not found] <3755D3D2.7AA140BE@voicenet.com>
@ 1999-06-03 2:15 ` B. James Phillippe
1999-06-03 6:53 ` Richard Henderson
0 siblings, 1 reply; 5+ messages in thread
From: B. James Phillippe @ 1999-06-03 2:15 UTC (permalink / raw)
To: Uncle George; +Cc: AXP list
On Wed, 2 Jun 1999, Uncle George wrote:
> u mean u cant "find /usr/src/linux -type f -exec grep -l sys_open {} \;"
> for sys_open in fs/open.c ?
> gat
I did find it there, but I didn't understand the mapping between the
assembly and the C... maybe you can help me. Confirm if I understand it
correctly now:
1.) "open" called from user-space program.
2.) "open" defined in some way within libc such that it uses the syscall2
(or 3) macro defined by <asm/unistd.h>. ?
3.) syscallx expands to an assembly function which calls the PALcode with
"callsys" with the appropriate __NR_sycallname and arguments (I am an
assembly newbie and I know nothing of PAL).
4.) kernel has registered (at bootup, in trap_init()) that the routine
"entSys" is to be called by the PALcode for system calls. ?
5.) PALcode traps into kernel to execute the asm routine entSys. ?
6.) entSys runs the function in the sys_call_table at the offset X, where X
was the name of the __NR_syscallname (which is actuallly a number). ?
7.) the function in the sys_call_table can be a straight C-code routine,
such as the one you pointed out is in fs/open.c for sys_open.
8.) when the function returns, the stack is unwound and the rest of the
entSys stuff is done, including passing the return value back up to
user-space. ?
Is this right?
thanks for the help,
-bp
--
# Software Development, WatchGuard Inc.
# Projects, PGP key at http://www.terran.org/~bryan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Understanding Alpha syscalls
1999-06-03 2:15 ` Understanding Alpha syscalls B. James Phillippe
@ 1999-06-03 6:53 ` Richard Henderson
0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 1999-06-03 6:53 UTC (permalink / raw)
To: axp-list, Uncle George
On Wed, Jun 02, 1999 at 07:15:39PM -0700, B. James Phillippe wrote:
> 8.) when the function returns, the stack is unwound and the rest of the
> entSys stuff is done, including passing the return value back up to
> user-space. ?
>
> Is this right?
Yes.
r~
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-06-03 7:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3755D3D2.7AA140BE@voicenet.com>
1999-06-03 2:15 ` Understanding Alpha syscalls B. James Phillippe
1999-06-03 6:53 ` Richard Henderson
1999-06-02 20:55 B. James Phillippe
1999-06-02 21:53 ` Uncle George
1999-06-02 21:57 ` B. James Phillippe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox