From 9110f40b7d65e7090b6214fd5db4814693b2e635 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 2 Aug 2019 13:18:26 -0400 Subject: [PATCH] sigalarm --- labs/syscall.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/labs/syscall.html b/labs/syscall.html index 72ef19b..9a24a7c 100644 --- a/labs/syscall.html +++ b/labs/syscall.html @@ -143,12 +143,12 @@ void test0() { int i; printf(1, "test0 start\n"); - alarm(2, periodic); + sigalarm(2, periodic); for(i = 0; i < 1000*500000; i++){ if((i % 250000) == 0) write(2, ".", 1); } - alarm(0, 0); + sigalarm(0, 0); printf(1, "test0 done\n"); } @@ -171,7 +171,7 @@ void test1() { printf(1, "test1 start\n"); j = 0; - alarm(2, periodic); + sigalarm(2, periodic); for(i = 0; i < 1000*500000; i++){ foo(i, &j); } @@ -237,13 +237,14 @@ alarmtest starting
  • You'll need to modify the Makefile to cause alarmtest.c to be compiled as an xv6 user program. -
  • The right declaration to put in user/user.h is: +
  • The right declarations to put in user/user.h is:
         int sigalarm(int ticks, void (*handler)());
     
    -
  • Update kernel/syscall.h and user/usys.S (update usys.pl to update - usys.S) to allow alarmtest to invoke the sigalarm system +
  • Update user/sys.pl (which generates user/usys.S), + kernel/syscall.h, and kernel/syscall.c + to allow alarmtest to invoke the sigalarm system call.
  • Your sys_sigalarm() should store the alarm interval and