From: Jack Lange Date: Fri, 8 Feb 2008 22:26:31 +0000 (+0000) Subject: pulled out vmxassist, added linux kernel X-Git-Tag: JACK-WORKING-STATIC-GEEKOS~11 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=c6ae41adef1bd7d54bc7e74abc4a5438e203d754 pulled out vmxassist, added linux kernel --- diff --git a/palacios/build/Makefile b/palacios/build/Makefile index 541221d..7e9603a 100644 --- a/palacios/build/Makefile +++ b/palacios/build/Makefile @@ -1,6 +1,6 @@ # Makefile for GeekOS kernel, userspace, and tools # Copyright (c) 2004,2005 David H. Hovemeyer -# $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". @@ -31,7 +31,7 @@ VM_START := 0x0 # THE KERNEL, SETUP, BOOTPACKAGE MUST BE SMALLER THAN THIS # MUST BE INTEGRAL NUMBER OF PAGES # define -MAX_VMM := 0x60000 +MAX_VMM := 0x160000 # Base address of kernel # @@ -85,7 +85,7 @@ VMM_SIZES = ../include/geekos/vmm_sizes.h # List of targets to build by default. # These targets encompass everything needed to boot # and run GeekOS. -ALL_TARGETS := fd.img rombios vgabios vmxassist +ALL_TARGETS := fd.img VM_linux_kernel # Kernel source files @@ -139,8 +139,8 @@ COMMON_C_OBJS := $(COMMON_C_SRCS:%.c=common/%.o) #TARGET_CC_PREFIX := i386-elf- # Target C compiler. gcc 2.95.2 or later should work. -#TARGET_CC := $(TARGET_CC_PREFIX)gcc -TARGET_CC := $(TARGET_CC_PREFIX)gcc34 -m32 +TARGET_CC := $(TARGET_CC_PREFIX)gcc +#TARGET_CC := $(TARGET_CC_PREFIX)gcc34 -m32 # Host C compiler. This is used to compile programs to execute on # the host platform, not the target (x86) platform. On x86/ELF @@ -164,7 +164,7 @@ TARGET_NM := $(TARGET_CC_PREFIX)nm TARGET_OBJCOPY := $(TARGET_CC_PREFIX)objcopy # Nasm (http://nasm.sourceforge.net) -NASM := /opt/vmm-tools/bin/nasm +NASM := $(PROJECT_ROOT)/../devtools/bin/nasm AS = as --32 @@ -253,11 +253,10 @@ geekos/test: geekos/test.o geekos/vmcs.o geekos/vmx_lowlevel.o $(CC) geekos/test.o geekos/vmcs.o geekos/vmx_lowlevel.o -o geekos/test # Standard floppy image - just boots the kernel -fd.img : geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin rombios vgabios vmxassist +fd.img : geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin VM_linux_kernel cat geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin > _temp $(PAD) _temp 512 -# Note - second copy of rombios is intentional - cat _temp rombios vgabios vmxassist rombios > $@ + cat _temp VM_linux_kernel > $@ # make ready to boot over PXE pxe: fd.img @@ -282,14 +281,12 @@ pxe-discovery-bjp600: fd.img # Floppy boot sector (first stage boot loader). -geekos/fd_boot.bin : geekos/setup.bin geekos/kernel.bin $(PROJECT_ROOT)/src/geekos/fd_boot.asm rombios vgabios vmxassist +geekos/fd_boot.bin : geekos/setup.bin geekos/kernel.bin $(PROJECT_ROOT)/src/geekos/fd_boot.asm VM_linux_kernel $(NASM) -f bin \ -I$(PROJECT_ROOT)/src/geekos/ \ -DNUM_SETUP_SECTORS=`$(NUMSECS) geekos/setup.bin` \ -DNUM_KERN_SECTORS=`$(NUMSECS) geekos/kernel.bin` \ - -DNUM_BIOS_SECTORS=`$(NUMSECS) rombios` \ - -DNUM_VGA_BIOS_SECTORS=`$(NUMSECS) vgabios` \ - -DNUM_VMXASSIST_SECTORS=`$(NUMSECS) vmxassist` \ + -DNUM_VM_KERNEL_SECTORS=`$(NUMSECS) VM_linux_kernel` \ $(PROJECT_ROOT)/src/geekos/fd_boot.asm \ -o $@ @@ -320,20 +317,15 @@ generate_sizes: force echo "#ifndef __vmm_sizes" > $(VMM_SIZES) echo "#define __vmm_sizes" >> $(VMM_SIZES) echo "#define KERNEL_LOAD_ADDRESS " $(KERNEL_BASE_ADDR) >> $(VMM_SIZES) - echo "#define KERNEL_SETUP_LENGTH (" `$(NUMSECS) geekos/setup.bin` "*512)" >> $(VMM_SIZES) - echo "#define KERNEL_CORE_LENGTH (" `$(NUMSECS) geekos/kernel.bin` "*512)" >> $(VMM_SIZES) + echo "#define KERNEL_START (KERNEL_LOAD_ADDRESS)" >> $(VMM_SIZES) + echo "#define KERNEL_CORE_LENGTH (" `$(NUMSECS) geekos/kernel.bin` "*512)" >> $(VMM_SIZES) echo "#define KERNEL_END (KERNEL_LOAD_ADDRESS+KERNEL_CORE_LENGTH-1)" >> $(VMM_SIZES) - echo "#define BIOS_LENGTH (" `$(NUMSECS) rombios` "*512)" >> $(VMM_SIZES) - echo "#define VGA_BIOS_LENGTH (" `$(NUMSECS) vgabios` "*512)" >> $(VMM_SIZES) - echo "#define VMXASSIST_LENGTH (" `$(NUMSECS) vmxassist` "*512)" >> $(VMM_SIZES) - echo "#define BIOS_START (KERNEL_LOAD_ADDRESS+KERNEL_CORE_LENGTH)" >> $(VMM_SIZES) - echo "#define VGA_BIOS_START (BIOS_START+BIOS_LENGTH)" >> $(VMM_SIZES) - echo "#define VMXASSIST_START (VGA_BIOS_START+VGA_BIOS_LENGTH)" >> $(VMM_SIZES) - echo "//Note this is a second copy of the rom bios for debug" >> $(VMM_SIZES) - echo "#define BIOS2_START (VMXASSIST_START+VMXASSIST_LENGTH)" >> $(VMM_SIZES) - echo "#define VM_BOOT_PACKAGE_START (BIOS_START) " >> $(VMM_SIZES) - echo "#define VM_BOOT_PACKAGE_END (BIOS2_START+BIOS_LENGTH-1) " >> $(VMM_SIZES) + + echo "#define VM_KERNEL_LENGTH (" `$(NUMSECS) VM_linux_kernel` "*512)" >> $(VMM_SIZES) + echo "#define VM_KERNEL_START (KERNEL_LOAD_ADDRESS + KERNEL_CORE_LENGTH)" >> $(VMM_SIZES) + echo "#define VM_BOOT_PACKAGE_START (VM_KERNEL_START) " >> $(VMM_SIZES) + echo "#define VM_BOOT_PACKAGE_END (VM_KERNEL_START+VM_KERNEL_LENGTH-1) " >> $(VMM_SIZES) echo "#endif" >> $(VMM_SIZES) make_show_sizes: generate_sizes ../src/geekos/show_sizes.c @@ -349,31 +341,13 @@ get_kernel_size: make_show_sizes force: -rombios: force - (cd ../src/vmboot/rombios; make) - cp ../src/vmboot/rombios/BIOS-bochs-latest rombios - $(PAD) rombios 512 - @echo "Rom bios lives at f000:0000 and is" `$(NUMSECS) rombios` "sectors long" - - -vgabios: force - (cd ../src/vmboot/vgabios; make) - cp ../src/vmboot/vgabios/vgabios.bin vgabios - $(PAD) vgabios 512 - @echo "Vga bios lives at c000:0000 and is" `$(NUMSECS) vgabios` "sectors long" +VM_linux_kernel: force + $(PAD) VM_linux_kernel 512 + @echo "VM kernel lives at 0x100000 and is" `$(NUMSECS) VM_linux_kernel` "sectors long" -vmxassist: force - (cd ../src/vmboot/vmxassist; make) - cp ../src/vmboot/vmxassist/vmxassist.bin vmxassist - $(PAD) vmxassist 512 - @echo "vmxassist lives at d000:0000 and is" `$(NUMSECS) vmxassist` "sectors long" # Clean build directories of generated files clean : - rm -f rombios vgabios vmxassist - (cd ../src/vmboot/rombios; make clean) - (cd ../src/vmboot/vgabios; make clean) - (cd ../src/vmboot/vmxassist; make clean) for d in geekos common libc user tools; do \ (cd $$d && rm -f *); \ done diff --git a/palacios/build/VM_linux_kernel b/palacios/build/VM_linux_kernel new file mode 100644 index 0000000..ab2aec2 Binary files /dev/null and b/palacios/build/VM_linux_kernel differ diff --git a/palacios/build/depend.mak b/palacios/build/depend.mak index 08ba54f..e69de29 100644 --- a/palacios/build/depend.mak +++ b/palacios/build/depend.mak @@ -1,236 +0,0 @@ -geekos/idt.o: ../src/geekos/idt.c ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/idt.h \ - ../include/geekos/int.h ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h -geekos/int.o: ../src/geekos/int.c ../include/geekos/idt.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h ../include/geekos/vmcs.h \ - ../include/geekos/vmcs_gen.h ../include/geekos/cpu.h -geekos/trap.o: ../src/geekos/trap.c ../include/geekos/idt.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/kthread.h \ - ../include/geekos/list.h ../include/geekos/trap.h \ - ../include/geekos/serial.h ../include/geekos/irq.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h -geekos/irq.o: ../src/geekos/irq.c ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/idt.h ../include/geekos/int.h \ - ../include/geekos/defs.h ../include/geekos/io.h ../include/geekos/irq.h -geekos/io.o: ../src/geekos/io.c ../include/geekos/io.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h -geekos/keyboard.o: ../src/geekos/keyboard.c ../include/geekos/kthread.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/list.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/irq.h \ - ../include/geekos/int.h ../include/geekos/defs.h ../include/geekos/io.h \ - ../include/geekos/keyboard.h -geekos/screen.o: ../src/geekos/screen.c \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdarg.h \ - ../include/geekos/kassert.h ../include/geekos/screen.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/io.h ../include/geekos/int.h ../include/geekos/defs.h \ - ../include/geekos/fmtout.h ../include/geekos/../libc/fmtout.h -geekos/timer.o: ../src/geekos/timer.c \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/limits.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/syslimits.h \ - /usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h ../include/geekos/io.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/defs.h \ - ../include/geekos/irq.h ../include/geekos/kthread.h \ - ../include/geekos/list.h ../include/geekos/timer.h \ - ../include/geekos/serial.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h -geekos/mem.o: ../src/geekos/mem.c ../include/geekos/defs.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/kassert.h ../include/geekos/screen.h \ - ../include/geekos/bootinfo.h ../include/geekos/gdt.h \ - ../include/geekos/int.h ../include/geekos/malloc.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/mem.h ../include/geekos/list.h \ - ../include/geekos/paging.h ../include/geekos/vmm_sizes.h \ - ../include/geekos/serial.h ../include/geekos/irq.h \ - ../include/geekos/io.h -geekos/crc32.o: ../src/geekos/crc32.c ../include/geekos/crc32.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/kassert.h ../include/geekos/screen.h \ - ../include/geekos/serial.h ../include/geekos/irq.h \ - ../include/geekos/int.h ../include/geekos/defs.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - ../include/geekos/io.h -geekos/gdt.o: ../src/geekos/gdt.c ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/segment.h ../include/geekos/int.h \ - ../include/geekos/defs.h ../include/geekos/tss.h \ - ../include/geekos/gdt.h ../include/libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h -geekos/tss.o: ../src/geekos/tss.c ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/gdt.h \ - ../include/geekos/segment.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/tss.h ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/int.h ../include/geekos/io.h -geekos/segment.o: ../src/geekos/segment.c ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/tss.h ../include/geekos/segment.h -geekos/bget.o: ../src/geekos/bget.c ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/kassert.h ../include/geekos/screen.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/bget.h -geekos/malloc.o: ../src/geekos/malloc.c ../include/geekos/screen.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/defs.h ../include/geekos/bget.h \ - ../include/geekos/malloc.h -geekos/synch.o: ../src/geekos/synch.c ../include/geekos/kthread.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/list.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/int.h \ - ../include/geekos/defs.h ../include/geekos/synch.h -geekos/kthread.o: ../src/geekos/kthread.c ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/int.h \ - ../include/geekos/mem.h ../include/geekos/list.h \ - ../include/geekos/paging.h ../include/geekos/bootinfo.h \ - ../include/geekos/symbol.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/kthread.h ../include/geekos/malloc.h \ - ../include/geekos/serial.h ../include/geekos/irq.h \ - ../include/geekos/io.h -geekos/serial.o: ../src/geekos/serial.c ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/int.h \ - ../include/geekos/kassert.h ../include/geekos/screen.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h ../include/geekos/reboot.h \ - ../include/geekos/gdt.h ../include/geekos/idt.h -geekos/reboot.o: ../src/geekos/reboot.c ../include/geekos/reboot.h \ - ../include/libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h -geekos/paging.o: ../src/geekos/paging.c ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/defs.h ../include/geekos/idt.h \ - ../include/geekos/kthread.h ../include/geekos/list.h \ - ../include/geekos/mem.h ../include/geekos/paging.h \ - ../include/geekos/bootinfo.h ../include/geekos/malloc.h \ - ../include/geekos/gdt.h ../include/geekos/segment.h \ - ../include/geekos/crc32.h ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/io.h ../include/geekos/vmcs.h \ - ../include/geekos/vmcs_gen.h -geekos/vmx.o: ../src/geekos/vmx.c ../include/geekos/vmx.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/vmcs.h ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/int.h \ - ../include/geekos/kassert.h ../include/geekos/screen.h \ - ../include/geekos/defs.h ../include/geekos/string.h \ - ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h ../include/geekos/vmcs_gen.h \ - ../include/geekos/mem.h ../include/geekos/list.h \ - ../include/geekos/paging.h ../include/geekos/bootinfo.h \ - ../include/geekos/segment.h ../include/geekos/gdt.h \ - ../include/geekos/idt.h ../include/geekos/cpu.h \ - ../include/geekos/io_devs.h -geekos/vmcs_gen.o: ../src/geekos/vmcs_gen.c ../include/geekos/vmcs_gen.h \ - ../include/geekos/vmcs.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/serial.h ../include/geekos/irq.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/defs.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h -geekos/vmcs.o: ../src/geekos/vmcs.c ../include/geekos/vmcs.h \ - ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/serial.h ../include/geekos/irq.h \ - ../include/geekos/int.h ../include/geekos/kassert.h \ - ../include/geekos/screen.h ../include/geekos/defs.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/io.h ../include/geekos/vmcs_gen.h -geekos/main.o: ../src/geekos/main.c ../include/geekos/bootinfo.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/screen.h ../include/geekos/ktypes.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdbool.h \ - ../include/geekos/mem.h ../include/geekos/defs.h \ - ../include/geekos/list.h ../include/geekos/kassert.h \ - ../include/geekos/paging.h ../include/geekos/crc32.h \ - ../include/geekos/tss.h ../include/geekos/int.h \ - ../include/geekos/kthread.h ../include/geekos/trap.h \ - ../include/geekos/timer.h ../include/geekos/keyboard.h \ - ../include/geekos/io.h ../include/geekos/serial.h \ - ../include/geekos/irq.h ../include/geekos/reboot.h \ - ../include/geekos/vmx.h ../include/geekos/vmcs.h \ - ../include/geekos/vmcs_gen.h ../include/geekos/gdt.h \ - ../include/geekos/vmm_sizes.h -common/fmtout.o: ../src/common/fmtout.c \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdarg.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h \ - ../include/geekos/string.h ../include/geekos/../libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/limits.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/syslimits.h \ - /usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ - /usr/include/gnu/stubs-64.h /usr/include/bits/posix1_lim.h \ - /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/bits/posix2_lim.h ../include/geekos/fmtout.h \ - ../include/geekos/../libc/fmtout.h -common/string.o: ../src/common/string.c ../include/libc/fmtout.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stdarg.h \ - ../include/libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h -common/memmove.o: ../src/common/memmove.c ../include/libc/string.h \ - /usr/lib/gcc/x86_64-redhat-linux/3.4.6/include/stddef.h diff --git a/palacios/include/geekos/defs.h b/palacios/include/geekos/defs.h index bc631c1..e06cdf5 100644 --- a/palacios/include/geekos/defs.h +++ b/palacios/include/geekos/defs.h @@ -1,7 +1,7 @@ /* * Misc. kernel definitions * Copyright (c) 2001,2004 David H. Hovemeyer - * $Revision: 1.1 $ + * $Revision: 1.2 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -91,6 +91,8 @@ TOP_OF_MEM: #define VM_SIZE (0x20000000) // Where the VM starts in physical memory #define START_OF_VM (0x0) +// Where we load the vm's kernel image (1MB) +#define VM_KERNEL_TARGET (0x100000) @@ -114,16 +116,10 @@ TOP_OF_MEM: #define FINAL_KERNEL_START (IDT_LOCATION-MAX_VMM) #define FINAL_KERNEL_END (FINAL_KERNEL_START+KERNEL_CORE_LENGTH-1) -#define FINAL_BIOS_START (FINAL_KERNEL_START+KERNEL_CORE_LENGTH) -#define FINAL_BIOS_END (FINAL_BIOS_START+BIOS_LENGTH-1) -#define FINAL_VGA_BIOS_START (FINAL_BIOS_START+BIOS_LENGTH) -#define FINAL_VGA_BIOS_END (FINAL_VGA_BIOS_START+VGA_BIOS_LENGTH-1) -#define FINAL_VMXASSIST_START (FINAL_VGA_BIOS_START+VGA_BIOS_LENGTH) -#define FINAL_VMXASSIST_END (FINAL_VMXASSIST_START+VMXASSIST_LENGTH-1) -#define FINAL_BIOS2_START (FINAL_VMXASSIST_START+VMXASSIST_LENGTH) -#define FINAL_BIOS2_END (FINAL_BIOS2_START+BIOS_LENGTH-1) -#define FINAL_VMBOOTSTART (FINAL_BIOS_START) -#define FINAL_VMBOOTEND (FINAL_BIOS2_END) +#define FINAL_VM_KERNEL_START (FINAL_KERNEL_START+KERNEL_CORE_LENGTH) +#define FINAL_VM_KERNEL_END (FINAL_VM_KERNEL_START+VM_KERNEL_LENGTH-1) +#define FINAL_VMBOOTSTART (FINAL_VM_KERNEL_START) +#define FINAL_VMBOOTEND (VM_BOOT_PACKAGE_END) #if (FINAL_VMBOOTEND>IDT_LOCATION) #error VMM_MAX is too small! diff --git a/palacios/include/geekos/vmm_sizes.h b/palacios/include/geekos/vmm_sizes.h index 563267e..335d9f9 100644 --- a/palacios/include/geekos/vmm_sizes.h +++ b/palacios/include/geekos/vmm_sizes.h @@ -1,18 +1,11 @@ #ifndef __vmm_sizes #define __vmm_sizes -#define KERNEL_LOAD_ADDRESS 0x3ff9d000 -#define KERNEL_SETUP_LENGTH ( 1 *512) -#define KERNEL_CORE_LENGTH ( 203 *512) +#define KERNEL_LOAD_ADDRESS 0x3fe9d000 #define KERNEL_START (KERNEL_LOAD_ADDRESS) +#define KERNEL_CORE_LENGTH ( 187 *512) #define KERNEL_END (KERNEL_LOAD_ADDRESS+KERNEL_CORE_LENGTH-1) -#define BIOS_LENGTH ( 128 *512) -#define VGA_BIOS_LENGTH ( 55 *512) -#define VMXASSIST_LENGTH ( 41 *512) -#define BIOS_START (KERNEL_LOAD_ADDRESS+KERNEL_CORE_LENGTH) -#define VGA_BIOS_START (BIOS_START+BIOS_LENGTH) -#define VMXASSIST_START (VGA_BIOS_START+VGA_BIOS_LENGTH) -//Note this is a second copy of the rom bios for debug -#define BIOS2_START (VMXASSIST_START+VMXASSIST_LENGTH) -#define VM_BOOT_PACKAGE_START (BIOS_START) -#define VM_BOOT_PACKAGE_END (BIOS2_START+BIOS_LENGTH-1) +#define VM_KERNEL_LENGTH ( 1673 *512) +#define VM_KERNEL_START (KERNEL_LOAD_ADDRESS + KERNEL_CORE_LENGTH) +#define VM_BOOT_PACKAGE_START (VM_KERNEL_START) +#define VM_BOOT_PACKAGE_END (VM_KERNEL_START+VM_KERNEL_LENGTH-1) #endif diff --git a/palacios/src/geekos/defs.asm b/palacios/src/geekos/defs.asm index 362fc83..77993e4 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.1 $ +; $Revision: 1.2 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". @@ -19,6 +19,7 @@ TOP_OF_MEM equ 0x40000000 VM_SIZE equ 0x20000000 START_OF_VM equ 0x0 +VM_KERNEL_TARGET equ 0x100000 ; BIOS loads the boot sector at offset 0 in this segment BOOTSEG equ 0x07C0 diff --git a/palacios/src/geekos/fd_boot.asm b/palacios/src/geekos/fd_boot.asm index e541a9c..223fccd 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.1 $ +; $Revision: 1.2 $ ; This is free software. You are permitted to use, ; redistribute, and modify it as specified in the file "COPYING". @@ -286,7 +286,7 @@ kernelStart: ;; part of pfat boot record kernelSize: - dw NUM_KERN_SECTORS+2*NUM_BIOS_SECTORS+NUM_VGA_BIOS_SECTORS+NUM_VMXASSIST_SECTORS + dw NUM_KERN_SECTORS+NUM_VM_KERNEL_SECTORS ; Finish by writing the BIOS signature to mark this as diff --git a/palacios/src/geekos/main.c b/palacios/src/geekos/main.c index 71e5644..d89c8ce 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.2 $ + * $Revision: 1.3 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -307,15 +307,12 @@ void Main(struct Boot_Info* bootInfo) #if 1 - SerialPrint("Dumping VMXASSIST Code (first 512 bytes @ 0x%x)\n",VMXASSIST_START); - SerialMemDump((unsigned char *)VMXASSIST_START, 512); - SerialPrint("Dumping ROMBIOS Code (first 512 bytes @ 0x%x)\n",BIOS_START); - SerialMemDump((unsigned char *)BIOS_START, 512); - SerialPrint("Dumping ROMBIOS Code (Second copy) (first 512 bytes @ 0x%x)\n",BIOS2_START); - SerialMemDump((unsigned char *)BIOS2_START, 512); - SerialPrint("Dumping VGABIOS Code (first 512 bytes @ 0x%x)\n",VGA_BIOS_START); - SerialMemDump((unsigned char *)VGA_BIOS_START, 512); - + SerialPrint("Dumping VM kernel Code (first 512 bytes @ 0x%x)\n",VM_KERNEL_START); + SerialMemDump((unsigned char *)VM_KERNEL_START, 512); + /* + SerialPrint("Dumping kernel Code (first 512 bytes @ 0x%x)\n",KERNEL_START); + SerialMemDump((unsigned char *)VM_KERNEL_START, 512); + */ #endif @@ -395,25 +392,21 @@ void Main(struct Boot_Info* bootInfo) template_pte.globalPage=0; template_pte.kernelInfo=0; - SerialPrintLevel(1000,"Allocating Pages for VMXASSIST, BIOS, and VGA BIOS\n"); + SerialPrintLevel(1000,"Allocating Pages for VM kernel\n"); #define SEGLEN (1024*64) - AllocateAndMapPagesForRange(START_OF_VM+0xd0000, SEGLEN, template_pte); - AllocateAndMapPagesForRange(START_OF_VM+0xf0000, SEGLEN, template_pte); - AllocateAndMapPagesForRange(START_OF_VM+0xc0000, SEGLEN, template_pte); + AllocateAndMapPagesForRange(START_OF_VM+0x100000, VM_KERNEL_LENGTH / 512, template_pte); // Now we should be copying into actual memory - SerialPrintLevel(1000,"Copying VMXASSIST code from %x to %x (%d bytes)\n", VMXASSIST_START, START_OF_VM+0xd0000,VMXASSIST_LENGTH); - memcpy((char*)(START_OF_VM+0xd0000),(char*)VMXASSIST_START,VMXASSIST_LENGTH); - SerialPrintLevel(1000,"Copying BIOS (2nd copy) code from %x to %x (%d bytes)\n", BIOS2_START, START_OF_VM+0xf0000,BIOS_LENGTH); - memcpy((char*)(START_OF_VM+0xf0000),(char*)BIOS2_START,BIOS_LENGTH); - SerialPrintLevel(1000,"Copying VGA BIOS code from %x to %x (%d bytes)\n", VGA_BIOS_START, START_OF_VM+0xc0000,VGA_BIOS_LENGTH); - memcpy((char *)(START_OF_VM+0xc0000),(char*)VGA_BIOS_START,VGA_BIOS_LENGTH); + SerialPrintLevel(1000,"Copying VM code from %x to %x (%d bytes)\n", VM_KERNEL_START, START_OF_VM+0x100000,VM_KERNEL_LENGTH); + memcpy((char*)(START_OF_VM+0x100000),(char*)VM_KERNEL_START,VM_KERNEL_LENGTH); + + //SerialPrintLevel(1000, "VM copied\n"); // jump into vmxassist - vm.entry_ip=(uint_t)0xd0000; + vm.entry_ip=(uint_t)0x100000; vm.exit_eip=0; // Put the stack at 512K vm.guest_esp=(uint_t)START_OF_VM+1024*512; @@ -435,5 +428,3 @@ void Main(struct Boot_Info* bootInfo) /* Now this thread is done. */ Exit(0); } - - diff --git a/palacios/src/geekos/mem.c b/palacios/src/geekos/mem.c index 2fbc0f5..5698c07 100644 --- a/palacios/src/geekos/mem.c +++ b/palacios/src/geekos/mem.c @@ -2,7 +2,7 @@ * Physical memory allocation * Copyright (c) 2001,2003,2004 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth - * $Revision: 1.1 $ + * $Revision: 1.2 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -63,7 +63,7 @@ static void Add_Page_Range(ulong_t start, ulong_t end, int flags) { ulong_t addr; - //Print("Start: %u, End: %u\n", (unsigned int)start, (unsigned int)end); + PrintBoth("Start: %u, End: %u\n", (unsigned int)start, (unsigned int)end); KASSERT(Is_Page_Multiple(start)); KASSERT(Is_Page_Multiple(end)); @@ -116,6 +116,7 @@ void Init_Mem(struct Boot_Info* bootInfo) ulong_t pageListEnd; ulong_t kernEnd; + KASSERT(bootInfo->memSizeKB > 0); if (bootInfo->memSizeKB != TOP_OF_MEM/1024) { @@ -187,9 +188,10 @@ void Init_Mem(struct Boot_Info* bootInfo) PrintBoth("Pagelist addr: %p\n", g_pageList); PrintBoth("index: %p\n", &g_pageList[3]); PrintBoth("direct offset: %p\n", g_pageList + (sizeof(struct Page) * 2)); - PrintBoth("Kernel Size=%lx\n", (kernEnd - KERNEL_START_ADDR)); - PrintBoth("Kernel Start=%x\n", KERNEL_START_ADDR); + // PrintBoth("Kernel Size=%lx\n", (kernEnd - KERNEL_START_ADDR)); + // PrintBoth("Kernel Start=%x\n", KERNEL_START_ADDR); PrintBoth("Kernel End=%lx\n", kernEnd); + //PrintBoth("end=%x\n", end); PrintBoth("VM Boot Package Start=%x\n", VM_BOOT_PACKAGE_START); PrintBoth("VM Boot Package End=%x\n", VM_BOOT_PACKAGE_END); @@ -217,7 +219,9 @@ void Init_Mem(struct Boot_Info* bootInfo) // The VM region... 0 .. VM size is out of bounds KASSERT(START_OF_VM==0); + Add_Page_Range(START_OF_VM, START_OF_VM+VM_SIZE, PAGE_VM); + //PrintBoth("hello1\n"); // The kernel is still in low memory at this point, in the VM region // Thus we will mark it as kernel use // Add_Page_Range(KERNEL_START_ADDR, kernEnd, PAGE_KERN); @@ -268,14 +272,12 @@ void Init_Mem(struct Boot_Info* bootInfo) PrintBoth("%lx to %lx - PAGE LIST\n",pageListAddr,pageListEnd-1); PrintBoth("%lx to %x - FREE\n",pageListEnd,FINAL_KERNEL_START-1); PrintBoth("%x to %x - KERNEL CODE\n",FINAL_KERNEL_START,FINAL_KERNEL_END); - PrintBoth("%x to %x - BIOS\n",FINAL_BIOS_START,FINAL_BIOS_END); - PrintBoth("%x to %x - VGABIOS\n",FINAL_VGA_BIOS_START,FINAL_VGA_BIOS_END); - PrintBoth("%x to %x - VMXASSIST\n",FINAL_VMXASSIST_START,FINAL_VMXASSIST_END); - PrintBoth("%x to %x - BIOS (2nd copy)\n",FINAL_BIOS2_START,FINAL_BIOS2_END); + PrintBoth("%x to %x - VM_KERNEL\n", FINAL_VM_KERNEL_START, FINAL_VM_KERNEL_END); PrintBoth("%x to %x - IDT\n",IDT_LOCATION,TSS_LOCATION-1); PrintBoth("%x to %x - TSS\n",TSS_LOCATION,GDT_LOCATION-1); PrintBoth("%x to %x - GDT\n",GDT_LOCATION,TOP_OF_MEM-1); + } /*