Which sounds strange to me because it works on real hardware..
The problem occurred after I linked my second stage bootloader together with my first stage bootloader.. (they're both in 16-bit Assembly).
I use NASM to output two ELF executables: boot.o & krnldr.o my first and second stage bootloaders, respectively.
I then link boot.o and krnldr.o using a linkerscript & ld from whom I also produce a memory map of the final product, bootloader.o.
Finally I make bootloader.o binary, using objcopy.
This is my build script:
Code: Select all
@echo off
nasm -f elf -o ./bin/boot/boot.o ./src/boot/boot.asm
nasm -f elf -o ./bin/boot/krnldr.o ./src/boot/krnldr.asm
"C:/Mingw/bin/ld.exe" -T link.ld -Map ./bin/debug/boot/bootloader.map -o ./bin/boot/bootloader.o ./bin/boot/boot.o ./bin/boot/krnldr.o
"C:/Mingw/bin/objcopy.exe" -O binary ./bin/boot/bootloader.o ./bin/boot/bootloader.bin
"C:\Users\Benjamin\Downloads\rawwritewin-0.7\rawwritewin.exe" --write --copies 1 --drive 0 ./bin/boot/bootloader.bin
echo Script done!
pause
Code: Select all
SECTIONS
{
. = 0x7c00;
.boot :
{
*(.boot)
}
. = 0x0500;
.text :
{
*(.text .text.*)
}
.data :
{
*(.data .data.*)
}
.bss :
{
*(.bss .bss.*)
*(COMMON)
}
}
Code: Select all
[bits 16]
[section .boot]
boot:
Code: Select all
[bits 16]
[section .text]
main:
Code: Select all
.boot 0x00007c00 0x200
*(.boot)
.boot 0x00007c00 0x200 ./bin/boot/boot.o
0x00000500 . = 0x500
.text 0x00000500 0x200
*(.text .text.*)
.text 0x00000500 0x18 ./bin/boot/krnldr.o
.data
*(.data .data.*)
.bss
*(.bss .bss.*)
*(COMMON)
LOAD ./bin/boot/boot.o
LOAD ./bin/boot/krnldr.o
OUTPUT(./bin/boot/bootloader.o pei-i386)
Best regards,
Benjamin.