I wanna write my own MBR on my os boot.Mbr in diffrent file Bootloader in diffrent file I want to load mbr in memory with int 13h but it loads only bootloader.i think that was because of org Sample Code:
;----------------------------
;AFC OS Bootloader
;see afcosblog.blogspot.com
;-----------------------------
bits 16
org 0x7c00
start:
mov ah,00
mov al,12h;640x480 16 color
int 10h
;----------------
mov ah,0x0E
mov al,'A';print 'A'
int 10h
;------------------
;
I wanna Write Mbr in there but it was writing Bootload
xor ax, ax
mov es, ax
mov cx, 1
mov dx, 0080h ;0th Hdd
mov bx, 7c00h ;I think problem was in there
mov ax, 0301h
int 13h
;Read
xor ax, ax
mov es, ax
mov cx, 1
mov dx, 0080h ;0th Hdd
mov bx, 7c00h
mov ax, 0201h
int 13h
cmp ah,00 ;AH:Status
jne error
jmp 0h:7c00h
error:
mov ah,0x0E
mov al,'E'
int 10h
mov ah,10h
int 16h
int 19h
ret
times 510-($-$$) db 0
dw 0xAA55
;---------------------------
;MBR.asm
;AFC OS MBR
;see afcosblog.blogspot.com
;This sample is 16 bit arch:x86
bits 16
org 0x7c00 ;<----
start:
push ax
mov ax,0a00h
mov es,ax
pop ax
mov ah,0x0E
mov al,'O'
int 10h
mov ah,10h
int 16h ;Keystroke
int 19h ;Reboot
times 510-($-$$) db 0
dw 0xAA55
;End of MBR
I was compaling in Windows nasm and I prepare iso miso.exe and copy.exe Thanks.