diff options
| author | Miguel <m.i@gmx.at> | 2018-09-02 00:08:42 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-02 00:08:42 +0200 |
| commit | 8e3411139b27a3421e9ac75c13f14f99f6dd3137 (patch) | |
| tree | cf8b53ab02863117c310bde11ee4683e134cf1b2 /kernel/gdt.h | |
| parent | 0fff2e6dc6fae82da1c7978918a490c25cc36f04 (diff) | |
syscalls
Diffstat (limited to 'kernel/gdt.h')
| -rw-r--r-- | kernel/gdt.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/kernel/gdt.h b/kernel/gdt.h index 4081a75..a234ea4 100644 --- a/kernel/gdt.h +++ b/kernel/gdt.h @@ -1 +1,46 @@ +// https://xarnze.com/posts/post/Tutorial:%20Entering%20User%20mode +// http://wiki.osdev.org/TSS +// http://wiki.osdev.org/Global_Descriptor_Table + +typedef volatile struct strtss{ + unsigned short link; + unsigned short link_h; + unsigned long esp0; + unsigned short ss0; + unsigned short ss0_h; + unsigned long esp1; + unsigned short ss1; + unsigned short ss1_h; + unsigned long esp2; + unsigned short ss2; + unsigned short ss2_h; + unsigned long cr3; + unsigned long eip; + unsigned long eflags; + unsigned long eax; + unsigned long ecx; + unsigned long edx; + unsigned long ebx; + unsigned long esp; + unsigned long ebp; + unsigned long esi; + unsigned long edi; + unsigned short es; + unsigned short es_h; + unsigned short cs; + unsigned short cs_h; + unsigned short ss; + unsigned short ss_h; + unsigned short ds; + unsigned short ds_h; + unsigned short fs; + unsigned short fs_h; + unsigned short gs; + unsigned short gs_h; + unsigned short ldt; + unsigned short ldt_h; + unsigned short trap; + unsigned short iomap; +}__attribute__((packed)) tss_struct; + void gdt_init(); |
