init: init nachos hw01, should pass jenkins os_group_20_hw job but fail on os_group_20_ta job

This commit is contained in:
TA
2024-09-19 18:59:13 +08:00
commit 6ad2fa368f
267 changed files with 71977 additions and 0 deletions

20
code/test/halt.c Normal file
View File

@@ -0,0 +1,20 @@
/* halt.c
* Simple program to test whether running a user program works.
*
* Just do a "syscall" that shuts down the OS.
*
* NOTE: for some reason, user programs with global data structures
* sometimes haven't worked in the Nachos environment. So be careful
* out there! One option is to allocate data structures as
* automatics within a procedure, but if you do this, you have to
* be careful to allocate a big enough stack to hold the automatics!
*/
#include "syscall.h"
int
main()
{
Halt();
/* not reached */
}