Changeset 32f6e1bd in mainline
- Timestamp:
- 2005-09-02T15:09:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 375237d1
- Parents:
- 7df54df
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/_link.ld
r7df54df r32f6e1bd 25 25 .mapped (0xffffffff80000000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) { 26 26 ktext_start = .; 27 *(BOOT_DATA); 27 28 *(.text); 28 29 ktext_end = .; … … 43 44 kdata_end = .; 44 45 } 46 _map_address = 0xffffffff80000000; 47 e820table_boot = e820table - _map_address; 48 e820counter_boot = e820counter - _map_address; 45 49 } -
arch/ia32/_link.ld
r7df54df r32f6e1bd 25 25 .mapped (0x80100000+SIZEOF(.unmapped)+0x8000) : AT (0x8000+SIZEOF(.unmapped)) { 26 26 ktext_start = .; 27 *(BOOT_DATA) 27 28 *(.text); 28 29 ktext_end = .; … … 44 45 45 46 _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; 47 51 } -
arch/ia32/src/boot/memmap.S
r7df54df r32f6e1bd 35 35 36 36 .global memmap_arch_init 37 .global e820counter38 .global e820table39 37 .global e801memorysize 40 38 … … 48 46 movw %bx,%ds 49 47 movw %bx,%es 50 movw $e820table ,%di51 movb $E820_MAX_RECORDS,e820counter 48 movw $e820table_boot,%di 49 movb $E820_MAX_RECORDS,e820counter_boot 52 50 e820loop: 53 51 movl $E820_SMAP,%edx # control sequence "SMAP" … … 68 66 movw %ax,%di 69 67 70 decb e820counter # buffer is full68 decb e820counter_boot # buffer is full 71 69 jz e820end 72 70 … … 76 74 e820end: 77 75 movb $E820_MAX_RECORDS,%al 78 subb e820counter ,%al79 movb %al,e820counter # store # of valid entries in e820counter76 subb e820counter_boot,%al 77 movb %al,e820counter_boot # store # of valid entries in e820counter 80 78 81 79 jmp e801begin 82 80 83 81 e820err: 84 movb $0,e820counter 82 movb $0,e820counter_boot 85 83 86 84 # method e801 - get size of memory … … 118 116 e801memorysize: 119 117 .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 32 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 37 size_t get_memory_size(void) 35 38 { … … 41 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--) { 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) { 53 49 case MEMMAP_MEMORY_AVAILABLE: 54 50 printf("available memory\n"); -
src/build.amd64
r7df54df r32f6e1bd 10 10 cd ../arch 11 11 for 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 14 16 done 15 17 16 18 for 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 19 23 done 20 24 )
Note:
See TracChangeset
for help on using the changeset viewer.