Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
eb52c7de
提交
eb52c7de
8月 28, 2007
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
comments; rename irq_ to pic_
上级
5516be1f
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
25 行增加
和
18 行删除
+25
-18
console.c
console.c
+5
-1
defs.h
defs.h
+1
-1
ide.c
ide.c
+1
-1
init.c
init.c
+2
-2
ioapic.c
ioapic.c
+1
-0
kbd.c
kbd.c
+0
-1
mp.c
mp.c
+2
-0
picirq.c
picirq.c
+12
-11
timer.c
timer.c
+1
-1
没有找到文件。
console.c
浏览文件 @
eb52c7de
// Console input and output.
// Input is from the keyboard only.
// Output is written to the screen and the printer port.
#include "types.h"
#include "defs.h"
#include "param.h"
...
...
@@ -278,7 +282,7 @@ console_init(void)
devsw
[
CONSOLE
].
read
=
console_read
;
//use_console_lock = 1;
irq
_enable
(
IRQ_KBD
);
pic
_enable
(
IRQ_KBD
);
ioapic_enable
(
IRQ_KBD
,
0
);
}
...
...
defs.h
浏览文件 @
eb52c7de
...
...
@@ -85,7 +85,7 @@ void mp_init(void);
void
mp_startthem
(
void
);
// picirq.c
void
irq
_enable
(
int
);
void
pic
_enable
(
int
);
void
pic_init
(
void
);
// pipe.c
...
...
ide.c
浏览文件 @
eb52c7de
...
...
@@ -47,7 +47,7 @@ ide_init(void)
int
i
;
initlock
(
&
ide_lock
,
"ide"
);
irq
_enable
(
IRQ_IDE
);
pic
_enable
(
IRQ_IDE
);
ioapic_enable
(
IRQ_IDE
,
ncpu
-
1
);
ide_wait_ready
(
0
);
...
...
init.c
浏览文件 @
eb52c7de
// init: The initial user-level program
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fcntl.h"
// init: The initial user-level program
char
*
sh_args
[]
=
{
"sh"
,
0
};
int
...
...
ioapic.c
浏览文件 @
eb52c7de
// The I/O APIC manages hardware interrupts for an SMP system.
// http://www.intel.com/design/chipsets/datashts/29056601.pdf
// See also picirq.c.
#include "types.h"
#include "defs.h"
...
...
kbd.c
浏览文件 @
eb52c7de
...
...
@@ -48,4 +48,3 @@ kbd_intr(void)
{
console_intr
(
kbd_getc
);
}
mp.c
浏览文件 @
eb52c7de
// Multiprocessor bootstrap.
// Search memory for MP description structures.
// http://developer.intel.com/design/pentium/datashts/24201606.pdf
#include "types.h"
...
...
picirq.c
浏览文件 @
eb52c7de
// Intel 8259A programmable interrupt controllers.
#include "types.h"
#include "x86.h"
#include "traps.h"
// I/O Addresses of the two
8259A
programmable interrupt controllers
// I/O Addresses of the two programmable interrupt controllers
#define IO_PIC1 0x20 // Master (IRQs 0-7)
#define IO_PIC2 0xA0 // Slave (IRQs 8-15)
...
...
@@ -10,21 +12,20 @@
// Current IRQ mask.
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static
ushort
irq
_mask_8259A
=
0xFFFF
&
~
(
1
<<
IRQ_SLAVE
);
static
ushort
irq
mask
=
0xFFFF
&
~
(
1
<<
IRQ_SLAVE
);
static
void
irq_setmask_8259A
(
ushort
mask
)
pic_setmask
(
ushort
mask
)
{
irq_mask_8259A
=
mask
;
outb
(
IO_PIC1
+
1
,
(
char
)
mask
);
outb
(
IO_PIC2
+
1
,
(
char
)(
mask
>>
8
));
irqmask
=
mask
;
outb
(
IO_PIC1
+
1
,
mask
);
outb
(
IO_PIC2
+
1
,
mask
>>
8
);
}
void
irq
_enable
(
int
irq
)
pic
_enable
(
int
irq
)
{
irq_setmask_8259A
(
irq_mask_8259A
&
~
(
1
<<
irq
));
pic_setmask
(
irqmask
&
~
(
1
<<
irq
));
}
// Initialize the 8259A interrupt controllers.
...
...
@@ -78,6 +79,6 @@ pic_init(void)
outb
(
IO_PIC2
,
0x68
);
// OCW3
outb
(
IO_PIC2
,
0x0a
);
// OCW3
if
(
irq
_mask_8259A
!=
0xFFFF
)
irq_setmask_8259A
(
irq_mask_8259A
);
if
(
irq
mask
!=
0xFFFF
)
pic_setmask
(
irqmask
);
}
timer.c
浏览文件 @
eb52c7de
...
...
@@ -28,5 +28,5 @@ timer_init(void)
outb
(
TIMER_MODE
,
TIMER_SEL0
|
TIMER_RATEGEN
|
TIMER_16BIT
);
outb
(
IO_TIMER1
,
TIMER_DIV
(
100
)
%
256
);
outb
(
IO_TIMER1
,
TIMER_DIV
(
100
)
/
256
);
irq
_enable
(
IRQ_TIMER
);
pic
_enable
(
IRQ_TIMER
);
}
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论