Loading a .img file to floppy in virtual box

978 Views Asked by At

I have a Hello World Program in Assembly language

`; ----------------------------------------------------------------------------
  ; helloworld.asm 
  ;
  ; This is a Win32 console program that writes "Hello, World" on one line and
  ; then exits.  It needs to be linked with a C library.   
  ; ------------------------------------------------------------- ---------------

 global  _main
 extern  _printf

 section .text
_main:
 push    message
 call    _printf
 add     esp, 4
 ret
 message:
  db  'Hello, World', 10, 0`

I have complied it using nasm and have got the img file. When I use the Floppy Controller it gives a error..

Failed to open Floppy Disk File D:\helloworld.img
 the Medium D:\helloworld.img Cannot be used as a requested device type

Result Code: E_FAIL (0x80004005)
Component: Medium
Interface: IMedium {05f2bbb6-a3a6-4fb9-9b49-6d0dda7142ac}
Callee: IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
1

There are 1 best solutions below

0
On

I think you have to create .img file using partcopy or etc. I mean you have done to create an Image File but that has to be right one.As a sample you can produce it by using copy /b but that doesn't make it right.Or you can make it ISO file to make it usable.

miso your.iso -ab your.img