org 0x7c00
bits 16
cli
mov ax,0
mov ds, ax
mov es,ax
mov gs,ax
mov ss,ax
mov sp,0xffff
sti
mov si,msg
call DisplayMessage
mov ax, 0x0050
mov es, ax
mov bx, 0x0000
call ReadSector
mov ax, 0x0050
mov es, ax
mov bx, 0x2200
call ReadSector1
mov si, msg1
call DisplayMessage
mov si, beforeOS
call DisplayMessage
jmp 0x0000:0x2D00
mov si, afterOS
call DisplayMessage
cli
hlt
ReadSector:
mov ah, 0x02
mov al, 0x11
mov ch, 0x00
mov cl, 0x02
mov dh, 0x00
mov dl, 0x00
int 0x13
jc ReadSector
ret
ReadSector1:
mov ah, 0x02
mov al, 0x0d
mov ch, 0x01
mov cl, 0x01
mov dh, 0x00
mov dl, 0x00
int 0x13
jc ReadSector1
ret
DisplayMessage:
lodsb
or al, al
jz .DONE
mov ah, 0x0e
mov bh, 0x00
mov bl, 0x14
int 0x10
jmp DisplayMessage
.DONE:
ret
msg db "Boot Loader searching for OS...",0x0d,0x0a,0x00
msg1 db "Stalin OS found in Floppy DISK, Loading staOS...",0x0d,0x0a,0x00
reading db " Reading sector... please wait...", 0x0d,0x0a,0x00
finished db " Finished Reading.",0x0d,0x0a,0x00
beforeOS db "Updated Before jump to 0x0050:0x2800 !", 0x0d,0x0a,0x00
afterOS db " back to loader ",0x00
sectorloaded db " after loaded sector in memory ready to move control", 0x0d,0x0a,0x00
TIMES 510-($-$$) DB 0
DW 0xAA55
No comments:
Post a Comment