2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #define PIC1 0x20 // IO base address for master PIC
23 #define PIC2 0xA0 // IO base address for slave PIC
24 #define PIC1_COMMAND PIC1
25 #define PIC1_DATA (PIC1+1)
26 #define PIC2_COMMAND PIC2
27 #define PIC2_DATA (PIC2+1)
28 #define PIC_EOI 0x20 // End - of - interrupt command code
29 #define ICW1_ICW4 0x01 // ICW4 (not) needed
30 #define ICW1_SINGLE 0x02 // Single (cascade) mode
31 #define ICW1_INTERVAL4 0x04 // Call address interval 4 (8)
32 #define ICW1_LEVEL 0x08 // Level triggered (edge) mode
33 #define ICW1_INIT 0x10 // Initialization - required!
34 #define ICW4_8086 0x01 // 8086/88 (MCS-80/85) mode
35 #define ICW4_AUTO 0x02 // Auto (normal) EOI
36 #define ICW4_BUF_SLAVE 0x08 // Buffered mode/slave
37 #define ICW4_BUF_MASTER 0x0C // Buffered mode/master
38 #define ICW4_SFNM 0x10 // Special fully nested (not)
40 #define PIT_CHANNELS 0x40 // Channel ports of PIT
41 #define PIT_FREQ 1193180 // Frequency of PIT
44 unsigned int pic_getmask(int irq
);
45 void pic_setmask(int irq
,unsigned int mask
);
46 void pic_eoi(int irq
);
47 int pic_pit_setinterval(int channel
,unsigned int interval
);