Page 1 of 1
Problems with "Virtual Floppy Disk"-driver. Any alternative?
Posted: Wed Mar 23, 2011 5:15 am
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.
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 5:46 am
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?
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 5:59 am
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.
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 6:13 am
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.
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 6:26 am
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?
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 6:49 am
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 .
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
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 6:57 am
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).
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 7:38 am
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.
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 8:14 am
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!
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 9:21 am
by Chandra
Anyway you are confused about some basics: rawrite can write to any block media
Huh?
What's this?
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?
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 9:30 am
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.
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Wed Mar 23, 2011 10:14 am
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.
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Thu Mar 24, 2011 10:27 am
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
Re: Problems with "Virtual Floppy Disk"-driver. Any alternat
Posted: Fri Mar 25, 2011 4:40 am
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.