Changeset 32f6e1bd in mainline


Ignore:
Timestamp:
2005-09-02T15:09:55Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
375237d1
Parents:
7df54df
Message:

Resolved mapping of e820 boot area, so that it can be accessed as
e820table from 32-bit mode and e820table_boot from real mode.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/_link.ld

    r7df54df r32f6e1bd  
    2525        .mapped (0xffffffff80000000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) {
    2626                ktext_start = .;
     27                *(BOOT_DATA);
    2728                *(.text);
    2829                ktext_end = .;
     
    4344                kdata_end = .;
    4445        }
     46        _map_address = 0xffffffff80000000;
     47        e820table_boot = e820table - _map_address;
     48        e820counter_boot = e820counter - _map_address;
    4549}
  • arch/ia32/_link.ld

    r7df54df r32f6e1bd  
    2525        .mapped (0x80100000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) {
    2626                ktext_start = .;
     27                *(BOOT_DATA)
    2728                *(.text);
    2829                ktext_end = .;
     
    4445       
    4546        _hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
    46        
     47
     48        _map_address = 0x80100000;
     49        e820table_boot = e820table - _map_address;
     50        e820counter_boot = e820counter - _map_address;
    4751}
  • arch/ia32/src/boot/memmap.S

    r7df54df r32f6e1bd  
    3535
    3636.global memmap_arch_init
    37 .global e820counter
    38 .global e820table
    3937.global e801memorysize
    4038
     
    4846        movw    %bx,%ds
    4947        movw    %bx,%es
    50         movw    $e820table,%di
    51         movb    $E820_MAX_RECORDS,e820counter
     48        movw    $e820table_boot,%di
     49        movb    $E820_MAX_RECORDS,e820counter_boot
    5250e820loop:       
    5351        movl    $E820_SMAP,%edx         # control sequence "SMAP"
     
    6866        movw    %ax,%di
    6967               
    70         decb    e820counter # buffer is full
     68        decb    e820counter_boot # buffer is full
    7169        jz      e820end
    7270       
     
    7674e820end:
    7775        movb    $E820_MAX_RECORDS,%al
    78         subb    e820counter,%al
    79         movb    %al,e820counter # store # of valid entries in e820counter
     76        subb    e820counter_boot,%al
     77        movb    %al,e820counter_boot # store # of valid entries in e820counter
    8078
    8179        jmp     e801begin
    8280
    8381e820err:
    84         movb    $0,e820counter
     82        movb    $0,e820counter_boot
    8583
    8684# method e801 - get size of memory
     
    118116e801memorysize:
    119117        .long   0
    120 
    121 e820counter:
    122         .byte 0xff
    123 
    124 e820table:
    125         .space  (32*E820_RECORD_SIZE),0xff # space for 32 records, each E820_RECORD_SIZE bytes long
     118       
  • arch/ia32/src/mm/memory_init.c

    r7df54df r32f6e1bd  
    3232#include <print.h>
    3333
     34__u8 e820counter __attribute__ ((section ("BOOT_DATA"))) = 0xff;
     35struct e820memmap_ e820table[MEMMAP_E820_MAX_RECORDS] __attribute__ ((section ("BOOT_DATA"))) ;
     36
    3437size_t get_memory_size(void)
    3538{
     
    4144        __u8 i;
    4245       
    43         /*
    44          * We must not work with the original addresses for they are not mapped anymore.
    45          */
    46         struct e820memmap_ *memtable = (struct e820memmap_ *) PA2KA(e820table);
    47         __u32 *counter_p = (__u32 *) PA2KA(&e820counter);
    48        
    49        
    50         for (i=*counter_p;i>0;i--) {
    51                 printf("E820 base: %Q size: %Q type: ", memtable[i-1].base_address, memtable[i-1].size);
    52                 switch (memtable[i-1].type) {
     46        for (i=e820counter;i>0;i--) {
     47                printf("E820 base: %Q size: %Q type: ", e820table[i-1].base_address, e820table[i-1].size);
     48                switch (e820table[i-1].type) {
    5349                        case MEMMAP_MEMORY_AVAILABLE:
    5450                                printf("available memory\n");
  • src/build.amd64

    r7df54df r32f6e1bd  
    1010cd ../arch
    1111for a in drivers bios mm/frame.c mm/tlb.c mm/memory_init.c boot/memmap.S; do
    12   echo ln -sf `pwd`/ia32/src/$a amd64/src/$a
    13   ln -sf `pwd`/ia32/src/$a amd64/src/$a
     12  if [ \! -e amd64/src/$a ]; then
     13    echo ln -sf `pwd`/ia32/src/$a amd64/src/$a
     14    ln -sf `pwd`/ia32/src/$a amd64/src/$a
     15  fi
    1416done
    1517
    1618for a in ega.h i8042.h i8259.h i8254.h interrupt.h bios mm/memory_init.h; do
    17   echo ln -sf `pwd`/ia32/include/$a amd64/include/$a
    18   ln -sf `pwd`/ia32/include/$a amd64/include/$a
     19  if [ \! -e amd64/include/$a ]; then
     20    echo ln -sf `pwd`/ia32/include/$a amd64/include/$a
     21    ln -sf `pwd`/ia32/include/$a amd64/include/$a
     22  fi
    1923done
    2024)
Note: See TracChangeset for help on using the changeset viewer.