2 * Misc. kernel definitions
3 * Copyright (c) 2001,2004 David H. Hovemeyer <daveho@cs.umd.edu>
6 * This is free software. You are permitted to use,
7 * redistribute, and modify it as specified in the file "COPYING".
17 * Kernel code and data segment selectors.
18 * Keep these up to date with defs.asm.
20 #define KERNEL_CS (1<<3)
21 #define KERNEL_DS (2<<3)
25 * Address where kernel is loaded INITIALLY
26 * we move it up in memory soon
28 #define KERNEL_START_ADDR 0x100000
31 * Kernel and user privilege levels
33 #define KERNEL_PRIVILEGE 0
34 #define USER_PRIVILEGE 3
38 * Software interrupt for syscalls
40 #define SYSCALL_INT 0x90
43 * The windows versions of gcc use slightly different
44 * names for the bss begin and end symbols than the Linux version.
46 #if defined(GNU_WIN32)
47 # define BSS_START _bss_start__
48 # define BSS_END _bss_end__
50 # define BSS_START __bss_start
55 * x86 has 4096 byte pages
58 #define PAGE_SIZE (1<<PAGE_POWER)
59 #define PAGE_MASK (~(0xffffffff << PAGE_POWER))
63 /* Ultimate Memory Layout
66 4096: KernelThreadObject (one page)
67 KernelStack (one page)
72 Page List (varies - must be an integral number of pages)
73 KernelHeap (varies - KERNEL_HEAP_SIZE; must be integral number of pages)
79 #define GDT_SIZE PAGE_SIZE
80 #define TSS_SIZE PAGE_SIZE
81 #define IDT_SIZE PAGE_SIZE
82 //#define KERNEL_HEAP_SIZE (256*PAGE_SIZE)
83 #define KERNEL_STACK_SIZE PAGE_SIZE
84 #define KERNEL_THREAD_OBJECT_SIZE PAGE_SIZE
90 * * Keep these up to date with defs.asm.
92 #define GDT_LOCATION (PAGE_SIZE * 3)
93 #define TSS_LOCATION (GDT_LOCATION + TSS_SIZE)
94 #define IDT_LOCATION (TSS_LOCATION + IDT_SIZE)
99 #define KERNEL_THREAD_OBJECT (PAGE_SIZE)
100 #define KERNEL_STACK (KERNEL_THREAD_OBJECT + KERNEL_THREAD_OBJECT_SIZE)
102 #define KERNEL_HEAP (KERNEL_STACK + KERNEL_STACK_SIZE)
103 #define KERNEL_PAGELIST (KERNEL_HEAP + KERNEL_HEAP_SIZE)
109 #define ISA_HOLE_START 0x0A0000
110 #define ISA_HOLE_END 0x100000
113 #endif /* GEEKOS_DEFS_H */