Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
rcore-os
RCore Tutorial V3
提交
f5c029d3
R
RCore Tutorial V3
项目概览
rcore-os
/
RCore Tutorial V3
上一次同步 1 年多
通知
15
Star
793
Fork
260
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RCore Tutorial V3
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f5c029d3
编写于
12月 11, 2020
作者:
Y
Yifan Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
k210 only can use 6M before configuring sdcard.
上级
84b10893
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
11 addition
and
13 deletion
+11
-13
os/src/config.rs
os/src/config.rs
+2
-2
user/src/bin/forktest.rs
user/src/bin/forktest.rs
+1
-1
user/src/bin/forktest2.rs
user/src/bin/forktest2.rs
+5
-7
user/src/bin/forktree.rs
user/src/bin/forktree.rs
+1
-1
user/src/bin/matrix.rs
user/src/bin/matrix.rs
+1
-1
user/src/bin/user_shell.rs
user/src/bin/user_shell.rs
+1
-1
未找到文件。
os/src/config.rs
浏览文件 @
f5c029d3
pub
const
USER_STACK_SIZE
:
usize
=
4096
*
2
;
pub
const
KERNEL_STACK_SIZE
:
usize
=
4096
*
2
;
pub
const
KERNEL_HEAP_SIZE
:
usize
=
0x
3
0_0000
;
pub
const
MEMORY_END
:
usize
=
0x80
8
00000
;
pub
const
KERNEL_HEAP_SIZE
:
usize
=
0x
2
0_0000
;
pub
const
MEMORY_END
:
usize
=
0x80
6
00000
;
pub
const
PAGE_SIZE
:
usize
=
0x1000
;
pub
const
PAGE_SIZE_BITS
:
usize
=
0xc
;
...
...
user/src/bin/forktest.rs
浏览文件 @
f5c029d3
...
...
@@ -6,7 +6,7 @@ extern crate user_lib;
use
user_lib
::{
fork
,
wait
,
exit
};
const
MAX_CHILD
:
usize
=
2
0
;
const
MAX_CHILD
:
usize
=
4
0
;
#[no_mangle]
pub
fn
main
()
->
i32
{
...
...
user/src/bin/forktest2.rs
浏览文件 @
f5c029d3
...
...
@@ -4,9 +4,9 @@
#[macro_use]
extern
crate
user_lib
;
use
user_lib
::{
fork
,
wait
,
get
_time
,
getpid
,
exit
,
yield_
,
};
use
user_lib
::{
fork
,
wait
,
get
pid
,
exit
,
sleep
,
get_time
};
static
NUM
:
usize
=
13
;
static
NUM
:
usize
=
30
;
#[no_mangle]
pub
fn
main
()
->
i32
{
...
...
@@ -15,11 +15,9 @@ pub fn main() -> i32 {
if
pid
==
0
{
let
current_time
=
get_time
();
let
sleep_length
=
(
current_time
as
i32
as
isize
)
*
(
current_time
as
i32
as
isize
)
%
1000
+
1000
;
println!
(
"Subprocess {} sleep for {} ms"
,
getpid
(),
sleep_length
);
while
get_time
()
<
current_time
+
sleep_length
{
yield_
();
}
println!
(
"Subprocess {} OK!"
,
getpid
());
println!
(
"pid {} sleep for {} ms"
,
getpid
(),
sleep_length
);
sleep
(
sleep_length
as
usize
);
println!
(
"pid {} OK!"
,
getpid
());
exit
(
0
);
}
}
...
...
user/src/bin/forktree.rs
浏览文件 @
f5c029d3
...
...
@@ -6,7 +6,7 @@ extern crate user_lib;
use
user_lib
::{
sleep
,
getpid
,
fork
,
exit
,
yield_
};
const
DEPTH
:
usize
=
3
;
const
DEPTH
:
usize
=
4
;
fn
fork_child
(
cur
:
&
str
,
branch
:
char
)
{
let
mut
next
=
[
0u8
;
DEPTH
+
1
];
...
...
user/src/bin/matrix.rs
浏览文件 @
f5c029d3
...
...
@@ -6,7 +6,7 @@ extern crate user_lib;
use
user_lib
::{
fork
,
wait
,
yield_
,
exit
,
getpid
,
get_time
};
static
NUM
:
usize
=
20
;
static
NUM
:
usize
=
35
;
const
N
:
usize
=
10
;
static
P
:
i32
=
10007
;
type
Arr
=
[[
i32
;
N
];
N
];
...
...
user/src/bin/user_shell.rs
浏览文件 @
f5c029d3
...
...
@@ -32,7 +32,7 @@ pub fn main() -> i32 {
// child process
if
exec
(
line
.as_str
())
==
-
1
{
println!
(
"Error when executing!"
);
return
0
;
return
-
4
;
}
unreachable!
();
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录