Commit 30dd6b34 authored by Amir Hosein Kashani's avatar Amir Hosein Kashani

start of 2.1

parent a4c94803
Pipeline #1536 failed with stages
...@@ -27,6 +27,8 @@ OBJS = \ ...@@ -27,6 +27,8 @@ OBJS = \
uart.o\ uart.o\
vectors.o\ vectors.o\
vm.o\ vm.o\
# Cross-compiling (e.g., on Mac OS X) # Cross-compiling (e.g., on Mac OS X)
# TOOLPREFIX = i386-jos-elf # TOOLPREFIX = i386-jos-elf
...@@ -181,6 +183,7 @@ UPROGS=\ ...@@ -181,6 +183,7 @@ UPROGS=\
_usertests\ _usertests\
_wc\ _wc\
_zombie\ _zombie\
_test\
fs.img: mkfs README $(UPROGS) fs.img: mkfs README $(UPROGS)
./mkfs fs.img README $(UPROGS) ./mkfs fs.img README $(UPROGS)
...@@ -249,7 +252,7 @@ qemu-nox-gdb: fs.img xv6.img .gdbinit ...@@ -249,7 +252,7 @@ qemu-nox-gdb: fs.img xv6.img .gdbinit
EXTRA=\ EXTRA=\
mkfs.c ulib.c user.h cat.c echo.c forktest.c grep.c kill.c\ 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\test.c\
printf.c umalloc.c\ printf.c umalloc.c\
README dot-bochsrc *.pl toc.* runoff runoff1 runoff.list\ README dot-bochsrc *.pl toc.* runoff runoff1 runoff.list\
.gdbinit.tmpl gdbutil\ .gdbinit.tmpl gdbutil\
......
...@@ -103,6 +103,7 @@ extern int sys_unlink(void); ...@@ -103,6 +103,7 @@ extern int sys_unlink(void);
extern int sys_wait(void); extern int sys_wait(void);
extern int sys_write(void); extern int sys_write(void);
extern int sys_uptime(void); extern int sys_uptime(void);
extern int sys_getChildren(void);
static int (*syscalls[])(void) = { static int (*syscalls[])(void) = {
[SYS_fork] sys_fork, [SYS_fork] sys_fork,
...@@ -126,6 +127,7 @@ static int (*syscalls[])(void) = { ...@@ -126,6 +127,7 @@ static int (*syscalls[])(void) = {
[SYS_link] sys_link, [SYS_link] sys_link,
[SYS_mkdir] sys_mkdir, [SYS_mkdir] sys_mkdir,
[SYS_close] sys_close, [SYS_close] sys_close,
[SYS_getChildren] sys_getChildren,
}; };
void void
......
...@@ -20,3 +20,4 @@ ...@@ -20,3 +20,4 @@
#define SYS_link 19 #define SYS_link 19
#define SYS_mkdir 20 #define SYS_mkdir 20
#define SYS_close 21 #define SYS_close 21
#define SYS_getChildren 22
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
int int
sys_fork(void) sys_fork(void)
{ {
return fork(); int dadPid = pid;
int pidChild = fork();
return
} }
int int
...@@ -89,3 +92,19 @@ sys_uptime(void) ...@@ -89,3 +92,19 @@ sys_uptime(void)
release(&tickslock); release(&tickslock);
return xticks; return xticks;
} }
//my implimentation
int
sys_getChildren(void)
{
return 120;
}
#include "types.h"
#include "stat.h"
#include "user.h"
int
main(void)
{
printf(1, "My first xv6 program\n");
exit();
}
...@@ -23,6 +23,9 @@ int getpid(void); ...@@ -23,6 +23,9 @@ int getpid(void);
char* sbrk(int); char* sbrk(int);
int sleep(int); int sleep(int);
int uptime(void); int uptime(void);
int getChildren(void);
// ulib.c // ulib.c
int stat(const char*, struct stat*); int stat(const char*, struct stat*);
......
...@@ -29,3 +29,4 @@ SYSCALL(getpid) ...@@ -29,3 +29,4 @@ SYSCALL(getpid)
SYSCALL(sbrk) SYSCALL(sbrk)
SYSCALL(sleep) SYSCALL(sleep)
SYSCALL(uptime) SYSCALL(uptime)
SYSCALL(getChildren)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment