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
10183_BOOT
OSKernel2024-10183_BOOT
Commits
632e6770
Commit
632e6770
authored
1 year ago
by
¨Pei
Browse files
Options
Download
Patches
Plain Diff
add mmap unmmap
parent
eab779dc
kernel_thread
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
Makefile
+1
-0
Makefile
kernel/syscall.c
+5
-0
kernel/syscall.c
kernel/syscall.h
+2
-0
kernel/syscall.h
kernel/sysproc.c
+15
-0
kernel/sysproc.c
user/user.h
+2
-0
user/user.h
user/usys.pl
+2
-0
user/usys.pl
with
27 additions
and
0 deletions
+27
-0
Makefile
+
1
−
0
View file @
632e6770
...
...
@@ -175,6 +175,7 @@ UPROGS=\
$U
/_grind
\
$U
/_wc
\
$U
/_zombie
\
$U
/_mmaptest
\
...
...
This diff is collapsed.
Click to expand it.
kernel/syscall.c
+
5
−
0
View file @
632e6770
...
...
@@ -104,6 +104,8 @@ extern uint64 sys_unlink(void);
extern
uint64
sys_wait
(
void
);
extern
uint64
sys_write
(
void
);
extern
uint64
sys_uptime
(
void
);
extern
uint64
sys_mmap
(
void
);
extern
uint64
sys_munmap
(
void
);
static
uint64
(
*
syscalls
[])(
void
)
=
{
[
SYS_fork
]
sys_fork
,
...
...
@@ -127,6 +129,9 @@ static uint64 (*syscalls[])(void) = {
[
SYS_link
]
sys_link
,
[
SYS_mkdir
]
sys_mkdir
,
[
SYS_close
]
sys_close
,
[
SYS_mmap
]
sys_mmap
,
[
SYS_munmap
]
sys_munmap
,
};
void
...
...
This diff is collapsed.
Click to expand it.
kernel/syscall.h
+
2
−
0
View file @
632e6770
...
...
@@ -20,3 +20,5 @@
#define SYS_link 19
#define SYS_mkdir 20
#define SYS_close 21
#define SYS_mmap 22
#define SYS_munmap 23
\ No newline at end of file
This diff is collapsed.
Click to expand it.
kernel/sysproc.c
+
15
−
0
View file @
632e6770
...
...
@@ -95,3 +95,18 @@ sys_uptime(void)
release
(
&
tickslock
);
return
xticks
;
}
uint64
sys_mmap
(
void
)
{
return
0
;
}
uint64
sys_munmap
(
void
)
{
return
0
;
}
This diff is collapsed.
Click to expand it.
user/user.h
+
2
−
0
View file @
632e6770
...
...
@@ -23,6 +23,8 @@ int getpid(void);
char
*
sbrk
(
int
);
int
sleep
(
int
);
int
uptime
(
void
);
char
*
mmap
(
char
*
addr
,
int
len
,
int
prot
,
int
flags
,
int
fd
,
int
off
);
int
munmap
(
char
*
addr
,
int
len
);
// ulib.c
int
stat
(
const
char
*
,
struct
stat
*
);
...
...
This diff is collapsed.
Click to expand it.
user/usys.pl
+
2
−
0
View file @
632e6770
...
...
@@ -36,3 +36,5 @@ entry("getpid");
entry
("
sbrk
");
entry
("
sleep
");
entry
("
uptime
");
entry
("
mmap
");
entry
("
munmap
");
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