From: Maxim Baryshnikov Date: Fri, 1 Apr 2016 11:00:48 +0000 (+0200) Subject: fiasco: bootstrap: some other sort of tries. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/jailhouse-test.git/commitdiff_plain/00efadd0203bc1e77ca8bb638f1fe1b84461fd12 fiasco: bootstrap: some other sort of tries. --- diff --git a/bootstrap-relink/boot.S b/bootstrap-relink/boot.S index ef13a9f..db379e6 100644 --- a/bootstrap-relink/boot.S +++ b/bootstrap-relink/boot.S @@ -8,6 +8,7 @@ * Please see the COPYING-GPL-2 file for details. */ /* -*- c -*- */ +#define REALMODE_LOADING .globl _start .p2align 4 diff --git a/bootstrap-relink/bootstrap32.ld b/bootstrap-relink/bootstrap32.ld index 9c19255..7c81ccd 100644 --- a/bootstrap-relink/bootstrap32.ld +++ b/bootstrap-relink/bootstrap32.ld @@ -1,7 +1,12 @@ ENTRY(_start) SECTIONS { - . = 0x00000000; + . = 0; + .dumpsection : + { + + } = 0x00 + . = 0x01000000; _image_start = .; .text : { @@ -24,7 +29,6 @@ SECTIONS } /DISCARD/ : { - *(.note.gnu.build-id) *(.interp) *(.comment) *(.note) diff --git a/bootstrap-relink/header-32-inmate.S b/bootstrap-relink/header-32-inmate.S index 054ac70..ca4b771 100644 --- a/bootstrap-relink/header-32-inmate.S +++ b/bootstrap-relink/header-32-inmate.S @@ -13,7 +13,6 @@ .section ".boot", "ax" .globl __reset_entry - .extern _start __reset_entry: ljmp $0xf000,$start16 @@ -32,7 +31,9 @@ start16: .code32 start32: - mov %cr4,%eax + .extern _start + +/* mov %cr4,%eax or $X86_CR4_PSE,%eax mov %eax,%cr4 @@ -77,7 +78,7 @@ start32: mov $bss_start,%edi mov $bss_dwords,%ecx rep stosl - +*/ mov $_start,%ebx call_entry: @@ -124,4 +125,4 @@ gdt_ptr: .global loader_pdpt loader_pdpt: .long 0x00000083 - .align(4096) \ No newline at end of file + .align(4096) diff --git a/bootstrap-relink/link_objects.sh b/bootstrap-relink/link_objects.sh index 7bc23b4..1458407 100755 --- a/bootstrap-relink/link_objects.sh +++ b/bootstrap-relink/link_objects.sh @@ -104,24 +104,25 @@ gcc -m32 -o $BUILD_DIR/boot.o32 -c \ ./boot.S echo "[bootstrap32] Linking final image.." +cd $BUILD_DIR gcc -m32 -o $BUILD_DIR/bootstrap32.elf -nostdlib -static \ -Wl,-T,$LD_SCRIPT32,--gc-sections \ - $BUILD_DIR/boot.o32 \ + boot.o32 \ $BOOTST_OBJ_DIR/boot_idt.o32 \ $BOOTST_OBJ_DIR/boot_cpu.o32 \ $BOOTST_OBJ_DIR/boot_kernel.o32 \ $BOOTST_OBJ_DIR/load_elf.o32 \ $BOOTST_OBJ_DIR/minilibc_support.o32 \ $BOOTST_OBJ_DIR/bootstrap32.bin \ - $BUILD_DIR/header-32-inmate.o\ + header-32-inmate.o\ $LD_SCRIPT32 \ $SNAP_DIR/obj/l4/amd64/pkg/bootstrap/server/src/ARCH-amd64/libc32/OBJ-amd64_K8/libc32.a \ -lgcc -chmod 755 $BUILD_DIR/bootstrap32.elf +chmod 755 bootstrap32.elf #objdump -D $BUILD_DIR/bootstrap32.elf > disasms/bootstrap32.elf.s -objcopy -O binary $BUILD_DIR/bootstrap32.elf $BUILD_DIR/bootstrap32-jh.bin -cp $BUILD_DIR/bootstrap32-jh.bin ../buildroot-overlay/jailhouse/bootstrap32-jh.bin +objcopy -O binary bootstrap32.elf bootstrap32-jh.bin +cp bootstrap32-jh.bin $START_DIR/../buildroot-overlay/jailhouse/bootstrap32-jh.bin echo done!