Reputation: 31
My teacher asked me to write code into MBR of a virtual machine on a virtual box, I firstly use nasm to create a binary file, for instance, like this:
nasm my_file.asm -o my_file.bin
And I directly use dd command to write into the vhd:
dd if=my_file.bin of=machine.vhd bs=512 const=1 conv=notrunc
After I boot the virtual machine it did as my expectation.
But what confused me is that we seemingly lose the link process. When we want to get an executable file on computers, we do need a linker to help us do some critical works(like dd something..). But this time we directly use the bin file. So why we can use it in that way?
Upvotes: 3
Views: 275