Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pintos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Project Purple Stallion
Pintos
Commits
69dafab7
Commit
69dafab7
authored
5 years ago
by
ja3-saxby
Browse files
Options
Downloads
Patches
Plain Diff
Add skeleton of new write system call
parent
161a585e
No related branches found
No related tags found
2 merge requests
!22
Merge Feature/system calls
,
!10
Implement the write() system call
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile.build
+1
-0
1 addition, 0 deletions
Makefile.build
userprog/syscall.c
+3
-1
3 additions, 1 deletion
userprog/syscall.c
userprog/syscall_write.c
+12
-0
12 additions, 0 deletions
userprog/syscall_write.c
userprog/system_calls.h
+7
-0
7 additions, 0 deletions
userprog/system_calls.h
with
23 additions
and
1 deletion
Makefile.build
+
1
−
0
View file @
69dafab7
...
...
@@ -67,6 +67,7 @@ userprog_SRC += userprog/syscall_exit.c
userprog_SRC
+=
userprog/syscall_halt.c
userprog_SRC
+=
userprog/syscall_wait.c
userprog_SRC
+=
userprog/syscall_create.c
userprog_SRC
+=
userprog/syscall_write.c
# No virtual memory code yet.
#vm_SRC = vm/file.c # Some file.
...
...
This diff is collapsed.
Click to expand it.
userprog/syscall.c
+
3
−
1
View file @
69dafab7
...
...
@@ -70,9 +70,11 @@ syscall_handler (struct intr_frame *f UNUSED)
case
SYSCALL_CREATE
:
syscall_create
(
f
);
break
;
case
SYSCALL_WRITE
:
syscall_write
(
f
);
break
;
default:
printf
(
"WARNING: Invalid Syscall (%d)
\n
"
,
syscall_number
);
thread_exit
();
}
// TODO: remove this call to exit as we don't want all syscalls to make the thread exit
}
This diff is collapsed.
Click to expand it.
userprog/syscall_write.c
0 → 100644
+
12
−
0
View file @
69dafab7
/*
* The Write System Call
*
* Authored by Joshua Saxby
*/
#include
"system_calls.h"
#include
"threads/interrupt.h"
void
syscall_write
(
struct
intr_frame
*
f
)
{
// TODO: implement me!
(
void
*
)
0
;
}
This diff is collapsed.
Click to expand it.
userprog/system_calls.h
+
7
−
0
View file @
69dafab7
...
...
@@ -35,6 +35,13 @@ void syscall_wait(struct intr_frame *f);
*/
void
syscall_create
(
struct
intr_frame
*
f
);
/*
* Writes size bytes from buffer to the open file fd.
* Returns the number of bytes actually written, which may be less than size if
* some bytes could not be written.
*/
void
syscall_write
(
struct
intr_frame
*
f
);
/*
* NOTE: There are more system calls implemented by Pintos but we are not
* implementing them because the assignment brief does not ask of it.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment