Commit 82ec2f0a authored by 李文轩's avatar 李文轩 :baseball:
Browse files

ssssss

parent d7ae7a7e
No related merge requests found
Showing with 127 additions and 117 deletions
+127 -117
{
"files.associations": {
"*.c": "c",
"syscall.h": "c",
"sysnum.h": "c"
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -11,7 +11,7 @@
#define SYS_exec 7
#define SYS_fstat 8
#define SYS_chdir 9
#define SYS_dup 10
#define SYS_dup 23
#define SYS_getpid 11
#define SYS_sbrk 12
#define SYS_sleep 13
......@@ -24,7 +24,7 @@
#define SYS_mkdir 20
#define SYS_close 21
#define SYS_test_proc 22
#define SYS_dev 23
#define SYS_dev 123
#define SYS_readdir 24
#define SYS_getcwd 25
#define SYS_rename 26
......
......@@ -144,6 +144,7 @@ static uint64 (*syscalls[])(void) = {
[SYS_trace] sys_trace,
[SYS_sysinfo] sys_sysinfo,
[SYS_rename] sys_rename,
// [SYS_shutdown] sys_shutdown,
};
static char *sysnames[] = {
......@@ -173,6 +174,7 @@ static char *sysnames[] = {
[SYS_trace] "trace",
[SYS_sysinfo] "sysinfo",
[SYS_rename] "rename",
// [SYS_shutdown] "shutdown",
};
void
......@@ -182,7 +184,8 @@ syscall(void)
struct proc *p = myproc();
num = p->trapframe->a7;
if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
// printf("num=%d name=%s\n", num, sysnames[num]);
if(num > 0 && syscalls[num]) {
p->trapframe->a0 = syscalls[num]();
// trace
if ((p->tmask & (1 << num)) != 0) {
......
No preview for this file type
......@@ -24,10 +24,10 @@ char *argv[] = {0};
char *tests[] = {
// "sh",
"brk",
// "brk",
// "chdir",
// "close",
// "dup",
"dup",
// "exit",
// "fork",
// "fstat",
......@@ -44,7 +44,7 @@ char *tests[] = {
// "write",
// "sleep",
// "clone",
};
};
int counts = sizeof(tests) / sizeof((tests)[0]);
int main(void) {
int pid, wpid;
......
Supports Markdown
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