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
educg-net-28665-2608131
OSKernel2024-MikuOS-1361
Commits
a0d2f4d2
Commit
a0d2f4d2
authored
5 months ago
by
Shetty Yttehs
Browse files
Options
Download
Patches
Plain Diff
chore: dummy implement syscall mount/umount
parent
1783f926
main
doc
ext4-fs
submit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
kernel/src/main.rs
+2
-2
kernel/src/main.rs
kernel/src/syscall/fs.rs
+10
-0
kernel/src/syscall/fs.rs
kernel/src/syscall/mod.rs
+4
-0
kernel/src/syscall/mod.rs
with
16 additions
and
2 deletions
+16
-2
kernel/src/main.rs
+
2
−
2
View file @
a0d2f4d2
...
...
@@ -58,13 +58,13 @@ fn run_test() -> ! {
"getcwd"
,
// "munmap",
"pipe"
,
//
"umount",
"umount"
,
"close"
,
"getppid"
,
"chdir"
,
"open"
,
// "clone",
//
"mount",
"mount"
,
"exit"
,
"sleep"
,
// "mmap",
...
...
This diff is collapsed.
Click to expand it.
kernel/src/syscall/fs.rs
+
10
−
0
View file @
a0d2f4d2
...
...
@@ -132,3 +132,13 @@ pub fn sys_pipe(pipe_ptr: *mut i32) -> isize {
}
0
}
pub
fn
sys_mount
(
_source_ptr
:
*
const
u8
,
_target_ptr
:
*
const
u8
,
_fs_type_ptr
:
*
const
u8
)
->
isize
{
// unsupported for rust-fatfs
0
}
pub
fn
sys_umount
(
_target_ptr
:
*
const
u8
)
->
isize
{
// unsupported for rust-fatfs
0
}
This diff is collapsed.
Click to expand it.
kernel/src/syscall/mod.rs
+
4
−
0
View file @
a0d2f4d2
...
...
@@ -24,6 +24,8 @@ const SYSCALL_CLOSE: usize = 57;
const
SYSCALL_MKDIR
:
usize
=
34
;
const
SYSCALL_PIPE
:
usize
=
59
;
const
SYSCALL_NANO_SLEEP
:
usize
=
101
;
const
SYSCALL_MOUNT
:
usize
=
40
;
const
SYSCALL_UMOUNT
:
usize
=
39
;
pub
fn
syscall
(
id
:
usize
,
args
:
[
usize
;
6
])
->
isize
{
match
id
{
...
...
@@ -45,6 +47,8 @@ pub fn syscall(id: usize, args: [usize; 6]) -> isize {
SYSCALL_MKDIR
=>
sys_mkdir
(
args
[
0
],
args
[
1
]
as
*
const
u8
,
args
[
2
]),
SYSCALL_PIPE
=>
sys_pipe
(
args
[
0
]
as
*
mut
i32
),
SYSCALL_NANO_SLEEP
=>
sys_nanosleep
(
args
[
0
]
as
*
const
u8
,
args
[
1
]),
SYSCALL_MOUNT
=>
sys_mount
(
args
[
0
]
as
*
const
u8
,
args
[
1
]
as
*
const
u8
,
args
[
2
]
as
*
const
u8
),
SYSCALL_UMOUNT
=>
sys_umount
(
args
[
0
]
as
*
const
u8
),
_
=>
{
error!
(
"Unsupported syscall id: {}"
,
id
);
sys_exit
(
-
1
);
...
...
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