From: Peter Dinda Date: Mon, 11 Feb 2008 22:00:27 +0000 (+0000) Subject: Partially working - looking at the load sector for vm kernel X-Git-Tag: JACK-WORKING-STATIC-GEEKOS~7 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=291ff6cdccbaf928d7cfd094bc67fe666f49de2c Partially working - looking at the load sector for vm kernel --- diff --git a/palacios/src/geekos/defs.asm b/palacios/src/geekos/defs.asm index 0135f31..73483b6 100644 --- a/palacios/src/geekos/defs.asm +++ b/palacios/src/geekos/defs.asm @@ -1,6 +1,6 @@ ; Definitions for use in GeekOS boot code ; Copyright (c) 2001, David H. Hovemeyer -; $Revision: 1.3 $ +; $Revision: 1.4 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". @@ -23,7 +23,7 @@ VM_KERNEL_TARGET equ 0x100000 ; BIOS loads the boot sector at offset 0 in this segment BOOTSEG equ 0x07C0 - + ; We'll move the boot sector up to higher memory. ; Note that the "ISA hole" begins at segment 0xA000 == 640K. INITSEG equ 0x9000 @@ -40,7 +40,7 @@ KERNSEG equ 0x1000 ;; Note that this segment must not colide with where the VMM kernel ;; is initially loaded. At this point, we just place it in the last ;; 64K of RAM available before the ISA hole and hope for the best -VMSEG equ 0x9000 ; +VMSEG equ 0x8000 ; ; Size of PFAT boot record. ; Keep up to date with . diff --git a/palacios/src/geekos/fd_boot.asm b/palacios/src/geekos/fd_boot.asm index 0c0e5ec..9df0880 100644 --- a/palacios/src/geekos/fd_boot.asm +++ b/palacios/src/geekos/fd_boot.asm @@ -1,7 +1,7 @@ ; Boot sector for GeekOS ; Copyright (c) 2001,2004 David H. Hovemeyer ; Copyright (c) 2003, Jeffrey K. Hollingsworth -; $Revision: 1.3 $ +; $Revision: 1.4 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". @@ -162,9 +162,9 @@ load_vm: mov ax, VMSEG ; ...to get base relative to VMSEG push ax ; 2nd param to ReadSector (seg base) - mov dx, ax - call PrintHex - call PrintNL +; mov dx, ax ; +; call PrintHex +; call PrintNL mov ax, 2000h ; Always write at the start of the segment push ax ; 3rd parameter @@ -177,7 +177,14 @@ load_vm: call ReadSector add sp, 6 ; clear 3 word params + push 9000h + pop es + mov dx, word [es:2000] ; + call PrintHex + call PrintNL + + ; execute bios call @@ -191,6 +198,7 @@ load_vm: mov si, bootsect_gdt mov ax, 0x8700 ; int 0x15 + adc ax, 0 mov dx, ax call PrintHex @@ -222,8 +230,11 @@ load_vm: mov bx, word [max_sector] cmp word [sec_count], bx + + jmp .out jl .again2 +.out: ; Now we've loaded the setup code and the kernel image. ; Jump to setup code. jmp SETUPSEG:0 diff --git a/palacios/src/geekos/main.c b/palacios/src/geekos/main.c index c0410c1..7066111 100644 --- a/palacios/src/geekos/main.c +++ b/palacios/src/geekos/main.c @@ -3,7 +3,7 @@ * Copyright (c) 2001,2003,2004 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth * Copyright (c) 2004, Iulian Neamtiu - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -283,7 +283,7 @@ void Main(struct Boot_Info* bootInfo) ulong_t doIBuzz = 0; - while(1); + while(1); Init_BSS(); @@ -320,8 +320,8 @@ void Main(struct Boot_Info* bootInfo) #endif #if 1 - SerialPrint("Dumping GUEST KERNEL CODE (first 512 bytes @ 0x100000)\n"); - SerialMemDump((unsigned char *)0x100000, 512); + SerialPrint("Dumping GUEST KERNEL CODE (first 512*10 bytes @ 0x100000)\n"); + SerialMemDump((unsigned char *)0x100000, 512*10); #endif while(1);