Jump to content











Photo
- - - - -

Accessing a Floppy drive from bootable DOS Floppy Image


  • Please log in to reply
10 replies to this topic

#1 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 22 November 2010 - 04:23 AM

Hi everyone!

I created a .ima FreeDOS Floppy image with Victoria and some other tools to diagnose problematic hard drives. The image is placed onto a multiboot ISO / CD and booted via Grub4DOS. The image script (autoexec.bat) then creates an HD ramdrive C:\ where the diagnostic and other tools are unpacked. FreeDOS files are not copied to the ramdrive and remain on the original image, which gets assigned drive letter a:\ by DOS. My problem is, I can't access a physical floppy disk after booting from that image. When I change drive to b:\, it shows the same content as a:\ , i.e. the original floppy image content. In VMWare I can access both the image at a:\ and physical floppy drive at b:\, when b:\ is marked as physical drive in VMWare VM settings.

Any suggestions, how to change autoexec.bat to enable access to a physical floppy drive after booting the image to a real PC? Probably have to enumerate floppies, and reassign drive letters, or something like that? Or move the image content also to the same ramdrive? Then how to release a:\ or b:\ letter and assign it to my physical drive? Any complete code examples?

Edited by sambul61, 22 November 2010 - 04:32 AM.


#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 November 2010 - 01:26 PM

Why don't you make a simple hard disk image and map it to RAM through grub4dos?

It should get C:\ allright and you won't need the DOS RAMDISK driver.

:hi:
Wonko

#3 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 22 November 2010 - 04:42 PM

Hi everyone!
...
Any suggestions, how to change autoexec.bat to enable access to a physical floppy drive after booting the image to a real PC? Probably have to enumerate floppies, and reassign drive letters, or something like that? Or move the image content also to the same ramdrive? Then how to release a:\ or b:\ letter and assign it to my physical drive? Any complete code examples?

Hello. GRUB4DOS is hooking BIOS drive 0x00 (first floppy disk drive) and mapping it to your .IMA image. That means the original 0x00 is no longer accessible. Modify your GRUB4DOS configuration file to map the original floppy disk drive as a "second" floppy disk drive.
map (fd0) (fd1)

map /freedos.ima (fd0)

map --hook
The first line "moves" the original floppy as the "second" floppy. The next line maps your image file as the "first" floppy. The next line commits these mappings. Drive 0x01 will be B: will be (fd1), which is your original (real) floppy disk drive.

#4 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 22 November 2010 - 05:25 PM

Thanks guys! Will try both suggestions (of course not simultaneously). :D I already had the floppy, then just added it to the ISO.

Edited by sambul61, 22 November 2010 - 05:28 PM.


#5 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 22 November 2010 - 05:30 PM

Instead of remapping the drives yourself, you can use MEMDISK for booting the floppy image:
kernel /memdisk raw

initrd /floppy.img
It will automatically shift the drive number, if there is already an existing floppy drive 0x00.

#6 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 24 November 2010 - 05:53 PM

Thanks again guys! Your suggestions work wonderful! How about moving forward to the next point?

Is there any way to mount various FDD images after booting from a FreeDOS or DOS FDD image? If there is a way, I'd appreciate some examples you're certain do work in practice.

Edited by sambul61, 24 November 2010 - 05:54 PM.


#7 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 25 November 2010 - 02:33 AM

Just use ElTorito.sys. It should drive any physical optical disc drive that you have booted from, as well as any MEMDISK and GRUB4DOS mapped optical discs, also.


I wonder if mapping another floppy drive image as a memdisk or floppy drive with Grub4DOS at launching a FreeDOS FDD image boot via Grub4DOS menu would allow to mount that 2-nd image later with ELTorito.sys or similar VFD driver for DOS?

Edited by sambul61, 25 November 2010 - 02:36 AM.


#8 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 28 November 2010 - 12:50 AM

This is DOS, NOT Windows. (they work DIFFERENTLY)

You map the images in grub4dos.

Grub4dos is "between" BIOS and DOS.

For all DOS knows, since it "trusts" BIOS devices (please read BIOS devices as modified by grub4dos), the image is a "real" device.

I'll try again.

FORGET (temporarily) about images.

