VOGONS


IMGMOUNT in Linux

Topic actions

First post, by Grunt

User metadata
Rank Newbie
Rank
Newbie

Hello, guys.
I am confused:

The attachment imgmount.png is no longer available

I can mount Floppy Image without problem but device is marked as directory. Why? Is this OS bug?

Reply 2 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

But /dev/sdb isn't directory. It is file.

Reply 3 of 20, by Caluser2000

User metadata
Rank l33t
Rank
l33t
Grunt wrote on 2020-05-11, 17:51:
Hello, guys. I am confused: imgmount.png […]
Show full quote

Hello, guys.
I am confused:
imgmount.png

I can mount Floppy Image without problem but device is marked as directory. Why? Is this OS bug?

First you need to understand how linux, or for that matter *nix workalike OSs, functions then you will have found the answer to this question. Any old *nix book will do.

There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉

Reply 4 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie
Caluser2000 wrote on 2020-05-11, 18:08:

First you need to understand how linux, or for that matter *nix workalike OSs, functions then you will have found the answer to this question. Any old *nix book will do.

Now I'm confused even more. Should I try loop device?

Reply 6 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

Yes.

Reply 8 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

Which is exactly what I want. /dev/sdb is floppy device. I don't want to use system mounting because caching, I want direct mount from Dosbox.

dd if=/dev/sdb of=/tmp/image.img works perfectly. IMGMOUNT /dev/sdb - file is not a file but directory. What?

Reply 9 of 20, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

It's a floppy DEVICE not an IMAGE. IMGMOUNT is for IMAGES. NOT for devices.
The dd command makes an image of the device which, as it is now an image, of course works.
Try
Mount a /dev/sdb -t floppy

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 10 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

What? /dev/sdb is block device. MOUNT is for directories. Am I wrong?

Reply 11 of 20, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

You can only imgmount regular files, not devices.

Reply 12 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie
jmarsh wrote on 2020-05-11, 18:50:

You can only imgmount regular files, not devices.

Oh, thanks. That is explenation. Ok and equivalent of MOUNT A A: -t floppy in Linux exists?

Reply 13 of 20, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

You'd have to mount it somewhere in the native linux filesystem (e.g. /mnt/floppy) and then mount that directory inside DOSBox ("mount a /mnt/floppy -t floppy").

Reply 14 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie

So short answer: No, no equivalent for direct manipulation with device.

Why it is problem? Work with block device is just as work with regular file. Seeking, reading, writing. It should work. It is safe just to comment checking macro?

Reply 15 of 20, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

It's not the same. Block devices have stricter requirements regarding read/write sizes and offsets, may require explicit seeks... there's no guarantee the C library will take care of that correctly if you use the buffered I/O functions (which DOSBox does).

Reply 16 of 20, by Caluser2000

User metadata
Rank l33t
Rank
l33t

I thought fd0 was the block device for floppies. Not that I'm an expert or anything...

There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉

Reply 17 of 20, by Grunt

User metadata
Rank Newbie
Rank
Newbie
jmarsh wrote on 2020-05-11, 19:24:

It's not the same. Block devices have stricter requirements regarding read/write sizes and offsets, may require explicit seeks... there's no guarantee the C library will take care of that correctly if you use the buffered I/O functions (which DOSBox does).

Hmm. There should be warning in DOSBox Wiki or something. First thing I'm going to do when I pull out the old rusty harddrive/FDD is to IMGMOUNT it Linux. Just to be safe.

And you know what? It quite sucks. There is plenty of tool for Windows but just mount.vfat for Linux. Shouldn't be at least loop device (img)mountable?

Caluser2000 wrote on 2020-05-11, 19:26:

I thought fd0 was the block device for floppies. Not that I'm an expert or anything...

It is. If you own FDC. I have SCSI device so it is under /dev/sdX.

Reply 18 of 20, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
Grunt wrote on 2020-05-12, 18:28:

First thing I'm going to do when I pull out the old rusty harddrive/FDD is to IMGMOUNT it Linux. Just to be safe.

That's not safe at all. The safest thing to do is make an image and mount a copy to keep the original data pristine.

And you know what? It quite sucks. There is plenty of tool for Windows but just mount.vfat for Linux.

You can't imgmount a physical floppy drive under windows either. You can only mount the drive letter as a directory, which is the same as under linux; accessing the underlying filesystem is handled by the OS in both cases.

Reply 19 of 20, by _Rob

User metadata
Rank Member
Rank
Member

Normally on linux the floppy drive would be /dev/fd0 and is a so-called "block device". It should not be too difficult to implement support for it in DOSBox, but nobody has until now, and considering how rare such setups are nowadays means it probably never will. The openMSX emulator for instance can directly access a floppy drive on Linux.

Your however using /dev/sdb, which to me means it is not a real floppy drive. But probably a USB Floppy Drive, which uses a completely different protocol called UFI. Under Linux you have for instance "ufiformat" for formatting a diskette in a USB floppy drive. You can also query the supported formats as follows (with a 720kB DD disk in the drive):

sudo ufiformat -i /dev/sdb
vendor: TEAC
product: FD-05PUB
write protect: off
media type: 2DD
status block size kb
formatted 1440 512 720
formattable 1440 512 720