Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
1a43a88b
提交
1a43a88b
10月 27, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Automatic EOI doesn't work on tom. Add piceoi.
上级
789a5877
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
20 行增加
和
4 行删除
+20
-4
Makefile
Makefile
+1
-1
kernel.h
kernel.h
+1
-0
picirq.c
picirq.c
+14
-2
trap.c
trap.c
+4
-1
没有找到文件。
Makefile
浏览文件 @
1a43a88b
...
@@ -100,7 +100,7 @@ fs.img: mkfs README $(UPROGS)
...
@@ -100,7 +100,7 @@ fs.img: mkfs README $(UPROGS)
clean
:
clean
:
rm
-f
*
.o
*
.d
*
.asm
*
.sym initcode kernel bootother mkfs fs.img
rm
-f
*
.o
*
.d
*
.asm
*
.sym initcode kernel bootother mkfs fs.img
QEMUOPTS
=
-smp
$(CPUS)
-m
512
-nographic
QEMUOPTS
=
-smp
$(CPUS)
-m
512
qemu
:
kernel
qemu
:
kernel
$(QEMU)
$(QEMUOPTS)
-kernel
kernel
$(QEMU)
$(QEMUOPTS)
-kernel
kernel
gdb
:
kernel
gdb
:
kernel
...
...
kernel.h
浏览文件 @
1a43a88b
...
@@ -155,6 +155,7 @@ void* ns_enumerate_key(struct ns *ns, struct nskey key, void *(*f)(voi
...
@@ -155,6 +155,7 @@ void* ns_enumerate_key(struct ns *ns, struct nskey key, void *(*f)(voi
// picirq.c
// picirq.c
void
picenable
(
int
);
void
picenable
(
int
);
void
piceoi
(
void
);
// pipe.c
// pipe.c
int
pipealloc
(
struct
file
**
,
struct
file
**
);
int
pipealloc
(
struct
file
**
,
struct
file
**
);
...
...
picirq.c
浏览文件 @
1a43a88b
...
@@ -28,6 +28,18 @@ picenable(int irq)
...
@@ -28,6 +28,18 @@ picenable(int irq)
picsetmask
(
irqmask
&
~
(
1
<<
irq
));
picsetmask
(
irqmask
&
~
(
1
<<
irq
));
}
}
void
piceoi
(
void
)
{
// OCW2: rse00xxx
// r: rotate
// s: specific
// e: end-of-interrupt
// xxx: specific interrupt line
outb
(
IO_PIC1
,
0x20
);
outb
(
IO_PIC2
,
0x20
);
}
// Initialize the 8259A interrupt controllers.
// Initialize the 8259A interrupt controllers.
void
void
initpic
(
void
)
initpic
(
void
)
...
@@ -59,7 +71,7 @@ initpic(void)
...
@@ -59,7 +71,7 @@ initpic(void)
// can be hardwired).
// can be hardwired).
// a: 1 = Automatic EOI mode
// a: 1 = Automatic EOI mode
// p: 0 = MCS-80/85 mode, 1 = intel x86 mode
// p: 0 = MCS-80/85 mode, 1 = intel x86 mode
outb
(
IO_PIC1
+
1
,
0x
3
);
outb
(
IO_PIC1
+
1
,
0x
1
);
// Set up slave (8259A-2)
// Set up slave (8259A-2)
outb
(
IO_PIC2
,
0x11
);
// ICW1
outb
(
IO_PIC2
,
0x11
);
// ICW1
...
@@ -67,7 +79,7 @@ initpic(void)
...
@@ -67,7 +79,7 @@ initpic(void)
outb
(
IO_PIC2
+
1
,
IRQ_SLAVE
);
// ICW3
outb
(
IO_PIC2
+
1
,
IRQ_SLAVE
);
// ICW3
// NB Automatic EOI mode doesn't tend to work on the slave.
// NB Automatic EOI mode doesn't tend to work on the slave.
// Linux source code says it's "to be investigated".
// Linux source code says it's "to be investigated".
outb
(
IO_PIC2
+
1
,
0x
3
);
// ICW4
outb
(
IO_PIC2
+
1
,
0x
1
);
// ICW4
// OCW3: 0ef01prs
// OCW3: 0ef01prs
// ef: 0x = NOP, 10 = clear specific mask, 11 = set specific mask
// ef: 0x = NOP, 10 = clear specific mask, 11 = set specific mask
...
...
trap.c
浏览文件 @
1a43a88b
...
@@ -82,6 +82,7 @@ trap(struct trapframe *tf)
...
@@ -82,6 +82,7 @@ trap(struct trapframe *tf)
case
T_IRQ0
+
IRQ_IDE
:
case
T_IRQ0
+
IRQ_IDE
:
ideintr
();
ideintr
();
lapiceoi
();
lapiceoi
();
piceoi
();
break
;
break
;
case
T_IRQ0
+
IRQ_IDE
+
1
:
case
T_IRQ0
+
IRQ_IDE
+
1
:
// Bochs generates spurious IDE1 interrupts.
// Bochs generates spurious IDE1 interrupts.
...
@@ -89,14 +90,16 @@ trap(struct trapframe *tf)
...
@@ -89,14 +90,16 @@ trap(struct trapframe *tf)
case
T_IRQ0
+
IRQ_KBD
:
case
T_IRQ0
+
IRQ_KBD
:
kbdintr
();
kbdintr
();
lapiceoi
();
lapiceoi
();
piceoi
();
break
;
break
;
case
T_IRQ0
+
IRQ_COM1
:
case
T_IRQ0
+
IRQ_COM1
:
uartintr
();
uartintr
();
lapiceoi
();
lapiceoi
();
piceoi
();
break
;
break
;
case
T_IRQ0
+
7
:
case
T_IRQ0
+
7
:
case
T_IRQ0
+
IRQ_SPURIOUS
:
case
T_IRQ0
+
IRQ_SPURIOUS
:
cprintf
(
"cpu%d: spurious interrupt at %x:%x
\n
"
,
cprintf
(
"cpu%d: spurious interrupt at %x:%
l
x
\n
"
,
mycpu
()
->
id
,
tf
->
cs
,
tf
->
rip
);
mycpu
()
->
id
,
tf
->
cs
,
tf
->
rip
);
lapiceoi
();
lapiceoi
();
case
T_TLBFLUSH
:
case
T_TLBFLUSH
:
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论