0

In a build operation I am attempting to do on Windows (7, if it matters), I need to execute the command dd status=noxfer conv=notrunc if=data.bin of=disk.flp on object code from assembly (nasm with -f bin). Is there a way to do this without installing any programs? To reiterate, installation of third-party programs is entirely impossible on this workstation.

Nathan Ringo
  • 973
  • 2
  • 10
  • 30

2 Answers2

1

Unless I'm missing something all you want is to append the data from data.bin file to the end of disk.flp file. If so, it should be easy with CreateFile - SetFilePointer (to the end of file) - WriteFile

Isso
  • 1,285
  • 11
  • 23
  • I think _I'm_ missing something though... This is what is used to convert the assembled output into what **should** be a valid floppy image. – Nathan Ringo Jun 16 '12 at 00:01
  • Are you building a boot loader? If so just write the data.bit to the first sector of the floppy by using CreateFile to open floppy and WriteFile to write to it – Isso Jun 16 '12 at 08:14
  • What language is this in/how do I do this? I use a Linux most of the time, so I'm unfamiliar with MSW methods... – Nathan Ringo Jun 16 '12 at 20:40
  • Those are the names of Windows internal file manipulation functions. You can call them from pretty much any language, including assembly. – Isso Jun 16 '12 at 22:44
  • Here's a sample, including the detailed info on boot sector: http://www.codeguru.com/cpp/cpp/cpp_mfc/files/article.php/c13809/Extract-Floppy-Disk-Geometry-from-the-Boot-Sector.htm – Isso Jun 16 '12 at 22:50
  • `HANDLE hFloppy = NULL; hFloppy = CreateFile( "\\\\.\\A:", // Floppy drive to open GENERIC_READ, // Access mode FILE_SHARE_READ, // Share Mode NULL, // Security Descriptor OPEN_EXISTING, // How to create 0, // File attributes NULL); // Handle to template` I just replace the `\\\\.\\A:` with `data.bin`? And where does `disk.flp` come in? To clarify, I'm creating a disk IMAGE, not burning the bootloader to a disk. – Nathan Ringo Jun 17 '12 at 01:50
0

dd is available for Windows.

Best up to date source that I've found is bundled with Git for Windows. With that installed the binary lives here C:\Program Files\Git\usr\bin\dd.exe

Chirishman
  • 327
  • 4
  • 6