Changeset 5dce48b9 in mainline


Ignore:
Timestamp:
2005-09-01T16:40:30Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
399ccd9
Parents:
2793442
Message:

load the kernel above 1 MB on IA-32

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/_link.ld

    r2793442 r5dce48b9  
    2323        }
    2424
    25         .mapped (0x80000000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) {
     25        .mapped (0x80100000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) {
    2626                ktext_start = .;
    2727                *(.text);
     
    3333                *(COMMON);              /* global variables */
    3434                hardcoded_load_address = .;
    35                 LONG(0x80008000);
     35                LONG(0x80108000);
    3636                hardcoded_ktext_size = .;
    3737                LONG(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
     
    4242                kdata_end = .;
    4343        }
     44       
     45        _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
     46       
    4447}
  • arch/ia32/include/boot/boot.h

    r2793442 r5dce48b9  
    3030#define __ia32_BOOT_H__
    3131
     32#define BOOT_OFFSET     0x100000
    3233#define MULTIBOOT_HEADER_MAGIC          0x1BADB002
    3334#define MULTIBOOT_HEADER_FLAGS          0x00010003
  • arch/ia32/src/boot/boot.S

    r2793442 r5dce48b9  
    4343kernel_image_start:
    4444        cli
    45         xorw %ax,%ax
    46         movw %ax,%ds
    47         movw %ax,%ss                    # initialize stack segment register
    48         movl $0x7c00,%esp               # initialize stack pointer
     45        xorw %ax, %ax
     46        movw %ax, %ds
     47        movw %ax, %ss                   # initialize stack segment register
     48        movl $0x7c00, %esp              # initialize stack pointer
    4949       
    5050        call memmap_arch_init
     
    5252        lgdt gdtr                       # initialize Global Descriptor Table register
    5353       
    54         movl %cr0,%eax
    55         orl $0x1,%eax
    56         movl %eax,%cr0                  # switch to protected mode
    57         jmpl $8,$meeting_point
    58 
     54        movl %cr0, %eax
     55        orl $0x1, %eax
     56        movl %eax, %cr0                 # switch to protected mode
     57       
     58        jmpl $8, $boot_image_start
     59       
    5960.code32
    6061.align 4
     
    6364        .long MULTIBOOT_HEADER_FLAGS
    6465        .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)        # checksum
    65         .long multiboot_header
    66         .long unmapped_ktext_start
     66        .long multiboot_header + BOOT_OFFSET
     67        .long unmapped_ktext_start + BOOT_OFFSET
    6768        .long 0
    6869        .long 0
    69         .long multiboot_image_start
     70        .long multiboot_image_start + BOOT_OFFSET
     71       
     72boot_image_start:
     73        movw $16, %ax
     74        movw %ax, %es
     75        movw %ax, %gs
     76        movw %ax, %fs
     77        movw %ax, %ds                   # kernel data + stack
     78        movw %ax, %ss
     79       
     80        call map_kernel                 # map kernel and turn paging on
     81       
     82        movb $0xd1, %al                 # enable A20 using the keyboard controller
     83        outb %al, $0x64
     84        movb $0xdf, %al
     85        outb %al, $0x60
     86       
     87        movl $0x8000, %esi
     88        movl $0x8000 + BOOT_OFFSET, %edi
     89        movl $_hardcoded_kernel_size, %ecx
     90        cld
     91        rep movsb
     92       
     93        jmp protected
    7094       
    7195multiboot_image_start:
     
    7498        lgdt gdtr
    7599
    76 meeting_point:
    77         movw $16,%ax
    78         movw %ax,%es
    79         movw %ax,%gs
    80         movw %ax,%fs
    81         movw %ax,%ds                    # kernel data + stack
    82         movw %ax,%ss
    83 
     100        movw $16, %ax
     101        movw %ax, %es
     102        movw %ax, %gs
     103        movw %ax, %fs
     104        movw %ax, %ds                   # kernel data + stack
     105        movw %ax, %ss
     106       
    84107        call map_kernel                 # map kernel and turn paging on
    85 
     108       
     109protected:
    86110        call main_bsp                   # never returns
    87111
  • arch/ia32/src/drivers/i8042.c

    r2793442 r5dce48b9  
    3737/*
    3838 * i8042 processor driver.
    39  * Its very essential function is enabling the A20.
    4039 */
    4140
    4241void i8042_init(void)
    4342{
    44         /* A20: deadly if not enabled */
    45         outb(0x64,0xd1);
    46         outb(0x60,0xdf);
    47        
    4843        trap_register(VECTOR_KBD, i8042_interrupt);
    4944}
  • arch/ia32/src/ia32.c

    r2793442 r5dce48b9  
    6161                i8259_init();   /* PIC */
    6262                i8254_init();   /* hard clock */
    63 
     63               
    6464                trap_register(VECTOR_SYSCALL, syscall);
    6565               
  • arch/ia32/src/mm/frame.c

    r2793442 r5dce48b9  
    4545                frame_region_not_free(0xfec00000,0xffffffff);
    4646               
     47                /* This is a nasty hack, which should be fixed soon */
     48                frame_region_not_free(0x9000, 0xa000);
     49               
    4750                for (i=e820counter;i>0;i--) {
    4851                        if (e820table[i-1].type!=MEMMAP_MEMORY_AVAILABLE) {
  • arch/ia32/src/mm/page.c

    r2793442 r5dce48b9  
    3838#include <debug.h>
    3939#include <memstr.h>
     40#include <print.h>
    4041
    4142__address bootstrap_dba;
     
    5152
    5253                bootstrap_dba = dba;
    53 
     54               
    5455                /*
    5556                 * Identity mapping for all frames.
  • src/main/main.c

    r2793442 r5dce48b9  
    140140       
    141141        the_initialize(THE);
    142 
     142       
    143143        arch_pre_mm_init();
    144144        heap_init(config.base + hardcoded_ktext_size + hardcoded_kdata_size, CONFIG_HEAP_SIZE + heap_delta);
Note: See TracChangeset for help on using the changeset viewer.