Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
OSKernel2024-X
sss
Commits
82ec2f0a
Commit
82ec2f0a
authored
11 months ago
by
李文轩
Browse files
Options
Download
Patches
Plain Diff
ssssss
parent
d7ae7a7e
No related merge requests found
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
.vscode/settings.json
+7
-0
.vscode/settings.json
kernel/include/initcode.h
+111
-111
kernel/include/initcode.h
kernel/include/sysnum.h
+2
-2
kernel/include/sysnum.h
kernel/syscall.c
+4
-1
kernel/syscall.c
oo
+0
-0
oo
xv6-user/init.c
+3
-3
xv6-user/init.c
with
127 additions
and
117 deletions
+127
-117
.vscode/settings.json
0 → 100644
+
7
−
0
View file @
82ec2f0a
{
"files.associations"
:
{
"*.c"
:
"c"
,
"syscall.h"
:
"c"
,
"sysnum.h"
:
"c"
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
kernel/include/initcode.h
+
111
−
111
View file @
82ec2f0a
This diff is collapsed.
Click to expand it.
kernel/include/sysnum.h
+
2
−
2
View file @
82ec2f0a
...
...
@@ -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
1
23
#define SYS_readdir 24
#define SYS_getcwd 25
#define SYS_rename 26
...
...
This diff is collapsed.
Click to expand it.
kernel/syscall.c
+
4
−
1
View file @
82ec2f0a
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
oo
+
0
−
0
View file @
82ec2f0a
No preview for this file type
This diff is collapsed.
Click to expand it.
xv6-user/init.c
+
3
−
3
View file @
82ec2f0a
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets