VOGONS


First post, by megatron-uk

User metadata
Rank Oldbie
Rank
Oldbie

I'm trying to set up a filesystem image I want to copy over to a real system and am currently writing some batch files to mount cd images, start the game, and unmount again... using the good old SHSUCDHD (3.01, May 2005) and SHSUCDX (3.09, Sep 2022) utilities. It's easier to do this on an emulated environment rather than by hand on old hardware.

This is in Dosbox, just built from svn today (27th March 2024).

I'm doing something I've done a hundred times before on real systems:

SHSUCDHD /U
SHSUCDX /U

SHSUCDHD /F:D:\ISO\WHAVEN2.ISO
SHSUCDX /D:SHSU-CDH

That should open WHAVEN2.ISO from D:\ISO and assign it to the device SHSU-CDH, and the message back from SHSUCDHD indicates it is fine:

D:\ISO\WHAVEN2.ISO      : Unit 0

... but when it comes to mapping that device to a drive letter, every single combination of parameters I try with SHSUCDX results in an error:

Can't open CD driver SHSU-CDH.

or

Can't open CD driver SHSU-CDH. SHSUCDX can't install.

If I use a wildcard in the SHSUCDX command, I get a different error:

SHSUCDX /D:*SHSU-CDH
SHSUCDX installed.
No drives assigned.
1 drive(s) available.

It appears to me that SHSUCDHD is loading the new device correctly, but for some reason the device name it uses (SHSU-CDH) is not matched when the SHSUCDX driver attempts to find it. Has anyone else found similar behaviour whilst running SHSUCDX under Dosbox?
I know I can use imgmount to achieve the same under Dosbox, but that misses the point - when I zip up this filesystem image and squirt it onto a CF card, those Dosbox tools of course won't exist.

Before anyone asks; no it's not the ISO file - every ISO I've tried this with has resulted in the same symptoms. I've tried Albion, Sim City 2000 SE, original C&C and RA images, Syndicate and half a dozen more. They all result in the same.

shsucdx.png
Filename
shsucdx.png
File size
40.75 KiB
Views
318 views
File license
CC-BY-4.0

My collection database and technical wiki:
https://www.target-earth.net

Reply 1 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Device drivers aren't supported by the DOS emulation. You can boot real DOS in DOSBox, but then your ISO file will have to be contained on an HDD image.

Why not use IMGMOUNT to mount the ISO directly? DOSBox internally emulates a CD-ROM device driver and MSCDEX, so there's no need to load them.

Reply 2 of 5, by megatron-uk

User metadata
Rank Oldbie
Rank
Oldbie

I'm aware that Dosbox provides CDROM emulation and this works fine for most purposes.

In my case I am setting up a large directory tree of installed and configured games which I want to be able to dropped on to a HDD or CF in one of my real dos systems (as well as work in Dosbox), so using internal tools like imgmount in the bat files which will launch any games that run from an iso on that filesystem is a non starter.

I could write all of the iso-based game start scripts to use imgmount calls, but then I'd have to bulk convert all of those bat files when finished with something like sed or perl to replace imgmount calls with the various pairings of shsucdhd and shsucdx commands. That feels dirty to have to do things twice and not be able to test from the relative comfort of Dosbox.

If the shsucd* virtual CDROM driver utilities don't work with Dosbox, that seems pretty clear that it's a dead end to do that work from within that environment though.

My collection database and technical wiki:
https://www.target-earth.net

Reply 3 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Since you're mounting an ISO either way, you could do it by calling a batch file with parameters, and then you'd only need to change that one batch file depending on the system.

You can also do conditional processing within batch files, such as: IF EXISTS Z:\COMMAND.COM GOTO DOSBOX

Reply 5 of 5, by megatron-uk

User metadata
Rank Oldbie
Rank
Oldbie

Okay, these two wrappers should accomplish what I need - host agnostic mounting and unmounting of ISO images:

ISOMOUNT.BAT:

@ECHO OFF
SET ISODIR=D:\ISO
SET ISODRIVE=E
SET DOSBOXDRIVE=Z:
SET SHSPATH=C:\TOOLS\SHSUCD

IF EXIST %ISODIR%\%1 GOTO CHECKBOX
GOTO MISSING

:CHECKBOX
REM -= Mount an ISO =-
@echo Mounting ISO file %ISODIR%\%1 as %ISODRIVE%
IF EXIST %DOSBOXDRIVE%\COMMAND.COM GOTO DOSBOX
GOTO REALBOX

:REALBOX
REM -= Mount an ISO using shscudhd/shsucdx =-
@echo Calling SHSCUDHD
%SHSPATH%\SHSCUDHD /F:%ISODIR%\%1 /Q
@echo Calling SHSUCDX
%SHSPATH%\SHSUCDX /D:SHSU-CDH,%ISODRIVE% /Q
GOTO END

:DOSBOX
REM -= Mount an ISO using Dosbox imgmount =-
REM @echo Calling Dosbox imgmount
%DOSBOXDRIVE%\imgmount %ISODRIVE%: %ISODIR%\%1 -t iso -fs iso
GOTO END

:MISSING
REM -= ISO is missing =-
@echo Warning! The source ISO %ISODIR%\%1 is missing
@echo ===============================================
@echo You must call this tool with the name of an ISO file
@echo which is available in %ISODIR%
@echo e.g. ISOMOUNT.BAT TENTACLE.ISO
GOTO END

:END
REM -= End of ISO mount wrapper =-

ISOUMNT.BAT:

@ECHO OFF
SET ISODIR=D:\ISO
SET ISODRIVE=E
SET DOSBOXDRIVE=Z:
SET SHSPATH=C:\TOOLS\SHSUCD

:CHECKBOX
REM -= Unmount an ISO =-
@echo Unmounting ISO file on %ISODRIVE%
IF EXIST %DOSBOXDRIVE%\COMMAND.COM GOTO DOSBOX
GOTO REALBOX

:REALBOX
REM -= Unmount an ISO using shscudhd/shsucdx =-
@echo Calling SHSCUDHD to unload
%SHSPATH%\SHSCUDHD /U /Q
@echo Calling SHSUCDX to unload
%SHSPATH%\SHSUCDX /U /Q
GOTO END

:DOSBOX
REM -= Unmount an ISO using Dosbox imgmount =-
@echo Calling Dosbox imgmount to unload
%DOSBOXDRIVE%\imgmount -u %ISODRIVE%:
GOTO END

:END
REM -= End of ISO mount wrapper =-

To mount an ISO using either imgmount or the shs drivers, called as follows:
ISOMOUNT <NAME_OF_ISO_IN_YOUR_ISODIR>

To unmount a currently mounted ISO image, called without any arguments:
ISOUMNT

isomount.png
Filename
isomount.png
File size
52.06 KiB
Views
230 views
File license
CC-BY-4.0

This gets me where I need to be, so I can start writing game launchers by using these wrappers to load and unload ISO images without being concerned of the underlying tools of the platform (real vs dosbox) underneath it.

Obviously this is based on my use case of having a single ISO directory with all of my image files. If you have them in individual folders then you'll maybe want to adjust the file path check and alter a few of the directories. Consider the two batch files CC licensed as per the attachments to this message.

My collection database and technical wiki:
https://www.target-earth.net