VOGONS


First post, by phix

User metadata
Rank Newbie
Rank
Newbie

Hi!

I would like to make my and others lives easer when it comes to transfer files in and out of my emulators guest environment.
There are at this point several ways to do this but none of them are very convenient. Preferably I would like to be able to mount a virtual drive in DOS that maps to a folder on my host system.

My first idea was to write a "small" TSR program that just wrapped the DOS IO API functions. The problem with this is that the API is quite big and the concept of default devices makes it more complicated.
I then considered using the network and create some kind of network share and having a built in server in the emulator. This is also quite complicated. 🙁

Has any one else done something like this in there own emulator? If so which approach did you take? and what where the prose and cons from your perspective?

Thanks
/aj

VirtualXT - A portable, lightweight Turbo PC/XT emulator written in C.

Reply 1 of 11, by superfury

User metadata
Rank l33t++
Rank
l33t++

UniPCemu and Dosbox support dial-up Hayes-compatible modems and nullmodems.
You can connect those to UniPCemu running in server mode, so to provide IPv4 over PPP. Although you'll need a MS-DOS PPP driver for that.
Then ofc some TSR for mapping a network drive, but I don't know if any exist for a 808x CPU? 80386 definitely.
Tried that with Windows 9x(dial-up to UniPCemu in server mode) and got partial local network(it could see other W95 clients) and internet (google.com etc) out of it(slow 35k uncompressed download speed tho).
The server is good enough that Windows 10 saw the W95 client as well(in the local network) w/ SMB 1.0 enabled, but can't connect to it somehow(probably bc of unknown local network broadcast issues still unresolved in the server builds).

Probably some simple networking driver might work in MS-DOS, like mtcp suite?

Basically miniterm(from arachne with arachne.cfg file configured), dospppd and something else?
Edit: Basically https://misterfpga.org/viewtopic.php?t=896

But instead of step 4 in that tutorial, use Arachne's cfg(to dial UniPCemu's (own) IP address and port to make it dial it's server. Then, just follow the steps after to launch EPPPD and use MTCP. Perhaps other network tools run as well, like subst etc. for network drives? Didn't try such a setup yet tho.

Edit: Once configuring the IPv4 address manually in the settings (assuming EPPPD doesn't write it somewhere to view, maybe the tcp-up.bat if it creates that? It's settings seemed to match the PPP server's for the current client at least. Didn't check if created at that time tho.).
Then running the ip-up.bat with the settings and then the following commands to setup the MTCP suite, it ran without visible issues. Ran FTP for a bit, then telnet onto starbase21's BBS and chatted on their teleconferencing a bit. 😁

Although for some weird reason it still can't connect to the host computer directly on the local network (probably because of the local subnet broadcast address perhaps not working properly from the other subnet UniPCemu's server uses for it's clients in this configuration).

Last edited by superfury on 2022-08-23, 03:21. Edited 2 times in total.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 11, by javispedro1

User metadata
Rank Member
Rank
Member
phix wrote on 2022-08-22, 14:04:

My first idea was to write a "small" TSR program that just wrapped the DOS IO API functions. The problem with this is that the API is quite big and the concept of default devices makes it more complicated.
I then considered using the network and create some kind of network share and having a built in server in the emulator. This is also quite complicated. 🙁

Wouldn't a DOS network redirector fit the bill here?
That's a what I did for my virtualbox project. https://git.javispedro.com/cgit/vbados.git/ab … -shared-folders
You can also see the EtherDFS project for a similar approach over the network, or vmsmount for VMware.

I think that the redirector API is not that big, specially if you can code all the difficult parts "server-side"/"host-side" with a nice runtime and plenty of memory. This is the approach that EtherDFS took in which the DOS side is as small as it gets, with most of the logic on the server. If you have to implement too much logic on the TSR, it quickly starts becoming complicated.

You have also examples of redirector TSR in some DOS books like Undocumented DOS which I used as basis.

Other alternatives that I can think of are
* vvfat, qemu's "virtual vfat" device which can simulate an actual fat filesystem at the block-level containing files from a host directory
* a laplink server or something which is not a fullblown network protocol

Last edited by javispedro1 on 2022-08-23, 11:13. Edited 1 time in total.

Reply 4 of 11, by phix

User metadata
Rank Newbie
Rank
Newbie

Thanks for the tips!

I currently have network support so my solution at the moment is something similar to what @superfury is suggesting.

I think VBSF is kind of what I was looking for. Thank @javispedro1 for pointing me in that direction. 😀

Thanks!

VirtualXT - A portable, lightweight Turbo PC/XT emulator written in C.

Reply 6 of 11, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

I used MS Client 3.0 and it's kinda working using Virtualboxs' NIC card (not through host-share but via normal network share). https://wiki.samba.org/index.php/Configuring_ … s_a_Samba_Share
It's FreeDOS wiki but I tried use in on MS DOS 7.0 and it works for my NAS (linux server with samba). For my Windows host it works when I changed my host from SAMBA2.0 to 1.0.

About the title, virtual file system, Do you happen to have any materials on how to do it?
I'm planning to write a (open-sourced) USB disk driver for DOS, and the I/O part is well documented in the USB spec. The problem is how to create a DOS drive and map its IO operations(to USB transfer).
AFAIK the RAMDRIVE.SYS is doing so using system RAM. and so does the IBM PC DOS's VDISK.SYS (ASM source could be found on the net).
But those are SYS files, installed during DOS booting. and what I'm doing is a TSR. The MS Client 3.0 (SHARE.EXE) also build a virtual drive that map disk I/O ops to network IO, and its TSR. it might be the same for MSCDEX which will created a drive to access CDROM; it may depend on other cdrom sys but the new drive is created on the fly.
So I think is totally possible but I'm out of idea how do to this, maybe hooking DOS API (INT 21h) is the right way? Is there some undocumented API?

Don't want to post a new thread so I post as a reply here. Any help will be appreciated.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 7 of 11, by javispedro1

User metadata
Rank Member
Rank
Member

I don't think you want a redirector, rather you really want a device driver so that DOS can mount your USB disk and handle filesystems for you. It'll be simpler than a redirector, even!

Note that a device driver .sys file can be loaded at runtime using any of the popular DEVLOAD equivalents.
It is also perfectly possible to do a device driver in a TSR, or even a hybrid, see e.g. rdisk (a ramdisk equivalent) https://gitlab.com/FreeDOS/drivers/rdisk/-/tr … er/SOURCE/RDISK
(But why? a .sys is also OK...)

I think one problem of doing a USB driver like this is the USB stack. The moment you start operating the xHCI the BIOS is likely to relinquish control of it (or at least fail), so it will stop handling USB disks, USB mice, etc. for you. Which means that now all of it must now be handled from drivers. Drivers which generally are not happy with sharing control of xHCI. How can we do this is there's not even a universal protocol for USB stacks in DOS ? The very first time you load your device driver for USB disks, you will stop being able to use USB mouses ; and viceversa.

This means it's not ideal to have USB drivers from multiple people in the same system.
There was some attempt to do a generic USB API at http://bretjohnson.us/ , which is open source. I used to play with it many years ago, it was nice code, some of it C; I don't know the state these days.

Reply 8 of 11, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

Thanks javispedro1!

The background of my need is actually like this: I've done a USB (OPL3 sound) TSR driver with a custom USB stack, and the problem is exactly as you said. it will make existing USB devices(disks, keyboards, mice etc) not working since my driver will take control of the controller from BIOS, that's why I want add disk/HID support to it, like an all-in-one (not seriously but mostly useful) driver. DOS driver for RetroWave OPL3

I have read the http://bretjohnson.us/ before I started. Is better that it is a more generic API that other drivers can co-exist, with it as a base stack layer, but still the problem is nobody writes drivers on it.
My code is based on an old C code which was half-working. It is still experimental. 😁

I think I will read the RDISK source to see how it handles the dos drive, thanks again!

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 9 of 11, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

I've simply read the RDISK.ASM, it seems get DOS's "list of lists" (INT 21h AH=52h http://mirror.cs.msu.ru/oldlinux.org/Linux.ol … tml/rb-2983.htm ) which contains the NUL device driver header and its linkage (linked list), and add the new driver to the list. and other things. Now I'm ready to give it a try. 😁

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 10 of 11, by crazii

User metadata
Rank Oldbie
Rank
Oldbie

UPDATE: I've done the USB disk driver that mounts the disk or its partition as a disk drive, it DOS drive(partition) only so FDISK cannot detect the disk with out BIOS support.
Found interesting stuff here: https://stackoverflow.com/questions/45891044/ … rs-in-real-mode
I think maybe I can change the BIOS disk number and hook INT13h disk calls to make FDISK working, especially for making the disk bootable. But I'm not really gonna do that since there's plenty of modern tools that make a USB disk bootable.

Toshiba Satellite Pro 4300 - YMF744, Savage IX
Toshiba Satellite 2805-S501 - YMF754, GeForce 2Go
IBM Thinkpad A21p - CS4624, Mobility Radeon 128
main: Intel NUC11PHKi7C Phantom Canyon: i7-1165G7 RTX2060 64G 2T760PSDD

Reply 11 of 11, by DaveDDS

User metadata
Rank Newbie
Rank
Newbie

I move files to and from various DOS environments all the time, using a
little tool I wrote years ago called "DDLINK".

DDLINK is free from my site (below) and performs decently fast file transfers
over Serial (up to 115200), Parallel or LAN (both much faster).

It's small (15k .COM) and needs only a "crynwr" packet driver for network.
(these are available for a LOT of network cards)

It's ideal for simpler DOS systems which don't have any kind of Networking
or USB support. Nothing has to be "installed" (the crynwr drivers are TSR's
that can be loaded/unloaded "on the fly" from the DOS command line, which
is also how you launch DDLINK.

If can even "bootstrap" itself to new DOS system over a serial port, needing
only the built-in "CTTY" command on the target!

It's a DOS program, but it does run well on DosBox (and the DosBox NE2000
emulation works!) - making it easy to move files to/from DOS and Windows,
Linux etc. I usually use the old HAL-9000 "Megabuild 6" which also does
not need to be installed and is <4M total. I also use it under DosBox-X
and that works well too!

I use it to move things on/off of:
"real" DOS systems (like my ImageDisk system - a P200 MMX).
DOS running in "VMWARE Player" or "VirtualBox"
DOS booted under DosBox

I do still have some "old" ISA and PCI network card, which lets me get
network access on pretty much ANY older "hardware" system!

Dave Dunfield ::: https://dunfield.themindfactory.com
or: "Daves Old Computers" -> Personal (near bottom)