Rev 233 | Rev 372 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 233 | Rev 243 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | #include <arch/boot/memmap.h> |
29 | #include <arch/boot/memmap.h> |
30 | #include <arch/mm/memory_init.h> |
30 | #include <arch/mm/memory_init.h> |
31 | #include <arch/mm/page.h> |
31 | #include <arch/mm/page.h> |
32 | #include <print.h> |
32 | #include <print.h> |
33 | 33 | ||
- | 34 | __u8 e820counter __attribute__ ((section ("BOOT_DATA"))) = 0xff; |
|
- | 35 | struct e820memmap_ e820table[MEMMAP_E820_MAX_RECORDS] __attribute__ ((section ("BOOT_DATA"))) ; |
|
- | 36 | ||
34 | size_t get_memory_size(void) |
37 | size_t get_memory_size(void) |
35 | { |
38 | { |
36 | return e801memorysize*1024; |
39 | return e801memorysize*1024; |
37 | } |
40 | } |
38 | 41 | ||
39 | void memory_print_map(void) |
42 | void memory_print_map(void) |
40 | { |
43 | { |
41 | __u8 i; |
44 | __u8 i; |
42 | 45 | ||
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--) { |
46 | for (i=e820counter;i>0;i--) { |
51 | printf("E820 base: %Q size: %Q type: ", memtable[i-1].base_address, memtable[i-1].size); |
47 | printf("E820 base: %Q size: %Q type: ", e820table[i-1].base_address, e820table[i-1].size); |
52 | switch (memtable[i-1].type) { |
48 | switch (e820table[i-1].type) { |
53 | case MEMMAP_MEMORY_AVAILABLE: |
49 | case MEMMAP_MEMORY_AVAILABLE: |
54 | printf("available memory\n"); |
50 | printf("available memory\n"); |
55 | break; |
51 | break; |
56 | case MEMMAP_MEMORY_RESERVED: |
52 | case MEMMAP_MEMORY_RESERVED: |
57 | printf("reserved memory\n"); |
53 | printf("reserved memory\n"); |