-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#18] Implement halt system call #43
Conversation
src/userprog/syscall.c
Outdated
@@ -91,7 +92,7 @@ syscall_handler (struct intr_frame *f UNUSED) | |||
static void | |||
syscall_halt (void) | |||
{ | |||
|
|||
power_off(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use macro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See this.
src/userprog/syscall.c
Outdated
@@ -91,7 +92,7 @@ syscall_handler (struct intr_frame *f UNUSED) | |||
static void | |||
syscall_halt (void) | |||
{ | |||
|
|||
power_off(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing comment above this would be better.
11c3143
to
dd9694e
Compare
src/userprog/syscall.c
Outdated
@@ -88,10 +90,12 @@ syscall_handler (struct intr_frame *f UNUSED) | |||
} | |||
} | |||
|
|||
/* This syscall terminates pintos. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the format of other explanation comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault.
458f0d6
to
06746bf
Compare
src/userprog/syscall.c
Outdated
@@ -88,10 +90,12 @@ syscall_handler (struct intr_frame *f UNUSED) | |||
} | |||
} | |||
|
|||
/* Terminate pintos by calling built-in command. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whether calling built-in command or non-built-in command is not important. And other comments use terminates
, not terminate
I think. Check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Free the current process's resources. */
/* Create a minimal stack by mapping a zeroed page at the top of user virtual memory. */
/* Waits for thread TID to die and returns its exit status.
/* Starts a new thread running a user program loaded from
@hangpark
In process.c
, both appears. I didn't think much of it.
So you prefer -s on comments..? Then I'll follow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything would be ok, then. You can choose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use -s from now on then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I'll follow too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing commit title to implement halt system call
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation of halt system call, using function defined in init.h
This is your commit message.
- Where is comma?
- You should wrap paths, function names, file names, etc., with `.
threads/init.h
is better than init.h.- Which function? Specify it.
src/userprog/syscall.c
Outdated
@@ -88,10 +90,12 @@ syscall_handler (struct intr_frame *f UNUSED) | |||
} | |||
} | |||
|
|||
/* Terminate pintos by calling built-in command. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You said you will use -s
on verb. Why didn't this change yet? Also, by calling ~~~
is not needed I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote 'would not use' them...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to develop
please.
Implementation of `halt ()` system call, using `power_off ()` defined in `threads/init.h`.
Implementation of halt system call, using function defined in init.h.
shutdown_power_off()
is unavailable in our pintos.