Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
f1f8dd91
提交
f1f8dd91
8月 14, 2007
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
formatting
上级
29ff8d49
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
63 行增加
和
4 行删除
+63
-4
pipe.c
pipe.c
+2
-1
runoff
runoff
+43
-0
runoff.spec
runoff.spec
+11
-0
show1
show1
+3
-0
syscall.c
syscall.c
+1
-0
trap.c
trap.c
+3
-3
没有找到文件。
pipe.c
浏览文件 @
f1f8dd91
...
@@ -45,6 +45,7 @@ pipe_alloc(struct file **f0, struct file **f1)
...
@@ -45,6 +45,7 @@ pipe_alloc(struct file **f0, struct file **f1)
(
*
f1
)
->
writable
=
1
;
(
*
f1
)
->
writable
=
1
;
(
*
f1
)
->
pipe
=
p
;
(
*
f1
)
->
pipe
=
p
;
return
0
;
return
0
;
oops:
oops:
if
(
p
)
if
(
p
)
kfree
((
char
*
)
p
,
PAGE
);
kfree
((
char
*
)
p
,
PAGE
);
...
@@ -78,6 +79,7 @@ pipe_close(struct pipe *p, int writable)
...
@@ -78,6 +79,7 @@ pipe_close(struct pipe *p, int writable)
kfree
((
char
*
)
p
,
PAGE
);
kfree
((
char
*
)
p
,
PAGE
);
}
}
//PAGEBREAK: 20
int
int
pipe_write
(
struct
pipe
*
p
,
char
*
addr
,
int
n
)
pipe_write
(
struct
pipe
*
p
,
char
*
addr
,
int
n
)
{
{
...
@@ -117,7 +119,6 @@ pipe_read(struct pipe *p, char *addr, int n)
...
@@ -117,7 +119,6 @@ pipe_read(struct pipe *p, char *addr, int n)
}
}
sleep
(
&
p
->
readp
,
&
p
->
lock
);
sleep
(
&
p
->
readp
,
&
p
->
lock
);
}
}
for
(
i
=
0
;
i
<
n
;
i
++
){
for
(
i
=
0
;
i
<
n
;
i
++
){
if
(
p
->
readp
==
p
->
writep
)
if
(
p
->
readp
==
p
->
writep
)
break
;
break
;
...
...
runoff
浏览文件 @
f1f8dd91
...
@@ -35,6 +35,7 @@ pr -e8 -t runoff.list | awk '
...
@@ -35,6 +35,7 @@ pr -e8 -t runoff.list | awk '
close(f)
close(f)
n=$1
n=$1
printf("%02d %s\n", n/100, s);
printf("%02d %s\n", n/100, s);
printf("TOC: %04d %s\n", n, s) >"fmt/tocdata"
next
next
}
}
{
{
...
@@ -42,6 +43,48 @@ pr -e8 -t runoff.list | awk '
...
@@ -42,6 +43,48 @@ pr -e8 -t runoff.list | awk '
}'
|
pr
-3
-t
>>
fmt
/toc
}'
|
pr
-3
-t
>>
fmt
/toc
cat
toc.ftr
>>
fmt
/toc
cat
toc.ftr
>>
fmt
/toc
# check for bad alignments
perl
-e
'
while(<>){
chomp;
s!#.*!!;
s!\s+! !g;
s! +$!!;
next if /^$/;
if(/TOC: (\d+) (.*)/){
$toc{$2} = $1;
next;
}
if(/even: (.*)/){
$file = $1;
if(!defined($toc{$file})){
print STDERR "Have no toc for $file\n";
next;
}
if($toc{$file} =~ /^\d\d[^0]/){
print STDERR "$file does not start on a fresh page.\n";
}
next;
}
if(/odd: (.*)/){
$file = $1;
if(!defined($toc{$file})){
print STDERR "Have no toc for $file\n";
next;
}
if($toc{$file} =~ /^\d\d[^5]/){
print STDERR "$file does not start on a second half page.\n";
}
next;
}
print STDERR "Unknown spec: $_\n";
}
'
fmt
/tocdata runoff.spec
# make definition list
# make definition list
cd fmt
cd fmt
perl
-e
'
perl
-e
'
...
...
runoff.spec
0 → 100644
浏览文件 @
f1f8dd91
even: mmu.h
even: bootasm.S
even: bootother.S
even: bootmain.c
even: main.c
even: spinlock.c
even: proc.h
even: proc.c
odd: kalloc.c
even: trap.c
odd: bio.c
show1
0 → 100755
浏览文件 @
f1f8dd91
#!/bin/sh
runoff1
"
$@
"
| pr.pl
-h
"xv6/
$@
"
| mpage
-m50t50b
-o
-bLetter
-T
-t
-2
-FCourier
-L60
>
x.ps
;
gv
--swap
x.ps
syscall.c
浏览文件 @
f1f8dd91
...
@@ -98,6 +98,7 @@ extern int sys_kill(void);
...
@@ -98,6 +98,7 @@ extern int sys_kill(void);
extern
int
sys_link
(
void
);
extern
int
sys_link
(
void
);
extern
int
sys_mkdir
(
void
);
extern
int
sys_mkdir
(
void
);
extern
int
sys_mknod
(
void
);
extern
int
sys_mknod
(
void
);
//PAGEBREAK: 0
extern
int
sys_open
(
void
);
extern
int
sys_open
(
void
);
extern
int
sys_pipe
(
void
);
extern
int
sys_pipe
(
void
);
extern
int
sys_read
(
void
);
extern
int
sys_read
(
void
);
...
...
trap.c
浏览文件 @
f1f8dd91
...
@@ -40,11 +40,11 @@ trap(struct trapframe *tf)
...
@@ -40,11 +40,11 @@ trap(struct trapframe *tf)
return
;
return
;
}
}
// PAGEBREAK: 10
// Increment nlock to make sure interrupts stay off
// Increment nlock to make sure interrupts stay off
// during interrupt handler. Decrement before returning.
// during interrupt handler. Decrement before returning.
cpus
[
cpu
()].
nlock
++
;
cpus
[
cpu
()].
nlock
++
;
// PAGEBREAK: 10
switch
(
tf
->
trapno
){
switch
(
tf
->
trapno
){
case
IRQ_OFFSET
+
IRQ_TIMER
:
case
IRQ_OFFSET
+
IRQ_TIMER
:
lapic_timerintr
();
lapic_timerintr
();
...
@@ -80,8 +80,8 @@ trap(struct trapframe *tf)
...
@@ -80,8 +80,8 @@ trap(struct trapframe *tf)
default:
default:
if
(
cp
)
{
if
(
cp
)
{
// Assume process divided by zero or dereferenced null, etc.
// Assume process divided by zero or dereferenced null, etc.
cprintf
(
"pid %d %s: unhandled trap %d on cpu %d eip %x -- kill proc
\n
"
,
cprintf
(
"pid %d %s: unhandled trap %d
err %d
on cpu %d eip %x -- kill proc
\n
"
,
cp
->
pid
,
cp
->
name
,
tf
->
trapno
,
cpu
(),
tf
->
eip
);
cp
->
pid
,
cp
->
name
,
tf
->
trapno
,
tf
->
err
,
cpu
(),
tf
->
eip
);
proc_exit
();
proc_exit
();
}
}
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论