Signed-off-by: Gleb Natapov <[EMAIL PROTECTED]> --- bios/Makefile | 1 + bios/rombios.c | 17 +---------------- bios/rombios32.ld | 8 +++----- bios/rombios32start.S | 9 ++++++++- 4 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/bios/Makefile b/bios/Makefile index 48022ea..f3f2758 100644 --- a/bios/Makefile +++ b/bios/Makefile @@ -106,6 +106,7 @@ rombios32.o: rombios32.c acpi-dsdt.hex acpi-dsdt.hex: acpi-dsdt.dsl cpp -P $< $<.i iasl -tc -p $@ $<.i + sed -i -e's/^unsigned/const unsigned/' $@ rm $<.i rombios32start.o: rombios32start.S diff --git a/bios/rombios.c b/bios/rombios.c index 5c75043..340af30 100644 --- a/bios/rombios.c +++ b/bios/rombios.c @@ -10052,13 +10052,6 @@ rombios32_05: mov gs, ax cld - ;; copy rombios32 code to ram (ram offset = 1MB) - mov esi, #0xfffe0000 - mov edi, #0x00040000 - mov ecx, #0x10000 / 4 - rep - movsd - ;; init the stack pointer mov esp, #0x00080000 @@ -10067,17 +10060,9 @@ rombios32_05: push #0x04b2 ;; call rombios32 code - mov eax, #0x00040000 + mov eax, #0x000e0000 call eax - ;; reset the memory (some boot loaders such as syslinux suppose - ;; that the memory is set to zero) - mov edi, #0x00040000 - mov ecx, #0x40000 / 4 - xor eax, eax - rep - stosd - ;; return to 16 bit protected mode first db 0xea dd rombios32_10 diff --git a/bios/rombios32.ld b/bios/rombios32.ld index 4f8fcc3..c334225 100644 --- a/bios/rombios32.ld +++ b/bios/rombios32.ld @@ -3,18 +3,16 @@ OUTPUT_ARCH(i386) ENTRY(_start); SECTIONS { - . = 0x00040000; + . = 0x000e0000; .text : { *(.text) } .rodata : { *(.rodata) } . = ALIGN(64); fixup_start = .; .fixup : { *(.fixup) } fixup_end = .; - . = ALIGN(4096); - .data : { *(.data) } - __bss_start = . ; - .bss : { *(.bss) *(COMMON) } _end = . ; + .data 0x700 : AT (_end) { __data_start = .; *(.data); __data_end = .;} + .bss : { __bss_start = .; *(.bss) *(COMMON); __bss_end = .;} /DISCARD/ : { *(.stab) *(.stabstr) *(.comment) diff --git a/bios/rombios32start.S b/bios/rombios32start.S index 4dcee3a..449a5db 100644 --- a/bios/rombios32start.S +++ b/bios/rombios32start.S @@ -32,10 +32,17 @@ _start: /* clear bss section */ xor %eax, %eax mov $__bss_start, %edi - mov $_end, %ecx + mov $__bss_end, %ecx sub %edi, %ecx rep stosb + /* copy data section */ + mov $_end, %esi + mov $__data_start, %edi + mov $__data_end, %ecx + sub %edi, %ecx + rep movsb + jmp rombios32_init .code16 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html