Compile APIC and timer code for x86_64, and create an area for the IDT.

This commit is contained in:
Alex Smith
2012-07-06 15:24:02 +01:00
parent 15feb60325
commit c15176264b
6 changed files with 20 additions and 35 deletions
+8 -2
View File
@@ -11,6 +11,8 @@
#include <boot/kernel_args.h> #include <boot/kernel_args.h>
#include <cpu.h> #include <cpu.h>
#include <vm/vm.h>
#include <vm/vm_priv.h>
#include <arch/x86/apic.h> #include <arch/x86/apic.h>
#include <arch/x86/descriptors.h> #include <arch/x86/descriptors.h>
@@ -187,9 +189,13 @@ arch_int_init_post_vm(kernel_args* args)
{ {
// Always init the local apic as it can be used for timers even if we // Always init the local apic as it can be used for timers even if we
// don't end up using the io apic // don't end up using the io apic
//apic_init(args); apic_init(args);
// TODO: create area for IDT. // Create an area for the IDT.
area_id area = create_area("idt", (void**)&sIDT, B_EXACT_ADDRESS,
B_PAGE_SIZE, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
if (area < 0)
return area;
return B_OK; return B_OK;
} }
+1 -22
View File
@@ -331,7 +331,7 @@ arch_thread_init(struct kernel_args *args)
status_t status_t
arch_team_init_team_struct(Team *p, bool kernel) arch_team_init_team_struct(Team *p, bool kernel)
{ {
return B_ERROR; return B_OK;
} }
@@ -415,27 +415,6 @@ arch_restore_fork_frame(struct arch_fork_arg* arg)
} }
void
arch_timer_set_hardware_timer(bigtime_t timeout)
{
}
void
arch_timer_clear_hardware_timer(void)
{
}
int
arch_init_timer(kernel_args *args)
{
return 0;
}
// The software breakpoint instruction (int3). // The software breakpoint instruction (int3).
const uint8 kX86SoftwareBreakpoint[1] = { 0xcc }; const uint8 kX86SoftwareBreakpoint[1] = { 0xcc };
+7 -7
View File
@@ -50,10 +50,8 @@ if $(TARGET_ARCH) = x86_64 {
arch_real_time_clock.cpp arch_real_time_clock.cpp
arch_smp.cpp arch_smp.cpp
arch_thread.cpp arch_thread.cpp
arch_timer.cpp
arch_system_info.cpp arch_system_info.cpp
arch_user_debugger.cpp arch_user_debugger.cpp
apic.cpp
apm.cpp apm.cpp
bios.cpp bios.cpp
ioapic.cpp ioapic.cpp
@@ -77,11 +75,6 @@ if $(TARGET_ARCH) = x86_64 {
X86PagingMethodPAE.cpp X86PagingMethodPAE.cpp
X86PagingStructuresPAE.cpp X86PagingStructuresPAE.cpp
X86VMTranslationMapPAE.cpp X86VMTranslationMapPAE.cpp
# timers
x86_apic.cpp
x86_hpet.cpp
x86_pit.cpp
; ;
} }
@@ -90,8 +83,10 @@ local archGenericSources =
arch_debug_console.cpp arch_debug_console.cpp
arch_int.cpp arch_int.cpp
arch_platform.cpp arch_platform.cpp
arch_timer.cpp
arch_vm.cpp arch_vm.cpp
arch_vm_translation_map.cpp arch_vm_translation_map.cpp
apic.cpp
pic.cpp pic.cpp
# paging # paging
@@ -99,6 +94,11 @@ local archGenericSources =
X86PagingMethod.cpp X86PagingMethod.cpp
X86PagingStructures.cpp X86PagingStructures.cpp
X86VMTranslationMap.cpp X86VMTranslationMap.cpp
# timers
x86_apic.cpp
x86_hpet.cpp
x86_pit.cpp
; ;
KernelMergeObject kernel_arch_x86.o : KernelMergeObject kernel_arch_x86.o :
+3 -2
View File
@@ -88,8 +88,9 @@ apic_init(kernel_args *args)
status_t status_t
apic_per_cpu_init(kernel_args *args, int32 cpu) apic_per_cpu_init(kernel_args *args, int32 cpu)
{ {
dprintf("setting up apic for CPU %ld: apic id %lu, version %lu\n", cpu, dprintf("setting up apic for CPU %" B_PRId32 ": apic id %" B_PRIu32 ", "
apic_local_id(), apic_read(APIC_VERSION)); "version %" B_PRIu32 "\n", cpu, apic_local_id(),
apic_read(APIC_VERSION));
/* set spurious interrupt vector to 0xff */ /* set spurious interrupt vector to 0xff */
uint32 config = apic_read(APIC_SPURIOUS_INTR_VECTOR) & 0xffffff00; uint32 config = apic_read(APIC_SPURIOUS_INTR_VECTOR) & 0xffffff00;
@@ -24,7 +24,6 @@
#include <arch/x86/smp_priv.h> #include <arch/x86/smp_priv.h>
#include <arch/x86/timer.h> #include <arch/x86/timer.h>
#include "interrupts.h"
//#define TRACE_TIMER //#define TRACE_TIMER
#ifdef TRACE_TIMER #ifdef TRACE_TIMER
+1 -1
View File
@@ -60,7 +60,7 @@
//#define TRACE_VM //#define TRACE_VM
#define TRACE_FAULTS //#define TRACE_FAULTS
#ifdef TRACE_VM #ifdef TRACE_VM
# define TRACE(x) dprintf x # define TRACE(x) dprintf x
#else #else