From: "B. James Phillippe" <bryan@terran.org>
To: Uncle George <gatgul@voicenet.com>
Cc: AXP list <axp-list@redhat.com>
Subject: Re: Understanding Alpha syscalls
Date: Wed, 2 Jun 1999 19:15:39 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.10.9906021845160.8557-100000@earth.terran.org> (raw)
In-Reply-To: <3755D3D2.7AA140BE@voicenet.com>
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
next parent reply other threads:[~1999-06-03 3:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3755D3D2.7AA140BE@voicenet.com>
1999-06-03 2:15 ` B. James Phillippe [this message]
1999-06-03 6:53 ` Understanding Alpha syscalls 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
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox