working on ocw2
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
parent
87eaa96d0c
commit
7ceec0ee06
3
k/idt.c
3
k/idt.c
@ -43,6 +43,9 @@ static struct idt_entry_descriptor idt_entries_descriptors[IDT_NB_ENTRIES] = {
|
|||||||
void interrupt_handler(struct isr_param *isr_param)
|
void interrupt_handler(struct isr_param *isr_param)
|
||||||
{
|
{
|
||||||
printf("Oh no %d!\r\n", isr_param->int_vector);
|
printf("Oh no %d!\r\n", isr_param->int_vector);
|
||||||
|
if (isr_param->int_vector > IDT_RESERVED_ENTRIES
|
||||||
|
&& isr_param->int_vector < IDT_RESERVED_ENTRIES + 16)
|
||||||
|
acknowledge(isr_param->int_vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct idt_entry create_idt_entry(struct idt_entry_descriptor descriptor)
|
struct idt_entry create_idt_entry(struct idt_entry_descriptor descriptor)
|
||||||
|
10
k/pic.c
10
k/pic.c
@ -1,6 +1,7 @@
|
|||||||
#include "idt.h"
|
#include "idt.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "pic.h"
|
#include "pic.h"
|
||||||
|
#include "stdio.h"
|
||||||
|
|
||||||
static void send_icw1(void)
|
static void send_icw1(void)
|
||||||
{
|
{
|
||||||
@ -42,3 +43,12 @@ void init_pic(void)
|
|||||||
mask_irqs();
|
mask_irqs();
|
||||||
asm volatile("sti");
|
asm volatile("sti");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void acknowledge(uint32_t int_vector)
|
||||||
|
{
|
||||||
|
printf("acknowledging %d\r\n", int_vector);
|
||||||
|
uint8_t ocw2 = 0x20;
|
||||||
|
if (int_vector >= IDT_RESERVED_ENTRIES + 8)
|
||||||
|
outb(SLAVE_PIC_A, ocw2);
|
||||||
|
outb(MASTER_PIC_A, ocw2);
|
||||||
|
}
|
||||||
|
1
k/pic.h
1
k/pic.h
@ -9,5 +9,6 @@
|
|||||||
#define ICW1 0x11
|
#define ICW1 0x11
|
||||||
|
|
||||||
void init_pic(void);
|
void init_pic(void);
|
||||||
|
void acknowledge(uint32_t int_vector);
|
||||||
|
|
||||||
#endif /* !PIC_H */
|
#endif /* !PIC_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user