haiku/headers/private/kernel/arch/x86/arch_kernel_args.h
Alex Smith e5fc2bfcab Implemented long mode setup/switch code, the bootloader can now start the 64-bit kernel!
The setup procedure is fairly simple: create a 64-bit GDT and 64-bit page
tables that include all kernel mappings from the 32-bit address space, but at
the correct 64-bit address, then go through kernel_args and changes all virtual
addresses to 64-bit addresses, and finally switch to long mode and jump to the
kernel.
2012-06-26 11:08:21 +01:00

51 lines
1.1 KiB
C

/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef KERNEL_ARCH_x86_KERNEL_ARGS_H
#define KERNEL_ARCH_x86_KERNEL_ARGS_H
#ifndef KERNEL_BOOT_KERNEL_ARGS_H
# error This file is included from <boot/kernel_args.h> only
#endif
#include <util/FixedWidthPointer.h>
#define MAX_BOOT_PTABLES 4
#define _PACKED __attribute__((packed))
#define IDT_LIMIT 0x800
#define GDT_LIMIT 0x800
// kernel args
typedef struct {
// architecture specific
uint32 system_time_cv_factor;
uint64 cpu_clock_speed;
uint32 phys_pgdir;
uint64 vir_pgdir;
uint32 num_pgtables;
uint32 pgtables[MAX_BOOT_PTABLES];
uint64 virtual_end;
uint32 phys_idt;
uint64 vir_idt;
uint32 phys_gdt;
uint64 vir_gdt;
uint64 page_hole;
// smp stuff
uint32 apic_time_cv_factor; // apic ticks per second
uint32 apic_phys;
FixedWidthPointer<void> apic;
uint32 ioapic_phys;
uint32 cpu_apic_id[MAX_BOOT_CPUS];
uint32 cpu_apic_version[MAX_BOOT_CPUS];
// hpet stuff
uint32 hpet_phys;
FixedWidthPointer<void> hpet;
} _PACKED arch_kernel_args;
#endif /* KERNEL_ARCH_x86_KERNEL_ARGS_H */