IBNOS
|
Go to the source code of this file.
Classes | |
struct | GDTTable |
struct | GDTEntry |
struct | IDTTable |
struct | IDTEntry |
Macros | |
#define | KERNELSTACK_SIZE PAGE_SIZE |
#define | USERMODE_KERNELSTACK_ADDRESS 0xFF800000 |
#define | USERMODE_GDT_ADDRESS 0xFF801000 |
#define | USERMODE_IDT_ADDRESS 0xFF811000 |
#define | USERMODE_INTJMP_ADDRESS 0xFF812000 |
#define | USERMODE_TASK_ADDRESS 0xFF813000 |
#define | USERMODE_KERNELSTACK_LIMIT (USERMODE_KERNELSTACK_ADDRESS + KERNELSTACK_SIZE) |
#define | USERMODE_INTJMP_ENABLE_FPU (USERMODE_INTJMP_ADDRESS + 2048) |
GDT Privileges | |
#define | GDT_CPL_MASK 3 |
#define | GDT_CPL_RING0 0 |
#define | GDT_CPL_RING3 3 |
Interrupt types | |
For more information take a look at http://wiki.osdev.org/Interrupt_Descriptor_Table | |
#define | INT_TYPE_TASK32 0x5 |
#define | INT_TYPE_INT16 0x6 |
#define | INT_TYPE_TRAP16 0x7 |
#define | INT_TYPE_INT32 0xE |
#define | INT_TYPE_TRAP32 0xF |
GDT Size | |
#define | GDT_MAX_SIZE 0x10000 |
#define | GDT_MAX_PAGES ((GDT_MAX_SIZE + PAGE_MASK) >> PAGE_BITS) |
#define | GDT_MAX_COUNT (GDT_MAX_SIZE / sizeof(struct GDTEntry)) |
IDT Size | |
#define | IDT_MAX_SIZE PAGE_SIZE |
#define | IDT_MAX_COUNT 256 |
Functions | |
struct GDTTable | __attribute__ ((packed)) |
void | gdtInit () |
Initializes the GDT, task registers, and sets up everything required for multiprocessing. More... | |
struct GDTEntry * | gdtGetFreeEntry () |
Get a free entry in the GDT. More... | |
uint32_t | gdtGetEntryOffset (struct GDTEntry *entry, uint32_t ring) |
Determines the offset of a GDT entry. More... | |
void | gdtEntrySetAddress (struct GDTEntry *entry, uint32_t address) |
Helper function to set the address inside a GDTEntry. More... | |
void | gdtEntrySetLimit (struct GDTEntry *entry, uint64_t length) |
Helper function to set the length inside a GDTEntry. More... | |
void | gdtReleaseEntry (struct GDTEntry *entry) |
Mark a GDTEntry as free. More... | |
uint32_t | tssRunUsermodeThread (struct thread *t) |
Run a thread. More... | |
void | __attribute__ ((cdecl)) |
Variables | |
void * | kernelStack |
void * | intJmpTable_kernel |
void * | intJmpTable_user |
struct GDTEntry * | codeRing0 |
struct GDTEntry * | dataRing0 |
struct GDTEntry * | codeRing3 |
struct GDTEntry * | dataRing3 |
struct GDTEntry * | kernelTask |
struct GDTEntry * | usermodeTask |
uint16_t | limit |
uint32_t | address |
uint16_t | limit1 |
uint16_t | address1 |
uint8_t | address2 |
union { | |
uint8_t access | |
struct { | |
uint8_t accessed: 1 | |
uint8_t readWrite: 1 | |
uint8_t dc: 1 | |
uint8_t execute: 1 | |
uint8_t isSystem: 1 | |
uint8_t privlevel: 2 | |
uint8_t present: 1 | |
} accessBits | |
}; | |
uint8_t | limit2 |
uint8_t | user |
uint8_t | reserved |
uint8_t | is32bit |
uint8_t | granularity |
uint8_t | address3 |
uint16_t | addressLow |
union { | |
uint16_t csSelector | |
uint16_t taskSelector | |
}; | |
uint8_t | zero |
union { | |
uint8_t typeAttr | |
struct { | |
uint8_t type: 4 | |
uint8_t storageSegment: 1 | |
uint8_t dpl: 2 | |
uint8_t present: 1 | |
} typeBits | |
}; | |
uint16_t | addressHigh |
#define USERMODE_INTJMP_ENABLE_FPU (USERMODE_INTJMP_ADDRESS + 2048) |
#define USERMODE_KERNELSTACK_LIMIT (USERMODE_KERNELSTACK_ADDRESS + KERNELSTACK_SIZE) |
union { ... } |
union { ... } |
union { ... } |
struct { ... } accessBits |
struct { ... } typeBits |