Bootloader + OS... Creates disk image to boot from bochs.
Posted: Wed Nov 30, 2016 8:55 am
Helle folks,
I created a very simple bootloader. The only thing this bootloader does is show a message.
To run with Bochs this bootloader I create a bin file:
as --32 -o bootloader.o bootloader.s
ld -Ttext=0x7c00 -melf_i386 bootloader.o -o bootloader.elf
objcopy -O binary bootloader.elf bootloader.bin
Now I am trying to load a really simple OS from this bootloader using BIOS int. The stupid OS is:
The question is. How can I create a disk image with bootloader inside the first 512 bytes (first sector) and the OS in the second sector?
From bootloader I am trying to load the second sector (the OS) in 0x1000 memory position.
Thank you.
PS/ I am trying follow this example: https://github.com/appusajeev/os-dev-16 but I get "Error loading OS sector".
I created a very simple bootloader. The only thing this bootloader does is show a message.
To run with Bochs this bootloader I create a bin file:
as --32 -o bootloader.o bootloader.s
ld -Ttext=0x7c00 -melf_i386 bootloader.o -o bootloader.elf
objcopy -O binary bootloader.elf bootloader.bin
Now I am trying to load a really simple OS from this bootloader using BIOS int. The stupid OS is:
Code: Select all
.code16
.section .text
mov $0x5, %dx
From bootloader I am trying to load the second sector (the OS) in 0x1000 memory position.
Thank you.
PS/ I am trying follow this example: https://github.com/appusajeev/os-dev-16 but I get "Error loading OS sector".