diff options
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp index 2c90152..b31f9e8 100644 --- a/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp +++ b/arch/x86_64/include/arch/context_switching/interrupt_descriptor_table/segment_selector.hpp @@ -43,8 +43,12 @@ namespace teachos::arch::context_switching::interrupt_descriptor_table /** * @brief Constructor. * - * @param index Index into the local or global descriptor table. Processor multiplies the index value by 16 (number - * of bytes in segment descriptor) and adds the result to the base address. + * @param index Index into the local or global descriptor table. Processor multiplies the index value by 8 (number + * of bytes in 32-bit segment descriptor) and adds the result to the base GDT or LDT address. Because it only + * multiplies by 8, but we are using long mode the constructor additionally multiplies the given value by two. This + * is done because 64-bit segment descriptor are twice as big in size. If we wouldn't multiply by two, index 1 would + * result in the middle between the second part of the null entry and the first part of the code kernel segment and + * therefore be invalid. * @param flags Allows to set flags for the flags field using the unscoped enum contained in this class, used to * allow for direct integer conversion. */ |
