summaryrefslogtreecommitdiff
path: root/src/interrupts.h
blob: 01406e396940e539d99c8cd6be92a946b267d303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef INTERRUPTS_H
#define INTERRUPTS_H

typedef struct {
	
} interrupt_gate_descriptor_t;

typedef struct {
} interrupt_t;

void interrupts_enable( void );
void interrupts_disable( void );

void interrupts_init( interrupt_t *interrupt );

// initialize IDT
// handle gates
// assembly trampolines calling C (static) functions
// later: tasks and stacks, queues

                //~ struct GateDescriptor
                //~ {
                    //~ myos::common::uint16_t handlerAddressLowBits;
                    //~ myos::common::uint16_t gdt_codeSegmentSelector;
                    //~ myos::common::uint8_t reserved;
                    //~ myos::common::uint8_t access;
                    //~ myos::common::uint16_t handlerAddressHighBits;
                //~ } __attribute__((packed));
//~ struct IDTDescr {
   //~ uint16_t offset_1; // offset bits 0..15
   //~ uint16_t selector; // a code segment selector in GDT or LDT
   //~ uint8_t zero;      // unused, set to 0
   //~ uint8_t type_attr; // type and attributes, see below
   //~ uint16_t offset_2; // offset bits 16..31
//~ };


#endif // INTERRUPTS_H