简体   繁体   中英

Loading a floppy disk image with a boot binary

I've created a small assembly binary to boot from a floppy disk (ideally), but I can't work out how to actually 'put' the binary onto the disk so that it is bootable. I'd rather use a floppy disk image (IMG or VFD) rather than an actual disk (I don't know whether I even have any spare floppy disks anymore). Can you tell me how this can be done, I can't find much on it and I'm not too familiar with creating bootsectors.

Addendum: I'm using Windows (x64) and don't have linux. I do have NASM.

EDIT 1: ASM:

;Bootstrapper source for X-DOS 0.01
;----------------------------------------------
;Experimental bootsector.
;
;my name, created: THURS 30-06-2011 18:01

[BITS 16]
[org 0x7c00] ;start at initial Boot sector in ROM

;jmp short start ;Jump to the start point

;-----------------------------------------------

db "30-06-2011" ;First time worked on.

;-----------------------------------------------

start: 

mov ah, 0eh ;tty print function
xor bl, bl
mov al, 'H'
int 10h ;print the above.
again:
jmp again


;------------------------------------------------

db "my name" ;Me!
      times 510-($-$$) db 0 ;padding
      dw 0xaa55

The boot sector is simply the first sector or the 512 first bytes on the disk, so a binary of your bootsector is effectively a floppy image with your bootsector on it.

To use a real floppy you just need to copy that to the floppy, by using a floppy image writer (eg rawrite), dd or some specialized piece of software.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM