NetcanOS
Netcan OS is an operation system for x86 PCs, for learning how os works.
|
#include <io.h>
类 | |
struct | gdt_entry_struct |
GDT表结构。 1st flags: (present) (privilege) (descriptor type) type flags: (code) (conforming) (readable) (accessed) 2nd flags: (granularity) (32-bit default) (64-bit seg) (AVL) 更多... | |
struct | gdt_ptr_struct |
GDT指针,告诉CPU GDT表的位置。 更多... | |
struct | idt_entry_struct |
IDT表结构 更多... | |
struct | idt_ptr_struct |
IDT表指针,告诉CPU IDT表的位置。 更多... | |
宏定义 | |
#define | PIC_MASTER_CONTROL 0x20 |
master pic的控制端口 更多... | |
#define | PIC_MASTER_DATA 0x21 |
master pic的数据端口 更多... | |
#define | PIC_SLAVE_CONTROL 0xa0 |
slave pic的控制端口 更多... | |
#define | PIC_SLAVE_DATA 0xa1 |
slave pic的数据端口 更多... | |
#define | PIC_EOI 0x20 |
中断结束信息 更多... | |
类型定义 | |
typedef struct gdt_entry_struct | gdt_entry_t |
typedef struct gdt_ptr_struct | gdt_ptr_t |
typedef struct idt_entry_struct | idt_entry_t |
typedef struct idt_ptr_struct | idt_ptr_t |
函数 | |
struct gdt_entry_struct | __attribute__ ((packed)) |
用packed让gcc不要对齐 更多... | |
void | init_descriptor_tables () |
初始化GDT表和IDT表。 更多... | |
void | isr0 () |
CPU定义的32个system error中断程序 更多... | |
void | isr1 () |
void | isr2 () |
void | isr3 () |
void | isr4 () |
void | isr5 () |
void | isr6 () |
void | isr7 () |
void | isr8 () |
void | isr9 () |
void | isr10 () |
void | isr11 () |
void | isr12 () |
void | isr13 () |
void | isr14 () |
void | isr15 () |
void | isr16 () |
void | isr17 () |
void | isr18 () |
void | isr19 () |
void | isr20 () |
void | isr21 () |
void | isr22 () |
void | isr23 () |
void | isr24 () |
void | isr25 () |
void | isr26 () |
void | isr27 () |
void | isr28 () |
void | isr29 () |
void | isr30 () |
void | isr31 () |
void | irq0 () |
32-47号中断 更多... | |
void | irq1 () |
void | irq2 () |
void | irq3 () |
void | irq4 () |
void | irq5 () |
void | irq6 () |
void | irq7 () |
void | irq8 () |
void | irq9 () |
void | irq10 () |
void | irq11 () |
void | irq12 () |
void | irq13 () |
void | irq14 () |
void | irq15 () |
变量 | |
u16 | limit_low |
segment limit(0:15) 更多... | |
u16 | base_low |
base address(0:15) 更多... | |
u8 | base_middle |
base address(16:23) 更多... | |
u8 | access |
1st flags和type flags 更多... | |
u8 | granularity |
2nd flags和segment limit(16:19) 更多... | |
u8 | base_high |
base address(24:31) 更多... | |
u16 | limit |
GDT表的大小 更多... | |
u32 | base |
GDT表的地址 更多... | |
u16 | base_lo |
中断服务程序向量地址的低16位 更多... | |
u16 | sel |
内核段选择(0x08选中代码段) 更多... | |
u8 | always0 |
总是0 更多... | |
u8 | flags |
Flags 更多... | |
u16 | base_hi |
中断服务程序向量地址的高16位 更多... | |
#define PIC_EOI 0x20 |
中断结束信息
#define PIC_MASTER_CONTROL 0x20 |
master pic的控制端口
#define PIC_MASTER_DATA 0x21 |
master pic的数据端口
#define PIC_SLAVE_CONTROL 0xa0 |
slave pic的控制端口
#define PIC_SLAVE_DATA 0xa1 |
slave pic的数据端口
typedef struct gdt_entry_struct gdt_entry_t |
typedef struct gdt_ptr_struct gdt_ptr_t |
typedef struct idt_entry_struct idt_entry_t |
typedef struct idt_ptr_struct idt_ptr_t |
struct idt_ptr_struct __attribute__ | ( | (packed) | ) |
用packed让gcc不要对齐
void init_descriptor_tables | ( | ) |
初始化GDT表和IDT表。
void irq0 | ( | ) |
32-47号中断
void irq1 | ( | ) |
void irq10 | ( | ) |
void irq11 | ( | ) |
void irq12 | ( | ) |
void irq13 | ( | ) |
void irq14 | ( | ) |
void irq15 | ( | ) |
void irq2 | ( | ) |
void irq3 | ( | ) |
void irq4 | ( | ) |
void irq5 | ( | ) |
void irq6 | ( | ) |
void irq7 | ( | ) |
void irq8 | ( | ) |
void irq9 | ( | ) |
void isr0 | ( | ) |
CPU定义的32个system error中断程序
void isr1 | ( | ) |
void isr10 | ( | ) |
void isr11 | ( | ) |
void isr12 | ( | ) |
void isr13 | ( | ) |
void isr14 | ( | ) |
void isr15 | ( | ) |
void isr16 | ( | ) |
void isr17 | ( | ) |
void isr18 | ( | ) |
void isr19 | ( | ) |
void isr2 | ( | ) |
void isr20 | ( | ) |
void isr21 | ( | ) |
void isr22 | ( | ) |
void isr23 | ( | ) |
void isr24 | ( | ) |
void isr25 | ( | ) |
void isr26 | ( | ) |
void isr27 | ( | ) |
void isr28 | ( | ) |
void isr29 | ( | ) |
void isr3 | ( | ) |
void isr30 | ( | ) |
void isr31 | ( | ) |
void isr4 | ( | ) |
void isr5 | ( | ) |
void isr6 | ( | ) |
void isr7 | ( | ) |
void isr8 | ( | ) |
void isr9 | ( | ) |
u8 access |
1st flags和type flags
u8 always0 |
总是0
u32 base |
GDT表的地址
IDT表地址
u16 base_hi |
中断服务程序向量地址的高16位
u8 base_high |
base address(24:31)
u16 base_lo |
中断服务程序向量地址的低16位
u16 base_low |
base address(0:15)
u8 base_middle |
base address(16:23)
u8 flags |
Flags
u8 granularity |
2nd flags和segment limit(16:19)
u16 limit |
GDT表的大小
IDT表大小
u16 limit_low |
segment limit(0:15)
u16 sel |
内核段选择(0x08选中代码段)