Problems with "Virtual Floppy Disk"-driver. Any alternative?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sandro
Posts: 3
Joined: Wed Mar 23, 2011 4:45 am

Problems with "Virtual Floppy Disk"-driver. Any alternative?

Post by sandro »

Hi community! I want to create my own OS! At first i want to thank you for the very good wiki!

I started with the bare bone tutorial "Real mode assembly bare bones" from the wiki: http://wiki.osdev.org/Real_mode_assembly_bare_bones
But there was a problem: My laptop has no floppy drive!

I searched for a solution in the wiki and in google and i found the "Virtual Floppy Disk (VFD) Driver". The hyperlink to the homepage from the wiki shows you a non english website, so i dont understand anything. But i found extended information about vfd here: http://vfd.sourceforge.net/#w64bit
But the main release was only for x86, so i couldn't start the driver with "vfd.exe -start" after installing with "vfd.exe -install", because i have an x64 windows 7. I downloaded the inofficial x64 version by critical0, but this includes only the *.sys - file. I tried to replace the x86-sys-file with this new x64-sys-file by critical0 and then exec "vfd -install", but this didn't work too.

So, what shell i do? Can i write the binary file from the nasm to an USB-Storage?

Thank you for answering in advance!

Additional information: My English is very bad because english is not my mother tongue. So dont be angry if you can see mistakes, please.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by egos »

You can use floppy image directly to boot in emulator. You can use CD/DVD or USB flash with floppy image to boot on real hardware. Or buy USB floppy drive )))
sandro wrote:So, what shell i do? Can i write the binary file from the nasm to an USB-Storage?
Maybe hex editor?
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
Jvac
Member
Member
Posts: 58
Joined: Fri Mar 11, 2011 9:51 pm
Location: Bronx, NY

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by Jvac »

Hi Sandro,
so i couldn't start the driver with "vfd.exe -start"
you should start instead.
"vfdwin.exe"
You could see an example at BrokenThorn Entertainment. Scroll down till you see How to use VFD (Virtual Floppy Drive).

I was having a similar problem and this fix it for me.

I hope this works for you.
Last edited by Jvac on Wed Mar 23, 2011 7:40 am, edited 1 time in total.
"The best way to prepare for programming is to write programs, and
to study great programs that other people have written." - Bill Gates


Think beyond Windows ReactOS®
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by turdus »

If you take an advice, forget floppy drive, and use usb stick. It's most likely that the time you finish your os there'll be less floppy drives than today, and they're quite rare now as you noticed.

I use usb stick without any fuzz, as a matter of fact it's much simpler. You can use rawrite.exe or any similar tool to write a file on stick sector by sector. On unixes you can use the old good tool dd.
sandro
Posts: 3
Joined: Wed Mar 23, 2011 4:45 am

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by sandro »

@Floppy

Thank you for answering!

I have questions about your post:

1) Create Floppy-Image from a binary file
After i execed "nasm kernel.asm -f bin -o kernel.bin" the NASM gave me a binary file with the file extension .bin of course. A floppy-image has an file extension .img . Can i simply rename kernel.bin to kernel.img or is floppy-image a completly other file type?

2) Booting from an image in emulator
I have installed Bochs. How must i configure Bochs so it boots from my Floppy-Image?

@USB

Yes, i think floppy is very old. But i cant find a tool to write images to an USB-Storage. RaWrite for windows can't write to USB-Storage, only to floppy. I cant use dd, because my OS isn't linux. And the idea with the HexEditor: My HexEditor can only open files, but not full partitions or storage devices. Are there HexEditors which can do this?
User avatar
Jvac
Member
Member
Posts: 58
Joined: Fri Mar 11, 2011 9:51 pm
Location: Bronx, NY

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by Jvac »

"nasm kernel.asm -f bin -o kernel.bin"
Kernel?

should be instead
nasm -f bin BootLoader.asm -o BootLoader.bin
then you should get BootLoader.bin

Then you need PartCopy see the tutorial or use debug from the command line to get image to your vfd. See full tutorial home page click on Introduction for debug introductions. Please be very careful as you could do damage to your system disk pay close attention to the warning signs :D .
2) Booting from an image in emulator
I have installed Bochs. How must i configure Bochs so it boots from my Floppy-Image?
Yes. Please follow through the tutorial also see the OSdev wiki
"The best way to prepare for programming is to write programs, and
to study great programs that other people have written." - Bill Gates


