From 1652e1239cf1ef85a7768cc17ab48b2e054a7b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:20:26 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20ensemble=20de=20fonctions=20permettant?= =?UTF-8?q?=20la=20gestion=20des=20IRQs=20et=20des=20interruptions=20en=20?= =?UTF-8?q?mode=20prot=C3=A9g=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/irq.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/irq.c diff --git a/lib/irq.c b/lib/irq.c new file mode 100644 index 0000000..6c78754 --- /dev/null +++ b/lib/irq.c @@ -0,0 +1,36 @@ +void setpic(void) +{ + /* MASTER */ + /* Initialisation de ICW1 */ + outbp(0x20,0x11); + /* Initialisation de ICW2 - vecteur de depart = 32 */ + outbp(0x21,0x20); + /* Initialisation de ICW3 */ + outbp(0x21,0x04); + /* Initialisation de ICW4 */ + outbp(0x21,0x01); + /* masquage des interruptions */ + outbp(0x21,0xFF); + /* SLAVE */ + /* Initialisation de ICW1 */ + outbp(0xA0,0x11); + /* Initialisation de ICW2 - vecteur de depart = 96 */ + outbp(0xA1,0x70); + /* Initialisation de ICW3 */ + outbp(0xA1,0x02); + /* Initialisation de ICW4 */ + outbp(0xA1,0x01); + /* masquage des interruptions */ + outbp(0xA1,0xFF); + /* Demasquage des irqs */ + outbp(0x21,0xFD); +} + +void makeidtdesc(u32 offset, u16 select, u16 type, idtdesc* desc) +{ + desc->offset0_15 = (offset & 0xffff); + desc->select = select; + desc->type = type; + desc->offset16_31 = (offset & 0xffff0000) >> 16; + return; +}