/branches/network/kernel/arch/ia32/include/cpuid.h |
---|
35,6 → 35,13 |
#ifndef KERN_ia32_CPUID_H_ |
#define KERN_ia32_CPUID_H_ |
#define INTEL_CPUID_LEVEL 0x00000000 |
#define INTEL_CPUID_STANDARD 0x00000001 |
#define INTEL_PSE 3 |
#define INTEL_SEP 11 |
#ifndef __ASM__ |
#include <arch/types.h> |
typedef struct { |
104,6 → 111,7 |
); |
} |
#endif /* !def __ASM__ */ |
#endif |
/** @} |
/branches/network/kernel/arch/ia32/src/ia32.c |
---|
237,5 → 237,12 |
return addr; |
} |
void arch_reboot(void) |
{ |
#ifdef CONFIG_PC_KBD |
i8042_cpu_reset((i8042_t *) I8042_BASE); |
#endif |
} |
/** @} |
*/ |
/branches/network/kernel/arch/ia32/src/pm.c |
---|
232,28 → 232,5 |
gdtr_load(&cpugdtr); |
} |
/* Reboot the machine by initiating |
* a triple fault |
*/ |
void arch_reboot(void) |
{ |
preemption_disable(); |
ipl_t ipl = interrupts_disable(); |
memsetb(idt, sizeof(idt), 0); |
ptr_16_32_t idtr; |
idtr.limit = sizeof(idt); |
idtr.base = (uintptr_t) idt; |
idtr_load(&idtr); |
interrupts_restore(ipl); |
asm volatile ( |
"int $0x03\n" |
"cli\n" |
"hlt\n" |
); |
} |
/** @} |
*/ |
/branches/network/kernel/arch/ia32/src/boot/boot.S |
---|
31,6 → 31,7 |
#include <arch/boot/memmap.h> |
#include <arch/mm/page.h> |
#include <arch/pm.h> |
#include <arch/cpuid.h> |
#define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) |
67,13 → 68,14 |
movl %eax, grub_eax # save parameters from GRUB |
movl %ebx, grub_ebx |
xorl %eax, %eax |
movl $(INTEL_CPUID_LEVEL), %eax |
cpuid |
cmp $0x0, %eax # any function > 0? |
jbe pse_unsupported |
movl $0x1, %eax # basic function code 1 |
movl $(INTEL_CPUID_STANDARD), %eax |
cpuid |
bt $3, %edx # test if PSE is supported |
bt $(INTEL_PSE), %edx |
jc pse_supported |
pse_unsupported: |
81,6 → 83,14 |
jmp error_halt |
pse_supported: |
bt $(INTEL_SEP), %edx |
jc sep_supported |
movl $sep_msg, %esi |
jmp error_halt |
sep_supported: |
#include "vesa_prot.inc" |
213,3 → 223,6 |
pse_msg: |
.asciz "Page Size Extension not supported. System halted." |
sep_msg: |
.asciz "SYSENTER/SYSEXIT not supported. System halted." |