I'm currently working on a basic OS for a university assignment. I am working in x86 assembly language. I seem to have an issue with switching to the second stage of my boot-loader, resulting in the error above when I try to run the application in Bochs. From my testing, I think that the error is a result of the application not reading the program from memory properly, either due to a mistake in the first stage of my boot loader or something being wrong in the makefile. I will include both of these below:
First Stage of bootloader:
BITS 16
ORG 7C00h
jmp Real_Mode_Start
%include "functions_16.asm"
Read_Failed:
mov si, boot_error
call Console_WriteLine_16
ret
Real_Mode_Start:
cli
xor ax, ax
mov ss, ax
mov sp, 4000h
mov ds, ax
mov si, boot_message
call Console_WriteLine_16
mov al, 5
mov bx, 9000h
mov ch, 0
mov dh, 0
mov dl, 0
mov cl, 2
int 13h
cmp al, 5
jne Read_Failed
jmp 9000h
hlt
; Data
boot_message: db 'MacOS Remastered' , 0
boot_error: db 'Boot Failed' , 0
times 510 - ($ - $$) db 0
dw 0AA55h
Makefile:
.DEFAULT_GOAL:=all
Imgname=MacRemastered
.SUFFIXES: .iso .img .bin .asm
%.bin: %.asm
nasm -w+all -f bin -o $@ $<
boot.bin: boot.asm functions_16.asm
boot2.bin: boot.asm functions_16.asm
$(Imgname).iso: boot.bin boot2.bin
cp floppy_image/$(Imgname).img $(Imgname).img
dd status=noxfer conv=notrunc if=boot.bin of=$(Imgname).img
dd status=noxfer conv=notrunc seek=1 if=boot2.bin of=$(Imgname).img
rm -rf cdiso
mkdir cdiso
cp $(Imgname).img cdiso/$(Imgname).img
mkisofs -o $(Imgname).iso -b $(Imgname).img cdiso/
all: $(Imgname).iso
clean:
rm -f boot.bin
rm -f boot2.bin
rm -f $(Imgname).img
rm -f $(Imgname).iso
rm -rf cdiso
Any help would be appreciated.