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.
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