Changeset c18e666 in mainline


Ignore:
Timestamp:
2009-03-30T20:30:32Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0dd1d444
Parents:
18251cc
Message:

detect SYSENTER/SYSEXIT support on boot
(this serves as a hint for people who try to boot HelenOS on Bochs emulating plain Pentium,
unfortunatelly it also kills VirtualBox, as it does not support SYSENTER/SYSEXIT officially,
see http://www.virtualbox.org/ticket/1248)

Location:
kernel/arch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/include/cpuid.h

    r18251cc rc18e666  
    3636#define KERN_amd64_CPUID_H_
    3737
    38 #define AMD_CPUID_EXTENDED   0x80000001
    39 #define AMD_EXT_NOEXECUTE    20
    40 #define AMD_EXT_LONG_MODE    29
     38#define AMD_CPUID_EXTENDED  0x80000001
     39#define AMD_EXT_NOEXECUTE   20
     40#define AMD_EXT_LONG_MODE   29
    4141
    42 #define INTEL_CPUID_STANDARD 0x00000001
    43 #define INTEL_CPUID_EXTENDED 0x80000000
    44 #define INTEL_SSE2           26
    45 #define INTEL_FXSAVE         24
     42#define INTEL_CPUID_LEVEL     0x00000000
     43#define INTEL_CPUID_STANDARD  0x00000001
     44#define INTEL_CPUID_EXTENDED  0x80000000
     45#define INTEL_SSE2            26
     46#define INTEL_FXSAVE          24
    4647
    4748#ifndef __ASM__
  • kernel/arch/ia32/include/cpuid.h

    r18251cc rc18e666  
    3535#ifndef KERN_ia32_CPUID_H_
    3636#define KERN_ia32_CPUID_H_
     37
     38#define INTEL_CPUID_LEVEL     0x00000000
     39#define INTEL_CPUID_STANDARD  0x00000001
     40#define INTEL_PSE             3
     41#define INTEL_SEP             11
     42
     43#ifndef __ASM__
    3744
    3845#include <arch/types.h>
     
    105112}
    106113
     114#endif /* !def __ASM__ */
    107115#endif
    108116
  • kernel/arch/ia32/src/boot/boot.S

    r18251cc rc18e666  
    3232#include <arch/mm/page.h>
    3333#include <arch/pm.h>
     34#include <arch/cpuid.h>
    3435
    3536#define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE)
     
    6869        movl %ebx, grub_ebx
    6970       
    70         xorl %eax, %eax
     71        movl $(INTEL_CPUID_LEVEL), %eax
    7172        cpuid
    7273        cmp $0x0, %eax              # any function > 0?
    7374        jbe pse_unsupported
    74         movl $0x1, %eax             # basic function code 1
     75       
     76        movl $(INTEL_CPUID_STANDARD), %eax
    7577        cpuid
    76         bt $3, %edx                 # test if PSE is supported
     78        bt $(INTEL_PSE), %edx
    7779        jc pse_supported
    7880       
     
    8284       
    8385        pse_supported:
     86       
     87        bt $(INTEL_SEP), %edx
     88        jc sep_supported
     89       
     90                movl $sep_msg, %esi
     91                jmp error_halt
     92       
     93        sep_supported:
    8494
    8595#include "vesa_prot.inc"
     
    214224pse_msg:
    215225        .asciz "Page Size Extension not supported. System halted."
     226
     227sep_msg:
     228        .asciz "SYSENTER/SYSEXIT not supported. System halted."
Note: See TracChangeset for help on using the changeset viewer.