How do I write a .bin file to be in the first sector of a floppy disk/virtual floppy disk/floppy image?
I\'m trying to boot a simple 512-byte bootloader. The size on
To write a file into another file, you can write a program. Following snippet is in C.
char buf[512];
int floppy_desc, file_desc;
file_desc = open("xx.bin", O_RDONLY);
read(file_desc, buf, 512);
close(file_desc);
floppy_desc = open("floppy.img", O_RDWR);
lseek(floppy_desc, 512, SEEK_SET);
write(floppy_desc, buf, 512);
close(floppy_desc);