Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
OS_XV6
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9631059
OS_XV6
Commits
30dd6b34
Commit
30dd6b34
authored
Dec 11, 2019
by
Amir Hosein Kashani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start of 2.1
parent
a4c94803
Pipeline
#1536
failed with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
2 deletions
+41
-2
Makefile
Makefile
+4
-1
syscall.c
syscall.c
+2
-0
syscall.h
syscall.h
+1
-0
sysproc.c
sysproc.c
+20
-1
test.c
test.c
+10
-0
user.h
user.h
+3
-0
usys.S
usys.S
+1
-0
No files found.
Makefile
View file @
30dd6b34
...
...
@@ -27,6 +27,8 @@ OBJS = \
uart.o
\
vectors.o
\
vm.o
\
# Cross-compiling (e.g., on Mac OS X)
# TOOLPREFIX = i386-jos-elf
...
...
@@ -181,6 +183,7 @@ UPROGS=\
_usertests
\
_wc
\
_zombie
\
_test
\
fs.img
:
mkfs README $(UPROGS)
./mkfs fs.img README
$(UPROGS)
...
...
@@ -249,7 +252,7 @@ qemu-nox-gdb: fs.img xv6.img .gdbinit
EXTRA
=
\
mkfs.c ulib.c user.h cat.c echo.c forktest.c grep.c kill.c
\
ln.c ls.c mkdir.c rm.c stressfs.c usertests.c wc.c zombie.c
\
ln.c ls.c mkdir.c rm.c stressfs.c usertests.c wc.c zombie.c
\
t
est.c
\
printf.c umalloc.c
\
README dot-bochsrc
*
.pl toc.
*
runoff runoff1 runoff.list
\
.gdbinit.tmpl gdbutil
\
...
...
syscall.c
View file @
30dd6b34
...
...
@@ -103,6 +103,7 @@ extern int sys_unlink(void);
extern
int
sys_wait
(
void
);
extern
int
sys_write
(
void
);
extern
int
sys_uptime
(
void
);
extern
int
sys_getChildren
(
void
);
static
int
(
*
syscalls
[])(
void
)
=
{
[
SYS_fork
]
sys_fork
,
...
...
@@ -126,6 +127,7 @@ static int (*syscalls[])(void) = {
[
SYS_link
]
sys_link
,
[
SYS_mkdir
]
sys_mkdir
,
[
SYS_close
]
sys_close
,
[
SYS_getChildren
]
sys_getChildren
,
};
void
...
...
syscall.h
View file @
30dd6b34
...
...
@@ -20,3 +20,4 @@
#define SYS_link 19
#define SYS_mkdir 20
#define SYS_close 21
#define SYS_getChildren 22
sysproc.c
View file @
30dd6b34
...
...
@@ -10,7 +10,10 @@
int
sys_fork
(
void
)
{
return
fork
();
int
dadPid
=
pid
;
int
pidChild
=
fork
();
return
}
int
...
...
@@ -89,3 +92,19 @@ sys_uptime(void)
release
(
&
tickslock
);
return
xticks
;
}
//my implimentation
int
sys_getChildren
(
void
)
{
return
120
;
}
test.c
0 → 100644
View file @
30dd6b34
#include "types.h"
#include "stat.h"
#include "user.h"
int
main
(
void
)
{
printf
(
1
,
"My first xv6 program
\n
"
);
exit
();
}
user.h
View file @
30dd6b34
...
...
@@ -23,6 +23,9 @@ int getpid(void);
char
*
sbrk
(
int
);
int
sleep
(
int
);
int
uptime
(
void
);
int
getChildren
(
void
);
// ulib.c
int
stat
(
const
char
*
,
struct
stat
*
);
...
...
usys.S
View file @
30dd6b34
...
...
@@ -29,3 +29,4 @@ SYSCALL(getpid)
SYSCALL(sbrk)
SYSCALL(sleep)
SYSCALL(uptime)
SYSCALL(getChildren)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment