Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Close and Exit in sysdep.cc and syscall.cc

0 views
Skip to first unread message

Stuart Todd Rader

unread,
Oct 26, 1996, 3:00:00 AM10/26/96
to

I edited my Makefile.common to include syscall.cc and syscall.h
in the build process. When I did so, nachos wouldn't link because
Close and Exec were both defined in syscall.o and sysdep.o.

Did I do something wrong by adding syscall to Makefile.common?

If so, how do the syscall symbols get put into nachos?

For now, I redefined the symbols in syscall to be SCClose and
SCExit, respectively, just to get me past this problem.

Jiun-Kuei Jung

unread,
Oct 28, 1996, 3:00:00 AM10/28/96
to

Stuart Todd Rader wrote:
>
> I edited my Makefile.common to include syscall.cc and syscall.h
> in the build process. When I did so, nachos wouldn't link because
> Close and Exec were both defined in syscall.o and sysdep.o.
>
> Did I do something wrong by adding syscall to Makefile.common?

Yes, syscall.h should not be included in Makefile.common. It is a
header file for user programs. Those syscall subroutines are not
used by nachos kernel, instead, syscalls are implemented inside
exception handler. Syscalls invoked by user programs will be compiled
into assembly code like :

mov r2, <syscall_#> // eg. SC_Halt, SC_Exit, ... (defined in syscall.h)
mov r4, arg1
mov r5, arg2 // r# are MIPS registers
mov r6, arg3 // arg# are arguments passed to the syscall
mov r7, arg4
syscall // exception

> If so, how do the syscall symbols get put into nachos?
>
> For now, I redefined the symbols in syscall to be SCClose and
> SCExit, respectively, just to get me past this problem.

Just remove syscall.h from Makefile.common !

--
Jiun-Kuei Jung
jkj...@leland.stanford.edu

0 new messages