Think beyond Windows ReactOS®
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by turdus »

It took about 10 sec to find one.
https://launchpad.net/win32-image-writer/+download

Anyway you are confused about some basics: rawrite can write to any block media, and it's not the hexeditor that can read disks, it's the OS's duty to represent a file that can be used by the editor. On unixes it's usually /dev/hda or /dev/sda or similar, on win it's \\.\PhysicalDrive(something). I suggest to google virtualbox's vboxmanage command, there are many examples that references physical disks under win as files (vboxmanage is used to create a "virtual link" disk that corresponds to a physical disk, so that the guest can access host's disk directly).

And about nasm, yes, it can produce a directly bootable binary (that can be renamed to img) if you write your source that way. To make things simple I use this method, and after assembly I have a binary that contains PMBR code, a PMBR table and a GPT, so this file can be written to a stick without any problem (of course it's not enough to boot, you have to create a filesystem and put at least your kernel there).
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by egos »

sandro wrote:1) Create Floppy-Image from a binary file
After i execed "nasm kernel.asm -f bin -o kernel.bin" the NASM gave me a binary file with the file extension .bin of course. A floppy-image has an file extension .img . Can i simply rename kernel.bin to kernel.img or is floppy-image a completly other file type?
Extentsion is not important. Format is important. In your tutorial boot sector image is named "kernel.bin" therefore you can use "kernel.bin" as floppy image (renaming is not required).
2) Booting from an image in emulator
I have installed Bochs. How must i configure Bochs so it boots from my Floppy-Image?

Code: Select all

floppya: 1_44="kernel.bin", status=inserted
boot: floppy
My HexEditor can only open files, but not full partitions or storage devices. Are there HexEditors which can do this?
I use HxD.
If you have seen bad English in my words, tell me what's wrong, please.
sandro
Posts: 3
Joined: Wed Mar 23, 2011 4:45 am

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by sandro »

Thank you for your answers.
Now i know, how i can boot from my image in Bochs and how i can boot from usb storage by PC.

My questions are answered now!
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by Chandra »

Anyway you are confused about some basics: rawrite can write to any block media
Huh?

What's this?
rawrite2.JPG
This snapshot was from Rawrite2 (distributed under Mepis Linux Live DVD).
This suggests, rawrite obviously can't write to any other media, other than Floppy.
Or am I getting things wrong here?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by turdus »

Chandra wrote:
Anyway you are confused about some basics: rawrite can write to any block media
Huh?

What's this?
rawrite2.JPG
This snapshot was from Rawrite2 (distributed under Mepis Linux Live DVD).
This suggests, rawrite obviously can't write to any other media, other than Floppy.
Or am I getting things wrong here?
Never heard of v2, never tried. If it does not support other media than floppy, do not use it for usb sticks. Use another app.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by Chandra »

turdus wrote: Never heard of v2, never tried. If it does not support other media than floppy, do not use it for usb sticks. Use another app.
If you never tried rawrite, why did you suggested to use it at first place?
Moreover, you confirmed that it was able to write to usb disk, didn't you?

Ah, does this really matter? No. So, let's end it here. Afterall, the problem was already solved.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by turdus »

Chandra wrote: If you never tried rawrite, why did you suggested to use it at first place?
I've used rawrite many years ago, it's the 2.0 that I haven't tried.
Moreover, you confirmed that it was able to write to usb disk, didn't you?
Yes, because I used it for hard drives too. I should have mentioned that my information is not necessary up to date, but I never thought it can do less than it used to. Sorry.
Ah, does this really matter? No. So, let's end it here. Afterall, the problem was already solved.
Agree. I hope I made up my mistake by linking a tool that works :-)
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Problems with "Virtual Floppy Disk"-driver. Any alternat

Post by Creature »

To answer the OP's question: there is a neat little program called ImDisk Virtual Disk Driver which works on x64 as well as x86 Windows. You can use it to mount all kind of images (floppies, hard drives, CD-Roms, etc.). The download is about in the middle of the site, under the huge changelog.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
Post Reply