加载带有引导二进制文件的软盘映像
我创建了一个小型程序集二进制文件以从软盘启动(理想情况下),但我无法弄清楚如何实际将二进制文件“放入”磁盘上以使其可启动。我宁愿使用软盘映像(IMG 或 VFD)而不是实际的磁盘(我不知道我是否还有备用软盘)。你能告诉我如何做到这一点吗?我找不到太多相关信息,而且我对创建引导扇区不太熟悉。
附录:我使用的是 Windows (x64),没有 Linux。我确实有 NASM。
编辑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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引导扇区只是磁盘上的第一个扇区或前 512 个字节,因此引导扇区的二进制文件实际上是带有引导扇区的软盘映像。
要使用真正的软盘,您只需使用软盘映像编写器(例如rawrite)、dd 或某些专用软件将其复制到软盘即可。
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.