forked from leduythuccs/nachos-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement syscall handlers (b), increase PC on syscall (c)
Add `handle_not_implemented_SC()` to handle all syscalls that have not yet implemented. That method will write debug log and increase the program counter. Now user test programs don't need to call Halt() at the end of the program.
- Loading branch information
1 parent
5f450e9
commit 405be5b
Showing
5 changed files
with
110 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ cd code/test | |
make | ||
|
||
../build.linux/nachos -x halt | ||
../build.linux/nachos -x test_syscall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* test_syscall.c | ||
* Simple program to test whether the systemcall interface works. | ||
*/ | ||
|
||
#include "syscall.h" | ||
|
||
int main() { | ||
int result = Add(1, 2); | ||
/* Don't need to Halt() anymore because the PC will increase automatically | ||
*/ | ||
result = Add(2, 3); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters