From 27af606ba212b2b98abc8a6aed5492acf2dd5ae5 Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Tue, 23 Jun 2026 19:00:14 +0000 Subject: [PATCH] stos/amd64: Add GDT header Signed-off-by: Chloe M. --- paw/stos/head/arch/amd64/gdt.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 paw/stos/head/arch/amd64/gdt.h diff --git a/paw/stos/head/arch/amd64/gdt.h b/paw/stos/head/arch/amd64/gdt.h new file mode 100644 index 0000000..107c70f --- /dev/null +++ b/paw/stos/head/arch/amd64/gdt.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2026, Chloe M. + * Provided under the BSD-3 clause. + * + * Description: Global descriptor table + * Author: Chloe M. + */ + +#ifndef _MACHINE_GDT_H_ +#define _MACHINE_GDT_H_ 1 + +/* Number of GDT entries */ +#define GDT_ENTRY_COUNT 7 + +/* Kernel code/data */ +#define GDT_KCODE 0x08 +#define GDT_KDATA 0x10 + +/* User code/data */ +#define GDT_UCODE 0x18 +#define GDT_UDATA 0x20 + +/* Task state segment */ +#define GDT_TSS 0x28 +#define GDT_TSS_INDEX 0x05 + +#endif /* !_MACHINE_GDT_H_ */