Changeset 983cd374 in mainline


Ignore:
Timestamp:
2006-07-17T21:13:49Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0356274
Parents:
ba5e618
Message:

update xen32 support (most of the code is still dummy)

Location:
kernel/arch/xen32
Files:
15 added
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/xen32/Makefile.inc

    rba5e618 r983cd374  
    110110        arch/$(ARCH)/src/proc/thread.c \
    111111        arch/$(ARCH)/src/bios/bios.c \
    112         arch/$(ARCH)/src/smp/ap.S \
    113112        arch/$(ARCH)/src/smp/apic.c \
    114113        arch/$(ARCH)/src/smp/mps.c \
  • kernel/arch/xen32/_link.ld.in

    rba5e618 r983cd374  
    33
    44#define __ASM__
    5 #include <arch/boot/boot.h>
    65#include <arch/mm/page.h>
     6
     7ENTRY(kernel_image_start)
    78
    89SECTIONS {
  • kernel/arch/xen32/src/boot/boot.S

    rba5e618 r983cd374  
    4040        .byte   0
    4141
    42 #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE)
    43 
    4442.section K_TEXT_START, "ax"
    4543
     
    4947.code32
    5048.align 4
    51 .global multiboot_image_start
    52 multiboot_header:
    53         .long MULTIBOOT_HEADER_MAGIC
    54         .long MULTIBOOT_HEADER_FLAGS
    55         .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)        # checksum
    56         .long multiboot_header
    57         .long unmapped_ktext_start
    58         .long 0
    59         .long 0
    60         .long multiboot_image_start
    61        
    62 multiboot_image_start:
    63         movl $START_STACK, %esp                 # initialize stack pointer
     49.global kernel_image_start
     50       
     51kernel_image_start:
    6452        lgdt KA2PA(bootstrap_gdtr)              # initialize Global Descriptor Table register
    6553
     
    10290        popl %eax
    10391        popl %ebx
    104         cmpl $MULTIBOOT_LOADER_MAGIC, %eax                              # compare GRUB signature
    105         je valid_boot
    106                
    107                 xorl %ecx, %ecx                                                 # no memory size or map available
    108                 movl %ecx, e801memorysize
    109                 movl %ecx, e820counter
    110                
    111                 jmp invalid_boot
    112                
    113         valid_boot:
    114                
    115                 movl (%ebx), %eax                                               # ebx = physical address of struct multiboot_info
    116                
    117                 bt $0, %eax                                                             # mbi->flags[0] (mem_lower, mem_upper valid)
    118                 jc mem_valid
    119                        
    120                         xorl %ecx, %ecx
    121                         jmp mem_invalid
    122                        
    123                 mem_valid:
    124                 movl 4(%ebx), %ecx                                              # mbi->mem_lower
    125                 addl 8(%ebx), %ecx                                              # mbi->mem_upper
    126                
    127                 mem_invalid:
    128                 movl %ecx, e801memorysize
    129                
    130                 bt $3, %eax                                                             # mbi->flags[3] (mods_count, mods_addr valid)
    131                 jc mods_valid
    132                        
    133                         xorl %ecx, %ecx
    134                         movl %ecx, init
    135                         jmp mods_end
    136                
    137                 mods_valid:
    138                
    139                 movl 20(%ebx), %ecx                                             # mbi->mods_count
    140                 movl %ecx, init
    141                
    142                 cmpl $0, %ecx
    143                 je mods_end
    144                
    145                 movl 24(%ebx), %esi                                             # mbi->mods_addr
    146                 movl $init, %edi
    147                
    148                 mods_loop:
    149                
    150                         movl 0(%esi), %edx                                      # mods->mod_start
    151                         addl $0x80000000, %edx
    152                         movl %edx, 4(%edi)
    153                        
    154                         movl 4(%esi), %edx
    155                         subl 0(%esi), %edx                                      # mods->mod_end - mods->mod_start
    156                         movl %edx, 8(%edi)
    157                        
    158                         addl $16, %esi
    159                         addl $8 , %edi
    160                        
    161                         loop mods_loop
    162                        
    163                 mods_end:
    164                
    165         invalid_boot:
    166        
    167 #ifdef CONFIG_SMP
    168        
    169         # copy AP bootstrap routines below 1 MB
    170        
    171         movl $BOOT_OFFSET, %esi
    172         movl $AP_BOOT_OFFSET, %edi
    173         movl $_hardcoded_unmapped_size, %ecx
    174         cld
    175         rep movsb
    176        
    177 #endif
    17892       
    17993        call main_bsp                                                           # never returns
Note: See TracChangeset for help on using the changeset viewer.