Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
c1b100e9
提交
c1b100e9
8月 28, 2007
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nits
上级
3e1eaf22
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
22 行增加
和
59 行删除
+22
-59
console.c
console.c
+1
-4
fsvar.h
fsvar.h
+0
-40
ide.c
ide.c
+3
-3
main.c
main.c
+1
-1
runoff
runoff
+16
-2
toc.ftr
toc.ftr
+0
-1
toc.hdr
toc.hdr
+0
-1
trap.c
trap.c
+0
-4
trapasm.S
trapasm.S
+1
-3
没有找到文件。
console.c
浏览文件 @
c1b100e9
...
@@ -105,7 +105,7 @@ printint(int xx, int base, int sgn)
...
@@ -105,7 +105,7 @@ printint(int xx, int base, int sgn)
cons_putc
(
buf
[
i
]);
cons_putc
(
buf
[
i
]);
}
}
// Print to the
input
. only understands %d, %x, %p, %s.
// Print to the
console
. only understands %d, %x, %p, %s.
void
void
cprintf
(
char
*
fmt
,
...)
cprintf
(
char
*
fmt
,
...)
{
{
...
@@ -200,7 +200,6 @@ console_intr(int (*getc)(void))
...
@@ -200,7 +200,6 @@ console_intr(int (*getc)(void))
case
C
(
'P'
):
// Process listing.
case
C
(
'P'
):
// Process listing.
procdump
();
procdump
();
break
;
break
;
case
C
(
'U'
):
// Kill line.
case
C
(
'U'
):
// Kill line.
while
(
input
.
e
>
input
.
w
&&
while
(
input
.
e
>
input
.
w
&&
input
.
buf
[(
input
.
e
-
1
)
%
INPUT_BUF
]
!=
'\n'
){
input
.
buf
[(
input
.
e
-
1
)
%
INPUT_BUF
]
!=
'\n'
){
...
@@ -208,14 +207,12 @@ console_intr(int (*getc)(void))
...
@@ -208,14 +207,12 @@ console_intr(int (*getc)(void))
cons_putc
(
BACKSPACE
);
cons_putc
(
BACKSPACE
);
}
}
break
;
break
;
case
C
(
'H'
):
// Backspace
case
C
(
'H'
):
// Backspace
if
(
input
.
e
>
input
.
w
){
if
(
input
.
e
>
input
.
w
){
input
.
e
--
;
input
.
e
--
;
cons_putc
(
BACKSPACE
);
cons_putc
(
BACKSPACE
);
}
}
break
;
break
;
default:
default:
if
(
c
!=
0
&&
input
.
e
<
input
.
r
+
INPUT_BUF
){
if
(
c
!=
0
&&
input
.
e
<
input
.
r
+
INPUT_BUF
){
input
.
buf
[
input
.
e
++
]
=
c
;
input
.
buf
[
input
.
e
++
]
=
c
;
...
...
fsvar.h
浏览文件 @
c1b100e9
...
@@ -16,43 +16,3 @@ struct inode {
...
@@ -16,43 +16,3 @@ struct inode {
#define I_BUSY 0x1
#define I_BUSY 0x1
#define I_VALID 0x2
#define I_VALID 0x2
// Blank page.
ide.c
浏览文件 @
c1b100e9
...
@@ -52,7 +52,7 @@ ide_init(void)
...
@@ -52,7 +52,7 @@ ide_init(void)
ide_wait_ready
(
0
);
ide_wait_ready
(
0
);
// Check if disk 1 is present
// Check if disk 1 is present
outb
(
0x1f6
,
0x
E
0
|
(
1
<<
4
));
outb
(
0x1f6
,
0x
e
0
|
(
1
<<
4
));
for
(
i
=
0
;
i
<
1000
;
i
++
){
for
(
i
=
0
;
i
<
1000
;
i
++
){
if
(
inb
(
0x1f7
)
!=
0
){
if
(
inb
(
0x1f7
)
!=
0
){
disk_1_present
=
1
;
disk_1_present
=
1
;
...
@@ -61,7 +61,7 @@ ide_init(void)
...
@@ -61,7 +61,7 @@ ide_init(void)
}
}
// Switch back to disk 0.
// Switch back to disk 0.
outb
(
0x1f6
,
0x
E
0
|
(
0
<<
4
));
outb
(
0x1f6
,
0x
e
0
|
(
0
<<
4
));
}
}
// Start the request for b. Caller must hold ide_lock.
// Start the request for b. Caller must hold ide_lock.
...
@@ -77,7 +77,7 @@ ide_start_request(struct buf *b)
...
@@ -77,7 +77,7 @@ ide_start_request(struct buf *b)
outb
(
0x1f3
,
b
->
sector
&
0xff
);
outb
(
0x1f3
,
b
->
sector
&
0xff
);
outb
(
0x1f4
,
(
b
->
sector
>>
8
)
&
0xff
);
outb
(
0x1f4
,
(
b
->
sector
>>
8
)
&
0xff
);
outb
(
0x1f5
,
(
b
->
sector
>>
16
)
&
0xff
);
outb
(
0x1f5
,
(
b
->
sector
>>
16
)
&
0xff
);
outb
(
0x1f6
,
0x
E
0
|
((
b
->
dev
&
1
)
<<
4
)
|
((
b
->
sector
>>
24
)
&
0x0f
));
outb
(
0x1f6
,
0x
e
0
|
((
b
->
dev
&
1
)
<<
4
)
|
((
b
->
sector
>>
24
)
&
0x0f
));
if
(
b
->
flags
&
B_DIRTY
){
if
(
b
->
flags
&
B_DIRTY
){
outb
(
0x1f7
,
IDE_CMD_WRITE
);
outb
(
0x1f7
,
IDE_CMD_WRITE
);
outsl
(
0x1f0
,
b
->
data
,
512
/
4
);
outsl
(
0x1f0
,
b
->
data
,
512
/
4
);
...
...
main.c
浏览文件 @
c1b100e9
...
@@ -57,7 +57,7 @@ main(void)
...
@@ -57,7 +57,7 @@ main(void)
}
}
// Additional processors start here.
// Additional processors start here.
void
static
void
mpmain
(
void
)
mpmain
(
void
)
{
{
cprintf
(
"cpu%d: starting
\n
"
,
cpu
());
cprintf
(
"cpu%d: starting
\n
"
,
cpu
());
...
...
runoff
浏览文件 @
c1b100e9
...
@@ -134,7 +134,19 @@ perl -e '
...
@@ -134,7 +134,19 @@ perl -e '
}
}
'
$files
>
defs
'
$files
>
defs
perl
-n
-e
'print if s/^([0-9]+ [a-zA-Z0-9_]+)\(.*$/\1/;'
$files
|
(
for
i
in
$files
do
case
"
$i
"
in
*
.S
)
cat
$i
|
sed
's;#.*;;; s;//.*;;;'
;;
*
)
cat
$i
|
sed
's;//.*;;; s;"([^"\\]|\\.)*";;;'
esac
done
)
>
alltext
perl
-n
-e
'print if s/^([0-9]+ [a-zA-Z0-9_]+)\(.*$/\1/;'
alltext |
egrep
-v
' (usage|main|if|for)$'
>>
defs
egrep
-v
' (usage|main|if|for)$'
>>
defs
(
(
>
s.defs
>
s.defs
...
@@ -144,9 +156,11 @@ for i in `awk '{print $2}' defs | sort -fu`
...
@@ -144,9 +156,11 @@ for i in `awk '{print $2}' defs | sort -fu`
do
do
defs
=
`
egrep
'^[0-9]+ '
$i
'( |$)'
defs |
awk
'{print $1}'
`
defs
=
`
egrep
'^[0-9]+ '
$i
'( |$)'
defs |
awk
'{print $1}'
`
echo
$i
$defs
>>
s.defs
echo
$i
$defs
>>
s.defs
uses
=
`
egrep
-h
'([^a-zA-Z_0-9])'
$i
'($|[^a-zA-Z_0-9])'
$files
|
awk
'{print $1}'
`
uses
=
`
egrep
-h
'([^a-zA-Z_0-9])'
$i
'($|[^a-zA-Z_0-9])'
alltext |
awk
'{print $1}'
`
if
[
"x
$defs
"
!=
"x
$uses
"
]
;
then
echo
$i
$defs
echo
$i
$defs
echo
$uses
|fmt
-24
|
sed
's/^/ /'
echo
$uses
|fmt
-24
|
sed
's/^/ /'
fi
done
done
)
>
refs
)
>
refs
...
...
toc.ftr
浏览文件 @
c1b100e9
The source listing is preceded by a cross-reference that lists every defined
The source listing is preceded by a cross-reference that lists every defined
constant, struct, global variable, and function in xv6. Each entry gives,
constant, struct, global variable, and function in xv6. Each entry gives,
on the same line as the name, the line number (or, in a few cases, numbers)
on the same line as the name, the line number (or, in a few cases, numbers)
...
...
toc.hdr
浏览文件 @
c1b100e9
...
@@ -4,4 +4,3 @@ lines per column, giving one hundred lines per sheet (or page).
...
@@ -4,4 +4,3 @@ lines per column, giving one hundred lines per sheet (or page).
Thus there is a convenient relationship between line numbers and sheet numbers.
Thus there is a convenient relationship between line numbers and sheet numbers.
trap.c
浏览文件 @
c1b100e9
...
@@ -48,7 +48,6 @@ trap(struct trapframe *tf)
...
@@ -48,7 +48,6 @@ trap(struct trapframe *tf)
// 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
:
if
(
cpu
()
==
0
){
if
(
cpu
()
==
0
){
...
@@ -59,17 +58,14 @@ trap(struct trapframe *tf)
...
@@ -59,17 +58,14 @@ trap(struct trapframe *tf)
}
}
lapic_eoi
();
lapic_eoi
();
break
;
break
;
case
IRQ_OFFSET
+
IRQ_IDE
:
case
IRQ_OFFSET
+
IRQ_IDE
:
ide_intr
();
ide_intr
();
lapic_eoi
();
lapic_eoi
();
break
;
break
;
case
IRQ_OFFSET
+
IRQ_KBD
:
case
IRQ_OFFSET
+
IRQ_KBD
:
kbd_intr
();
kbd_intr
();
lapic_eoi
();
lapic_eoi
();
break
;
break
;
case
IRQ_OFFSET
+
IRQ_SPURIOUS
:
case
IRQ_OFFSET
+
IRQ_SPURIOUS
:
cprintf
(
"spurious interrupt from cpu %d eip %x
\n
"
,
cpu
(),
tf
->
eip
);
cprintf
(
"spurious interrupt from cpu %d eip %x
\n
"
,
cpu
(),
tf
->
eip
);
lapic_eoi
();
lapic_eoi
();
...
...
trapasm.S
浏览文件 @
c1b100e9
.text
.text
.globl trap
.globl trapret1
.globl alltraps
.set SEG_KDATA_SEL, 0x10 # selector for SEG_KDATA
.set SEG_KDATA_SEL, 0x10 # selector for SEG_KDATA
# vectors.S sends all traps here.
# vectors.S sends all traps here.
.globl alltraps
alltraps:
alltraps:
# Build trap frame.
# Build trap frame.
pushl %ds
pushl %ds
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论