Let's talk about "real" hardware:

  • can DOS or FreeDOS access a floppy drive (FAT12) WITHOUT ANY driver or extension? Posted Image
  • can DOS or FreeDOS access a hard disk drive (filesystems FAT12, 16 or 32) WITHOUT ANY driver or extension? Posted Image
  • can DOS or FreeDOS access a CD/DVD drive WITHOUT ANY driver or extension? Posted Image

Now, IF grub4dos mapped devices (for all DOS may know) are EXACTLY the same as "real" ones, can you see the difference between them?

:)
Wonko



I added 4 similar floppy images to an ISO, booted the ISO via Grub4DOS in a VM (with 2 floppy drives "connected" - yet I've only one on a real PC), and mapped --hooked all 4 images in a similar way assigning each a different (fd#). Then I booted to one of these DOS images. In a file manager I can see 2 floppies - the one I booted to, and the other - one of these mapped. Why the other 2 floppy images didn't get drive letters and aren't accessible? If its DOS limitation - to show only 2 floppies, can I go back to Grub4DOS prompt, and remap (fd3) to (fd1) to make its content appear without reboot?

As to HD images mapping, will all (not just one selected by unknown preference order) mapped in Grub4DOS HD images be assigned separate drive letters and visible after booting to DOS? If only C:\ will be visible, can I go back to Grub4DOS and remap another HD image to C:\ ?

Edited by sambul61, 28 November 2010 - 12:55 AM.


#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 November 2010 - 10:06 AM

Dos/grub4dos limits are more or less:
  • 2 floppy drives. (letters A:/B:)
  • 24 HD like + CD-like devices (or network/ramdisk, etc. drives) (letters C:÷ Z:)

Actually grub4dos has available (hd0) to (hd31) as HD-like devices and (hd32) onwards for Cd-like devices, so many more than DOS can actually manage.

And obviously you can map or remap anything you want.

:)
Wonko

#10 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 28 November 2010 - 06:20 PM

...
Is there any way to mount various FDD images after booting from a FreeDOS or DOS FDD image? If there is a way, I'd appreciate some examples you're certain do work in practice.

Here's some info from a familiar poster: program to run (FILE.IMG), Hellp

I wonder if mapping another floppy drive image as a memdisk or floppy drive with Grub4DOS at launching a FreeDOS FDD image boot via Grub4DOS menu would allow to mount that 2-nd image later with ELTorito.sys or similar VFD driver for DOS?

I don't quite follow, but I also don't recall just now if the ElTorito.sys DOS driver can be used to drive more than one optical disc drive. Maybe it's in the driver's documentation?

I added 4 similar floppy images to an ISO. ... In a file manager I can see 2 floppies ... Why the other 2 floppy images didn't get drive letters and aren't accessible? If its DOS limitation

Yup. BIOS divides drives into floppy and non-floppy classes: 0x00 through 0x7F for floppies and 0x80 through 0xFF for non-floppies. But DOS has merely A: and B:. :D

... can I go back to Grub4DOS prompt, and remap (fd3) to (fd1) to make its content appear without reboot?

That might be interesting to try, and to report your findings. There're map --unhook and map --rehook, too.

As to HD images mapping, will all (not just one selected by unknown preference order) mapped in Grub4DOS HD images be assigned separate drive letters and visible after booting to DOS? If only C:\ will be visible, can I go back to Grub4DOS and remap another HD image to C:\ ?

HDDs might be treated different than removable media by DOS. DOS doesn't expect partition tables changes, for example, including partition sizes and partition starts. I believe that DOS enumerates its drive letters once it boots, then expect them to stay static. It enumerates drive letters for floppies and partitions. You can use up all the letters from [b]C:
through [b]Z:
, then you're out of letters. "Drive letter" is perhaps a bit of a misleading term in DOS... It might be better off as "filesystem letter," but it's way too late to change the term. :D

#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 November 2010 - 09:31 AM

HDDs might be treated different than removable media by DOS. DOS doesn't expect partition tables changes, for example, including partition sizes and partition starts. I believe that DOS enumerates its drive letters once it boots, then expect them to stay static. It enumerates drive letters for floppies and partitions. You can use up all the letters from C: through Z:, then you're out of letters. "Drive letter" is perhaps a bit of a misleading term in DOS... It might be better off as "filesystem letter," but it's way too late to change the term. :D

And, as soon as you get some certainties, I'll come here :) introducing something that proves how you can change drive letters in DOS allright.

http://www.boot-land...?...c=9694&st=3

:D
Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users