diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-04 22:23:37 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-07-04 22:23:37 +0200 |
commit | 05a6f2fcf4556ba9f3d0384c07554c387f6efba2 (patch) | |
tree | 85d430b47f0d5b1ad004f04d9ab4fbc602c83ed2 /src/hardware/interrupts.h | |
parent | e6efe69c614d7781d18a7189831e8243abf57664 (diff) | |
download | abaos-05a6f2fcf4556ba9f3d0384c07554c387f6efba2.tar.gz abaos-05a6f2fcf4556ba9f3d0384c07554c387f6efba2.tar.bz2 |
got scheduling of task A and B working (now graphics output and termination is broken)
Diffstat (limited to 'src/hardware/interrupts.h')
-rw-r--r-- | src/hardware/interrupts.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hardware/interrupts.h b/src/hardware/interrupts.h index 8ab485e..767bb2e 100644 --- a/src/hardware/interrupts.h +++ b/src/hardware/interrupts.h @@ -4,6 +4,7 @@ #include <stdint.h> #include "port.h" +#include "tasks.h" // total number of supported interrupts #define NOF_INTERRUPTS 256 @@ -11,6 +12,11 @@ // offset for hardware interrupts #define IRQ_BASE 0x20 +// TODO: for now the code segment is the first entry in the boot GDT +// temporary, should be a gdt module with functions to retrieve the +// current code segment selector +#define GDT_CODE_SEGMENT_SELECTOR 8 + // TCC 0.9.26 bug?, __attribute__( ( packed ) ) on structs not working, // also not working on members.. resorting to pragmas #if defined( __TINYC__ ) @@ -64,6 +70,7 @@ typedef struct interrupt_t { interrupt_descriptor_table_pointer_t idt_pointer; interrupt_gate_descriptor_t descriptor_table[NOF_INTERRUPTS]; interrupt_handler_t interrupt_handler[NOF_INTERRUPTS]; + task_manager_t *task_manager; // PIC master control register: command and status register port8_t PIC_master_control; // PIC master data register: interrupt mask and data register @@ -76,7 +83,7 @@ typedef struct interrupt_t { void interrupts_enable( void ); void interrupts_disable( void ); -void interrupts_init( interrupt_t *interrupt ); +void interrupts_init( interrupt_t *interrupt, uint16_t gdt_code_segment_selector, task_manager_t *task_manager ); void interrupts_register_interrupt_gate( interrupt_t *interrupt, uint8_t interrupt_no, uint16_t gdt_code_segment_selector, void (*helper_handler)( ), uint8_t privilege_level, uint8_t descriptor_type ); |