d40a935560
* Made the page table allocation more flexible. Got rid of sMaxVirtualAddress and added new virtual_end address to the architecture specific kernel args. * Increased the virtual space we reserve for the kernel to 16 MB. That should suffice for quite a while. The previous 2 MB were too tight when building the kernel with debug info. * mmu_init(): The way we were translating the BIOS' extended memory map to our physical ranges arrays was broken. Small gaps between usable memory ranges would be ignored and instead marked allocated. This worked fine for the boot loader and during the early kernel initialization, but after the VM has been fully set up it frees all physical ranges that have not been claimed otherwise. So those ranges could be entered into the free pages list and would be used later. This could possibly cause all kinds of weird problems, probably including ACPI issues. Now we add only the actually usable ranges to our list. Kernel: * vm_page_init(): The pages of the ranges between the usable physical memory ranges are now marked PAGE_STATE_UNUSED, the allocated ranges PAGE_STATE_WIRED. * unmap_and_free_physical_pages(): Don't free pages marked as unused. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35726 a95241bf-73f2-0310-859d-f6bbb57e9c96
49 lines
1.1 KiB
C
49 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
|
|
|
|
#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;
|
|
uint32 vir_pgdir;
|
|
uint32 num_pgtables;
|
|
uint32 pgtables[MAX_BOOT_PTABLES];
|
|
uint32 virtual_end;
|
|
uint32 phys_idt;
|
|
uint32 vir_idt;
|
|
uint32 phys_gdt;
|
|
uint32 vir_gdt;
|
|
uint32 page_hole;
|
|
// smp stuff
|
|
uint32 apic_time_cv_factor; // apic ticks per second
|
|
uint32 apic_phys;
|
|
uint32 *apic;
|
|
uint32 ioapic_phys;
|
|
uint32 *ioapic;
|
|
uint32 cpu_apic_id[MAX_BOOT_CPUS];
|
|
uint32 cpu_os_id[MAX_BOOT_CPUS];
|
|
uint32 cpu_apic_version[MAX_BOOT_CPUS];
|
|
// hpet stuff
|
|
uint32 hpet_phys;
|
|
uint32 *hpet;
|
|
} arch_kernel_args;
|
|
|
|
#endif /* KERNEL_ARCH_x86_KERNEL_ARGS_H */
|