Changeset 32f6e1bd in mainline for arch/ia32/src


Ignore:
Timestamp:
2005-09-02T15:09:55Z (21 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.

Location:
arch/ia32/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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");
Note: See TracChangeset for help on using the changeset viewer.