bochs without a floppy drive?

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
pgarr
Posts: 2
Joined: Fri Jun 13, 2008 4:28 pm

bochs without a floppy drive?

Post by pgarr »

Hi. I've been attempting to follow some simple boot loader tutorials both to get an introduction to OS dev (implementation), and learn to use tools such as Bochs at the same time. My problem is that I don't have a floppy drive anywhere in my house, and all my attempts to make a floppy image and write to the beginning of it have failed. I always get some sort of panic such as "Not a bootable disk." I have tried a few approaches in creating my image and sometimes I get different results, but I never get a desirable result.

My question is, is there a way to use floppy images without having a floppy drive, or would I be better off purchasing an external floppy than trying to make it work? I know drives don't cost too much, but when something doesn't work I like to find out why, and to fix it if possible.

By the way I'm new here, so hi :D I got into OS development because it seems like an awesome challenge and I like learning. I've been reading and researching for a while now, but this is my first time in forums or trying to implement anything.
tadada
Member
Member
Posts: 42
Joined: Sun Apr 20, 2008 5:32 pm
Location: Index 0 of the nearest Array

Post by tadada »

Use a virtual floppy drive.

In Linux you use a loopback device. (I think) I don't know much more about this.

In Windows you use a program like vfdwin which creates a virtual drive that windows thinks is a real one. I use vfdwin myself. Just google it to get it. I know a tutorial in the wiki uses it. Also lets you save your floppy as an image so you can use it later or to share it.

Also. I believe it is possible for Bochs to use the image directly. (like MS Virtual PC) Probably wrong though. Anyways you would need a specialised program to create the image if you don't have a real/virtual floppy to load everything onto.
My OS: SOS (Simple Operating System).
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Or,

Just type:

Code: Select all

floppya: 1_44="wherever the image is", status=inserted
into your bochs configuration file (I find this easier than using a virtual floppy drive).
Jules
midir
Member
Member
Posts: 46
Joined: Fri Jun 13, 2008 4:09 pm

Post by midir »

The last two bytes of the first sector (on floppies, each sector is 512 bytes) of the floppy should be 0x55, 0xAA. This is a magic number that (most) BIOSes, including Bochs's one, check to make sure the disk is formatted and bootable. If these aren't right it'll give the error message you described. Open the floppy image in a hex editor to check the format maybe..?

It is most certainly possible to use floppy images without ever having a real drive, but personally I think having real computers to boot is a lot more interesting. Fortunately, once you have the kernel format right, GRUB can boot it from anywhere that GRUB can boot from (CD, network, etc.).

You can download floppy images with the GRUB bootloader already set up on them, which is extremely handy. That's what I did. You'll still need a way to save your OS kernel files into the image, though. Vfdwin or Filedisk or Winimage can help you do that.
pgarr
Posts: 2
Joined: Fri Jun 13, 2008 4:28 pm

Post by pgarr »

a virtual floppy drive sounds like a great idea, actually. i grabbed vfd quickly, and I think that it's exactly what I'm looking for after running it.

by the way jules my problem is not obtaining an image, but having a properly written image with all of the information where it needed to be. often when I tried to write to an image file (instead of the usual drive) the file would get its size changed, etc...

i'll attempt this using vfd and see how it goes. thanks a lot guys

edit: :D my first ever power-down... lol. thanks for helpin, vfd worked like a charm
Post Reply