Removing the tables header. Moving its contents to table headers.
This commit is contained in:
parent
d32c1fab63
commit
623b9e339f
5 changed files with 40 additions and 46 deletions
25
include/idt.h
Normal file
25
include/idt.h
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef IDT_H
|
||||||
|
#define IDT_H
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
typedef struct InterruptDescriptor_s {
|
||||||
|
uint16_t offset_1;
|
||||||
|
uint16_t selector;
|
||||||
|
uint8_t reserved;
|
||||||
|
uint8_t attributes;
|
||||||
|
uint16_t offset_2;
|
||||||
|
} InterruptDescriptor_t;
|
||||||
|
|
||||||
|
typedef struct IDTR_s {
|
||||||
|
uint16_t size;
|
||||||
|
InterruptDescriptor_t* IDT;
|
||||||
|
} IDTR_t;
|
||||||
|
|
||||||
|
extern IDTR_t idtr;
|
||||||
|
extern InterruptDescriptor_t* idt_start;
|
||||||
|
|
||||||
|
void setup_idt();
|
||||||
|
void write_descriptors();
|
||||||
|
void load_idt();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
* Contains GDT, IDT, and any relevant functions and structs pertaining to them
|
* Contains GDT, IDT, and any relevant functions and structs pertaining to them
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifndef KDTABLES_H
|
#ifndef TSS_H
|
||||||
#define KDTABLES_H
|
#define TSS_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
// TSS
|
// TSS
|
||||||
|
|
@ -40,25 +40,6 @@ typedef struct tss_s {
|
||||||
|
|
||||||
extern tss_t tss;
|
extern tss_t tss;
|
||||||
|
|
||||||
//IDT
|
|
||||||
|
|
||||||
typedef struct InterruptDescriptor_s {
|
|
||||||
uint16_t offset_1;
|
|
||||||
uint16_t selector;
|
|
||||||
uint8_t reserved;
|
|
||||||
uint8_t attributes;
|
|
||||||
uint16_t offset_2;
|
|
||||||
} InterruptDescriptor_t;
|
|
||||||
|
|
||||||
typedef struct IDTR_s {
|
|
||||||
uint16_t size;
|
|
||||||
InterruptDescriptor_t* IDT;
|
|
||||||
} IDTR_t;
|
|
||||||
|
|
||||||
extern IDTR_t idtr;
|
|
||||||
|
|
||||||
void setup_idt();
|
|
||||||
void write_descriptors();
|
|
||||||
void load_idt();
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
global idtr
|
global idtr, idt_start
|
||||||
section .idtr
|
section .idtr
|
||||||
idtr:
|
idtr:
|
||||||
dw idt_end - idt_start
|
dw idt_end - idt_start
|
||||||
|
|
@ -9,7 +9,3 @@ section .idt nobits
|
||||||
resb 256 * 8 ;idt technically has 256 entries by the spec, so i'm reserving that much space... even if i dont implement that many.
|
resb 256 * 8 ;idt technically has 256 entries by the spec, so i'm reserving that much space... even if i dont implement that many.
|
||||||
idt_end:
|
idt_end:
|
||||||
|
|
||||||
|
|
||||||
;Sigh... ISRs essentially MUST be insanely verbose.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
12
src/interrupts.s
Normal file
12
src/interrupts.s
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
; Interrupts.s - Implementations of IA32 interrupts.
|
||||||
|
|
||||||
|
;Let's make an interrupt pointer table so C can reference it and build the IDT.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
isr_table:
|
||||||
|
%assign i 0
|
||||||
|
%rep 21
|
||||||
|
isr_stub_ %+ i:
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
/* kdtables.c
|
|
||||||
* Kernel Descriptor Tables
|
|
||||||
*
|
|
||||||
* Contains GDT, IDT, and any relevant functions and structs pertaining to them
|
|
||||||
*/
|
|
||||||
#include "kdtables.h"
|
|
||||||
|
|
||||||
|
|
||||||
void setup_idt() {
|
|
||||||
write_descriptors();
|
|
||||||
load_idt();
|
|
||||||
}
|
|
||||||
|
|
||||||
void write_descriptors() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void load_idt() {
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue