diff --git a/Makefile b/Makefile index c5335b8..ed77f93 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,6 @@ mkfs/mkfs: mkfs/mkfs.c $K/fs.h $K/param.h UPROGS=\ $U/_cat\ $U/_echo\ - $U/_hello\ $U/_forktest\ $U/_grep\ $U/_init\ @@ -137,7 +136,6 @@ UPROGS=\ $U/_zombie\ $U/_clear\ $U/_halt\ - $U/_reset\ fs.img: mkfs/mkfs README.md $(UPROGS) mkfs/mkfs fs.img README.md $(UPROGS) diff --git a/kernel/syscall.c b/kernel/syscall.c index da3ef63..a027276 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -103,7 +103,6 @@ extern u64 sys_mkdir(void); extern u64 sys_close(void); extern u64 sys_trace(void); extern u64 sys_halt(void); -extern u64 sys_reset(void); // An array mapping syscall numbers from syscall.h // to the function that handles the system call. @@ -113,7 +112,7 @@ static u64 (*syscalls[])(void) = { [SYS_chdir] = sys_chdir, [SYS_dup] = sys_dup, [SYS_getpid] = sys_getpid, [SYS_sbrk] = sys_sbrk, [SYS_sleep] = sys_sleep, [SYS_uptime] = sys_uptime, [SYS_open] = sys_open, [SYS_write] = sys_write, [SYS_mknod] = sys_mknod, [SYS_unlink] = sys_unlink, [SYS_link] = sys_link, [SYS_mkdir] = sys_mkdir, - [SYS_close] = sys_close, [SYS_trace] = sys_trace, [SYS_halt] = sys_halt, [SYS_reset] = sys_reset, + [SYS_close] = sys_close, [SYS_trace] = sys_trace, [SYS_halt] = sys_halt, }; void diff --git a/kernel/syscall.h b/kernel/syscall.h index e6bd0e4..0162584 100644 --- a/kernel/syscall.h +++ b/kernel/syscall.h @@ -24,4 +24,3 @@ #define SYS_close 21 #define SYS_trace 22 #define SYS_halt 23 -#define SYS_reset 24 diff --git a/kernel/sysproc.c b/kernel/sysproc.c index 954f48f..8c1f1d5 100644 --- a/kernel/sysproc.c +++ b/kernel/sysproc.c @@ -101,14 +101,5 @@ void sys_halt(void) { (*(volatile u32 *)QEMU_POWER) = 0x5555; - panic("sys_halt"); -} - -void -sys_reset(void) -{ - // TODO: Revisit and review - // asm volatile("j _entry"); - (*(volatile u32 *)QEMU_POWER) = 0x3333; - panic("sys_reset"); + panic("sys_poweroff"); } diff --git a/user/hello.c b/user/hello.c deleted file mode 100644 index d3717f3..0000000 --- a/user/hello.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "kernel/types.h" -#include "kernel/stat.h" -#include "user/user.h" - -int -main(int argc, char *argv[]) -{ - char hello[] = "Hello XV6!\n"; - - write(1, hello, sizeof(hello)); - - exit(0); -} diff --git a/user/reset.c b/user/reset.c deleted file mode 100644 index d6962e7..0000000 --- a/user/reset.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "user.h" - -/** Reset the machine */ -int -main(int argc, char *argv[]) -{ - printf("System resetting...\n"); - reset(); - return 0; -} diff --git a/user/user.h b/user/user.h index 17b053f..d889278 100644 --- a/user/user.h +++ b/user/user.h @@ -80,9 +80,6 @@ int trace(int); /** halt */ void halt(void); -/** halt */ -void reset(void); - /** * Library functions (ulib.c) */ diff --git a/user/usertests.c b/user/usertests.c index 5e6e4dc..a809516 100644 --- a/user/usertests.c +++ b/user/usertests.c @@ -239,7 +239,7 @@ copyinstr3(char *s) // See if the kernel refuses to read/write user memory that the // application doesn't have anymore, because it returned it. void -rwsbrk(char *unused) +rwsbrk() { int fd, n; diff --git a/user/usys.py b/user/usys.py index 01c25cd..f17f05d 100755 --- a/user/usys.py +++ b/user/usys.py @@ -40,7 +40,6 @@ syscalls = [ "uptime", "trace", "halt", - "reset", ] assembly = "\n\n".join(map(genstub, syscalls))