Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
9b37d1bf
提交
9b37d1bf
7月 16, 2006
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add user.h for prototypes.
Add cons_puts for cleaner output.
上级
b903b693
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
40 行增加
和
6 行删除
+40
-6
ulib.c
ulib.c
+8
-0
user.h
user.h
+15
-0
user1.c
user1.c
+4
-2
userfs.c
userfs.c
+4
-0
usertests.c
usertests.c
+8
-4
usys.S
usys.S
+1
-0
没有找到文件。
ulib.c
浏览文件 @
9b37d1bf
#include "user.h"
int
puts
(
char
*
s
)
{
return
cons_puts
(
s
);
}
int
puts1
(
char
*
s
)
{
int
i
;
for
(
i
=
0
;
s
[
i
];
i
++
)
...
...
user.h
0 → 100644
浏览文件 @
9b37d1bf
int
fork
(
void
);
int
exit
(
void
)
__attribute__
((
noreturn
));
int
wait
(
void
);
int
cons_putc
(
int
);
int
pipe
(
int
*
);
int
write
(
int
,
void
*
,
int
);
int
read
(
int
,
void
*
,
int
);
int
close
(
int
);
int
block
(
void
);
int
kill
(
int
);
int
panic
(
char
*
);
int
cons_puts
(
char
*
);
int
puts
(
char
*
);
int
puts1
(
char
*
);
user1.c
浏览文件 @
9b37d1bf
#include "user.h"
char
buf
[
32
];
int
main
()
{
int
pid
,
fds
[
2
],
n
;
...
...
@@ -15,6 +18,5 @@ main()
puts
(
buf
);
puts
(
"
\n
"
);
}
while
(
1
)
;
for
(;;);
}
userfs.c
浏览文件 @
9b37d1bf
#include "user.h"
// file system tests
char
buf
[
1024
];
int
main
()
{
puts
(
"userfs running
\n
"
);
block
();
return
0
;
}
usertests.c
浏览文件 @
9b37d1bf
#include "user.h"
char
buf
[
2048
];
// simple fork and pipe read/write
...
...
@@ -17,10 +19,10 @@ pipe1()
buf
[
i
]
=
seq
++
;
if
(
write
(
fds
[
1
],
buf
,
1033
)
!=
1033
){
panic
(
"pipe1 oops 1
\n
"
);
exit
(
1
);
exit
();
}
}
exit
(
0
);
exit
();
}
else
{
close
(
fds
[
1
]);
total
=
0
;
...
...
@@ -109,12 +111,13 @@ exitwait()
return
;
}
}
else
{
exit
(
0
);
exit
();
}
}
puts
(
"exitwait ok
\n
"
);
}
int
main
()
{
puts
(
"usertests starting
\n
"
);
...
...
@@ -123,5 +126,6 @@ main()
preempt
();
exitwait
();
panic
(
"usertests finished successfuly"
);
panic
(
"usertests succeeded"
);
return
0
;
}
usys.S
浏览文件 @
9b37d1bf
...
...
@@ -19,3 +19,4 @@ STUB(close)
STUB(block)
STUB(kill)
STUB(panic)
STUB(cons_puts)
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论