将二进制文件复制到VHD文件中
阅读李忠的《x86汇编语言从实模式到保护模式》时,遇到了要将二进制文件写入VHD文件的问题。Windows环境可以使用随书工具FixVhdWr,在Linux或Mac下可以使用dd工具。
On linux, you may create the vhd file via virtualbox first, and execute the command following to copy the content of the mbr sector into the vhd file.
dd if=c05_mbr.bin of=LEARN-ASM.vhd bs=512 count=1 conv=notrunc
With the option ‘notrunc’, the size of the output file will not change when it is bigger than the input file’s.virtual machine - how can we write binary file to a VHD file on mac - Stack Overflow
1 | dd if=二进制文件名 of=目标vhd文件 bs=512 count=1 conv=notrunc |