diff options
author | Alexis211 <alexis211@gmail.com> | 2010-08-10 20:39:57 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-08-10 20:39:57 +0200 |
commit | f81bf65484fa8c81a1886f456c71f1e6eebe84e9 (patch) | |
tree | 146f304d8de8828003edd548df22cca581044017 /src/kernel/mem/gdt.h | |
parent | 0ec0ca40a4fedfe97c49903a329b2a9ad2e22d03 (diff) | |
download | TCE-f81bf65484fa8c81a1886f456c71f1e6eebe84e9.tar.gz TCE-f81bf65484fa8c81a1886f456c71f1e6eebe84e9.zip |
Added a lot of comments in kernel code. A bit of cleaning too.
Diffstat (limited to 'src/kernel/mem/gdt.h')
-rw-r--r-- | src/kernel/mem/gdt.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/kernel/mem/gdt.h b/src/kernel/mem/gdt.h index 485002b..1b33dac 100644 --- a/src/kernel/mem/gdt.h +++ b/src/kernel/mem/gdt.h @@ -3,6 +3,11 @@ #include <types.h> +/* The GDT is one of the x86's descriptor tables. It is used for memory segmentation. + Here, we don't use segmentation to separate processes from one another (this is done with paging). + We only use segmentation to make the difference between kernel mode (ring 3) and user mode (ring 0) */ + +/* One entry of the table */ struct gdt_entry { uint16_t limit_low; uint16_t base_low; @@ -12,11 +17,15 @@ struct gdt_entry { uint8_t base_high; } __attribute__((packed)); +/* Structure defining the whole table : address and size (in bytes). */ struct gdt_ptr { uint16_t limit; uint32_t base; } __attribute__((packed)); +/* The TSS is used for hardware multitasking. + We don't use that, but we still need a TSS so that user mode process exceptions + can be handled correctly by the kernel. */ struct tss_entry { uint32_t prev_tss; // The previous TSS - if we used hardware task switching this would form a linked list. uint32_t esp0; // The stack pointer to load when we change to kernel mode. |