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

38
code/userprog/ksyscall.h Normal file
View File

@@ -0,0 +1,38 @@
/**************************************************************
*
* userprog/ksyscall.h
*
* Kernel interface for systemcalls
*
* by Marcus Voelp (c) Universitaet Karlsruhe
*
**************************************************************/
#ifndef __USERPROG_KSYSCALL_H__
#define __USERPROG_KSYSCALL_H__
#include "kernel.h"
#include "synchconsole.h"
void SysHalt()
{
kernel->interrupt->Halt();
}
int SysAdd(int op1, int op2)
{
return op1 + op2;
}
int SysCreate(char *filename)
{
// return value
// 1: success
// 0: failed
return kernel->interrupt->CreateFile(filename);
}
#endif /* ! __USERPROG_KSYSCALL_H__ */