I'm writing small operation system - for practice. I started with bootloader.
I want to create small command system that runs in 16 bit real mode (for now).
I've created bootloader that resets drive, then loads sector after bootloader.
The problem is because after
jmp function nothing actually happening.
I't trying to load next sector at 0x7E00 (I'm not totally sure how to point address using es:bx so that may be a problem, I believe that its Address:offset), just after bootloader.
This is the code:
; ; SECTOR 0x0 ; ;dl is number of harddrive where is bootloader org 0x7C00 bits 16 ;reset hard drive xor ah,ah int 0x13 ;read sectors clc mov bx,0x7E00 mov es,bx xor bx,bx mov ah,0x02 ;function mov al,0x1 ;sectors to read mov ch,0x0 ;tracks mov cl,0x1 ;sector mov dh,0x0 ;head int 0x13 ;if not readed jmp to error jc error ;jump to 0x7E00 - executed only if loaded jmp 0x7E00 error: mov si,MSGError .loop: lodsb or al,al jz .end mov ah,0x0E int 0x10 jmp .loop .end: hlt MSGError db "Error while booting", 0x0 times 0x1FE - ($ - $$) db 0x0 db 0x55 db 0xAA ; ; SECTOR 0x1 ; jmp printtest ;definitions MSGLoaded db "Execution successful", 0x0 ; ; Print function ; si - message to pring (NEED TO BE FINISHED WITH 0x0) printtest: mov si,MSGLoaded .loop: lodsb or al,al jz .end mov ah,0x0E int 0x10 jmp .loop .end: hlt times 0x400 - ($-$$) db 0x0
I've been testing this code using VirtualBox but nothing actually happens, The read error doesn't shows, as well as message that should be printed.