开发者

Loading a floppy disk image with a boot binary

开发者 https://www.devze.com 2023-03-18 05:58 出处:网络
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

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 f开发者_运维知识库ind 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号