aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/boot
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-05-25 18:08:43 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-05-25 18:10:57 +0530
commit0276800c3fc3ec4b73f5b75a2dd075c8d731d070 (patch)
tree37264f36a32c1e8d721d65b103315cf359ddb7ad /kernel/include/boot
parentd19e377907ed6845b17abbaaa663a42bcaf46032 (diff)
interrupts: rename idt namespace to interrupts
Diffstat (limited to 'kernel/include/boot')
-rw-r--r--kernel/include/boot/gdt.h3
-rw-r--r--kernel/include/boot/interrupts.h (renamed from kernel/include/boot/idt.h)19
2 files changed, 13 insertions, 9 deletions
diff --git a/kernel/include/boot/gdt.h b/kernel/include/boot/gdt.h
index 237628c..60baab8 100644
--- a/kernel/include/boot/gdt.h
+++ b/kernel/include/boot/gdt.h
@@ -86,6 +86,9 @@
((base >> 24) & 0xff) /* base_high */ \
}
+#define GDT_KERNEL_CODE_OFFSET 0x8
+#define GDT_KERNEL_DATA_OFFSET 0x10
+
namespace GDT
{
diff --git a/kernel/include/boot/idt.h b/kernel/include/boot/interrupts.h
index bb424e9..42a0ba9 100644
--- a/kernel/include/boot/idt.h
+++ b/kernel/include/boot/interrupts.h
@@ -16,22 +16,23 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef __boot_idt_h
-#define __boot_idt_h
+#ifndef __boot_interrupts_h
+#define __boot_interrupts_h
+#include <boot/gdt.h>
#include <common.h>
#include <stdint.h>
#define IDT_ENTRY(isr, attributes) \
{ \
- (isr & 0xffff), /* isr_low */ \
- 0x08, /* segment_selector */ \
- 0, /* reserved */ \
- attributes, /* attributes */ \
- (isr >> 16) /* isr_high */ \
+ (isr & 0xffff), /* isr_low */ \
+ GDT_KERNEL_CODE_OFFSET, /* segment_selector */ \
+ 0, /* reserved */ \
+ attributes, /* attributes */ \
+ (isr >> 16) /* isr_high */ \
}
-namespace IDT
+namespace Interrupts
{
typedef struct {
@@ -47,7 +48,7 @@ typedef struct {
entry_t *ptr; /* Address of IDT */
} PACKED descriptor_t;
-void load(void);
+void load_idt(void);
extern "C" NORETURN void exception_handler(void);
}