MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / initialize8259A

Method initialize8259A

lab8/src/5/src/kernel/interrupt.cpp:40–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void InterruptManager::initialize8259A()
41{
42 // ICW 1
43 asm_out_port(0x20, 0x11);
44 asm_out_port(0xa0, 0x11);
45 // ICW 2
46 IRQ0_8259A_MASTER = 0x20;
47 IRQ0_8259A_SLAVE = 0x28;
48 asm_out_port(0x21, IRQ0_8259A_MASTER);
49 asm_out_port(0xa1, IRQ0_8259A_SLAVE);
50 // ICW 3
51 asm_out_port(0x21, 4);
52 asm_out_port(0xa1, 2);
53 // ICW 4
54 asm_out_port(0x21, 1);
55 asm_out_port(0xa1, 1);
56
57 // OCW 1 屏蔽主片所有中断,但主片的IRQ2需要开启
58 asm_out_port(0x21, 0xfb);
59 // OCW 1 屏蔽从片所有中断
60 asm_out_port(0xa1, 0xff);
61}
62
63void InterruptManager::enableTimeInterrupt()
64{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected