X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=bios%2Fvmxassist%2Fhead.S;h=3af285eadad24481e4f82add0cbf7109fd22f5eb;hp=b183fac54eab2cb5f2479a26bc13410588b3f877;hb=61597ea2c5ccace036d8a65e429e32b8f8a7ed4a;hpb=f3eb8bbb7c58c98b03797f2188e6c1d2a7610c15 diff --git a/bios/vmxassist/head.S b/bios/vmxassist/head.S index b183fac..3af285e 100644 --- a/bios/vmxassist/head.S +++ b/bios/vmxassist/head.S @@ -25,81 +25,13 @@ * switch happens to the environment below. The magic indicates * that this is a valid context. */ -#ifdef TEST - .byte 0x55, 0xaa - .byte 0x80 - .code16 - jmp _start16 -#else jmp _start -#endif .align 8 .long VMXASSIST_MAGIC .long newctx /* new context */ .long oldctx /* old context */ -#ifdef TEST -/* - * We are running in 16-bit. Get into the protected mode as soon as - * possible. We use our own (minimal) GDT to get started. - * - * ROM is a misnomer as this code isn't really rommable (although it - * only requires a few changes) but it does live in a BIOS ROM segment. - * This code allows me to debug vmxassists under (a modified version of) - * Bochs and load it as a "optromimage1". - */ - .code16 - .globl _start16 -_start16: - cli - - /* load our own global descriptor table */ - data32 addr32 lgdt %cs:(rom_gdtr - TEXTADDR) - - /* go to protected mode */ - movl %cr0, %eax - orl $CR0_PE, %eax - movl %eax, %cr0 - data32 ljmp $0x08, $1f - - .align 32 - .globl rom_gdt -rom_gdt: - .word 0, 0 /* 0x00: reserved */ - .byte 0, 0, 0, 0 - - .word 0xFFFF, 0 /* 0x08: CS 32-bit */ - .byte 0, 0x9A, 0xCF, 0 - - .word 0xFFFF, 0 /* 0x10: CS 32-bit */ - .byte 0, 0x92, 0xCF, 0 -rom_gdt_end: - - .align 4 - .globl rom_gdtr -rom_gdtr: - .word rom_gdt_end - rom_gdt - 1 - .long rom_gdt - - .code32 -1: - /* welcome to the 32-bit world */ - movw $0x10, %ax - movw %ax, %ds - movw %ax, %es - movw %ax, %ss - movw %ax, %fs - movw %ax, %gs - - /* enable Bochs debug facilities */ - movw $0x8A00, %dx - movw $0x8A00, %ax - outw %ax, (%dx) - - jmp _start -#endif /* TEST */ - /* * This is the real start. Control was transfered to this point * with CR0_PE set and executing in some 32-bit segment. We call @@ -111,9 +43,6 @@ _start: cli /* save register parameters to C land */ -#ifdef TEST - xorl %edx, %edx -#endif /* clear bss */ cld @@ -130,7 +59,7 @@ _start: clts /* setup my own stack */ - movl $stack_top - 4*4, %esp + movl $stack_top, %esp movl %esp, %ebp /* go ... */ @@ -145,11 +74,6 @@ _start: halt: push $halt_msg call printf -#ifdef TEST - movw $0x8A00, %dx - movw $0x8AE0, %ax - outw %ax, (%dx) -#endif cli jmp .