more x86_64 work. started to put the mmu bits together in the (former) stage2 loader.
[newos.git] / include / boot / arch / x86_64 / stage2.h
blobc5af9deb91089875acba336561e3dc9ad82ecdbf
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _NEWOS_KERNEL_BOOT_ARCH_I386_STAGE2_H
6 #define _NEWOS_KERNEL_BOOT_ARCH_I386_STAGE2_H
8 #include <boot/stage2_struct.h>
9 #include <newos/compiler.h>
11 #define MAX_BOOT_PTABLES 16
13 #define IDT_LIMIT 0x800
14 #define GDT_LIMIT 0x800
16 struct gdt_idt_descr {
17 unsigned short a;
18 unsigned int *b;
19 } _PACKED;
22 // kernel args
23 typedef struct {
24 // architecture specific
25 unsigned int system_time_cv_factor;
26 addr_t phys_pgdir;
27 unsigned int num_pgtables;
28 addr_t pgtables[MAX_BOOT_PTABLES];
29 addr_t phys_idt;
30 addr_t vir_idt;
31 addr_t phys_gdt;
32 addr_t vir_gdt;
33 unsigned int page_hole;
34 // smp stuff
35 unsigned int apic_time_cv_factor; // apic ticks per second
36 addr_t apic_phys;
37 unsigned int *apic;
38 addr_t ioapic_phys;
39 unsigned int *ioapic;
40 unsigned int cpu_apic_id[_MAX_CPUS];
41 unsigned int cpu_os_id[_MAX_CPUS];
42 unsigned int cpu_apic_version[_MAX_CPUS];
43 } arch_kernel_args;
45 #endif