Changeset 42edee68 in mainline for arch/amd64/src/boot/boot.S


Ignore:
Timestamp:
2006-01-08T19:33:17Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0c0410b
Parents:
46d26ee
Message:

AMD64 SMP boots again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/boot/boot.S

    r46d26ee r42edee68  
    11#
    22# Copyright (C) 2005 Ondrej Palkovsky
     3# Copyright (C) 2006 Martin Decky
    34# All rights reserved.
    45#
     
    3839       
    3940.section K_TEXT_START, "ax"
    40 # .code16
    41 # .global kernel_image_start
    42 # .global multiboot_image_start
    43 # kernel_image_start:
    44 
    45 #       movl $0x80000000, %eax 
    46 #       cpuid
    47 #       cmp $0x80000000, %eax   # any function > 80000000h?
    48 #       jbe no_long_mode
    49 #       movl $(AMD_CPUID_EXTENDED), %eax # Extended function code 80000001
    50 #       cpuid
    51 #       bt $29, %edx            # Test if long mode is supported.
    52 #       jnc no_long_mode
    53 #
    54 #
    55 # no_long_mode:
    56 # 1:
    57 #       jmp 1b
    58 #       
     41
    5942.code32
    6043.align 4
     
    9073        # the Default operand size must not be 1 when entering long mode
    9174       
     75        movl $0x80000000, %eax 
     76        cpuid
     77        cmp $0x80000000, %eax                                           # any function > 80000000h?
     78        jbe long_mode_unsupported
     79        movl $(AMD_CPUID_EXTENDED), %eax                        # Extended function code 80000001
     80        cpuid
     81        bt $29, %edx                                                            # Test if long mode is supported.
     82        jc long_mode_supported
     83
     84        long_mode_unsupported:
     85                cli
     86                hlt
     87       
     88        long_mode_supported:
     89       
    9290        # Enable 64-bit page transaltion entries - CR4.PAE = 1.
    9391        # Paging is not enabled until after long mode is enabled
     
    218216               
    219217        invalid_boot:
     218       
     219#ifdef CONFIG_SMP
     220       
     221        # copy AP bootstrap routines below 1 MB
     222       
     223        movq $BOOT_OFFSET, %rsi
     224        movq $AP_BOOT_OFFSET, %rdi
     225        movq $_hardcoded_unmapped_size, %rcx
     226        cld
     227        rep movsb
     228       
     229#endif
    220230       
    221231        call main_bsp   # never returns
Note: See TracChangeset for help on using the changeset viewer.