]> rtime.felk.cvut.cz Git - jailhouse-test.git/commitdiff
fiasco: bootstrap: some other sort of tries.
authorMaxim Baryshnikov <barysmax@fel.cvut.cz>
Fri, 1 Apr 2016 11:00:48 +0000 (13:00 +0200)
committerMaxim Baryshnikov <barysmax@fel.cvut.cz>
Fri, 1 Apr 2016 11:00:48 +0000 (13:00 +0200)
bootstrap-relink/boot.S
bootstrap-relink/bootstrap32.ld
bootstrap-relink/header-32-inmate.S
bootstrap-relink/link_objects.sh

index ef13a9fd4b2517a625c1847d9678486b428a7b71..db379e6b1c4d7e7c6317c16090d9cef4d91f17fc 100644 (file)
@@ -8,6 +8,7 @@
  * Please see the COPYING-GPL-2 file for details.
  */
 /* -*- c -*- */
+#define REALMODE_LOADING
 
        .globl  _start
        .p2align 4
index 9c192556bf7c6e582decdb3855b8bba2b2fe3028..7c81ccd95537a520ec2592ffe8bb7b4c0c593a70 100644 (file)
@@ -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)
index 054ac70fd5fe3af19a9d8e222061981d45c8a9a7..ca4b771fa18724ccd243804977071c552512208c 100644 (file)
@@ -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)
index 7bc23b427bc33f582b5fe56a5612cb96ff7697fb..145840754b76e95d663a0bb0f15b17dc7210234e 100755 (executable)
@@ -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!