Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DOS to WIN32 Redirector

18 views
Skip to first unread message

abaird

unread,
Nov 7, 2009, 6:21:13 AM11/7/09
to
Anyone come across a good network redirector via TCPIP to read/write
Win32 drives?
I have done quire a bit of work with CPHANTOM using sockets to
impliment a redirector. Just curious as to what else is out there.
Andre

Rod Pemberton

unread,
Nov 9, 2009, 3:31:30 AM11/9/09
to
"abaird" <b...@bairdtech.com> wrote in message
news:189946cd-76df-45d2...@l2g2000yqd.googlegroups.com...

> Anyone come across a good network redirector via TCPIP to read/write
> Win32 drives?

Not I. Rudy Weiser was asking about network redirectors here some time ago.
A few posts have shown up by him on alt.lang.asm lately.

> I have done quire a bit of work with CPHANTOM using sockets to
> impliment a redirector. Just curious as to what else is out there.

Are you just wanting a list? This is stuff I found a few years ago.

CPHANTOM by Thomas F. Divine (CPHANTOM.zip or CPHANTOM1.zip)
http://www.pcausa.com/resources/ifsqlist.html

A "ramdrive" by Davin McCall to comp.os.msdos.programmer
http://groups.google.com/group/comp.os.msdos.programmer/msg/36b34f208807076b

CMU's Mach DOS emulator i386.mdos.src.tar.Z from here:
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/mach/public/src/

CDROM.C by Jim Harper (possibly from DDJ)

IHPFS (An HPFS Driver for DOS) by Marcus Better (IHPFS115.zip or
IHPFS128.zip or IHPFS129.arj)

RIFS (Remote Installable File System) by Kyle A. York (DOSRIF.zip or
DOSRIFS.zip or DOSRIFS2.zip)


Rod Pemberton


abaird

unread,
Nov 16, 2009, 7:53:33 AM11/16/09
to
Thanks Rod,
The list you gave is exactly what I used to impliment my redirector. I
replaced the "canned" file system with a TCPIP link and a "console"
C# .NET app that allows me to run a remote DOS session via a VPN. My
DOS PC gets a new drive which is a folder on a server2003 machine. I
connect to about 500 remote PC's.
I use 3 sockets for the IFS, Console and File i/o
Its one way though, Windows cannot see my Dos drives. Only Dos sees my
Win folder.
Dos exe is about 83K. I avoided using a TSR by shelling out to
command.com so all my interupts still function as normal within my
app, including the sockets.
What would have been better is an SMB server but that looked like
work.
Andre

Rod Pemberton

unread,
Nov 16, 2009, 10:56:27 AM11/16/09
to
"abaird" <b...@bairdtech.com> wrote in message
news:a0f85a7a-9ce6-413f...@b15g2000yqd.googlegroups.com...

>
> The list you gave is exactly what I used to impliment my redirector.
...

> > CDROM.C by Jim Harper (possibly from DDJ)

Found a copy of Jim Harper's code (posted by me...) from "How to cope with
non-terminated actions (like FindFirst/Next)" thread:
http://groups.google.com/group/comp.os.msdos.programmer/msg/d05cabd08835c496?hl=en

> I
> replaced the "canned" file system with a TCPIP link and a "console"
> C# .NET app that allows me to run a remote DOS session via a VPN. My
> DOS PC gets a new drive which is a folder on a server2003 machine. I
> connect to about 500 remote PC's.
> I use 3 sockets for the IFS, Console and File i/o
> Its one way though, Windows cannot see my Dos drives. Only Dos sees my
> Win folder.
> Dos exe is about 83K. I avoided using a TSR by shelling out to
> command.com so all my interupts still function as normal within my
> app, including the sockets.
> What would have been better is an SMB server but that looked like
> work.

IIRC, Rudy was having problems with Findfirst/Findnext. I don't know if he
ever solved that. It's too bad he doesn't seem to be around... If you
click the link above, you can get to the entire thread. Ditto, if you want
to read the thread for one of these:

List of supported functions in DR-DOS and CPhantom (from me) from "INT 2f
112E (IFS extended open) arguments confusion ..." thread:
http://groups.google.com/group/comp.os.msdos.programmer/msg/775e154fe89e4bbd?hl=en
http://groups.google.com/group/comp.os.msdos.programmer/msg/9b49bc5b8af70dde?hl=en

Some assembly source for a redirector by "Dav":
http://groups.google.com/group/comp.os.msdos.programmer/msg/36b34f208807076b?hl=en

There might be more buried somewhere. I'd have to do more unique or more
generic searches.


Rod Pemberton


abaird

unread,
Nov 16, 2009, 2:24:46 PM11/16/09
to
On Nov 16, 5:56 pm, "Rod Pemberton" <do_not_h...@nohavenot.cmm> wrote:
> "abaird" <b...@bairdtech.com> wrote in message
>
> news:a0f85a7a-9ce6-413f...@b15g2000yqd.googlegroups.com...
>
> > The list you gave is exactly what I used to impliment my redirector.
>
> ...
>
> > > CDROM.C by Jim Harper (possibly from DDJ)
>
> Found a copy of Jim Harper's code (posted by me...) from "How to cope with
> non-terminated actions (like FindFirst/Next)" thread:http://groups.google.com/group/comp.os.msdos.programmer/msg/d05cabd08...

>
> > I
> > replaced the "canned" file system with a TCPIP link and a "console"
> > C# .NET app that allows me to run a remote DOS session via a VPN. My
> > DOS PC gets a new drive which is a folder on a server2003 machine. I
> > connect to about 500 remote PC's.
> > I use 3 sockets for the IFS, Console and File i/o
> > Its one way though, Windows cannot see my Dos drives. Only Dos sees my
> > Win folder.
> > Dos exe is about 83K. I avoided using a TSR by shelling out to
> > command.com so all my interupts still function as normal within my
> > app, including the sockets.
> > What would have been better is an SMB server but that looked like
> > work.
>
> IIRC, Rudy was having problems with Findfirst/Findnext.  I don't know if he
> ever solved that.  It's too bad he doesn't seem to be around...  If you
> click the link above, you can get to the entire thread.  Ditto, if you want
> to read the thread for one of these:
>
> List of supported functions in DR-DOS and CPhantom (from me) from "INT 2f
> 112E (IFS extended open) arguments confusion ..." thread:http://groups.google.com/group/comp.os.msdos.programmer/msg/775e154fe...http://groups.google.com/group/comp.os.msdos.programmer/msg/9b49bc5b8...
>
> Some assembly source for a redirector by "Dav":http://groups.google.com/group/comp.os.msdos.programmer/msg/36b34f208...

>
> There might be more buried somewhere.  I'd have to do more unique or more
> generic searches.
>
> Rod Pemberton

Dunno if this will help anyone....
This is my dos code. The TCP pkt contains copies of the SFT, REGS, and
SDA to make it easy to follow and self documenting. I repeated this at
the c# end.
Nowhere do I use any value from the stack as per Thomas CPHANTOM code.

// Find First - Subfunction 1Bh

static int doFindFirst( void )
{
int i;

TCP_SEND_IFS(); // send to c# win app

TCP_RECV_IFS(); // rx from c# win app

/* Initialize Search Template
----------------------------- */

for(i = 0; i < 11; i++)
SDA_SDB.srch_tmpl[i] = TCP_RX.TCP_Data.SDA.sdb.srch_tmpl[i];

SDA_SDB.drv_lett = drive_letter | 0x80;


/* Use These Fields To Save Info We Need For FindNext
----------------------------------------------------- */
SDA_SDB.par_clstr = TCP_RX.TCP_Data.SDA.sdb.par_clstr;
SDA_SDB.dir_entry = TCP_RX.TCP_Data.SDA.sdb.dir_entry;


/* Update found_file Directory Entry Record
------------------------------------------- */
for(i = 0; i < 11; i++)
SDA_FOUND_FILE.fname[i] = TCP_RX.TCP_Data.SDA.found_file.fname[i];


SDA_FOUND_FILE.time_lstupd =
TCP_RX.TCP_Data.SDA.found_file.time_lstupd;
SDA_FOUND_FILE.date_lstupd =
TCP_RX.TCP_Data.SDA.found_file.date_lstupd;

SDA_FOUND_FILE.fattr = TCP_RX.TCP_Data.SDA.found_file.fattr;
SDA_FOUND_FILE.fsiz = TCP_RX.TCP_Data.SDA.found_file.fsiz;


rsPtr->x.flags = TCP_RX.TCP_Data.REGS.x.flags;
rsPtr->x.ax = TCP_RX.TCP_Data.REGS.x.ax;


return( 0 ); // Call Processed
}


/* Find Next - Subfunction 1Ch
------------------------------ */
static int doFindNext( void )
{
int i;
TCP_SEND_IFS();

TCP_RECV_IFS();

SDA_SDB.drv_lett = drive_letter | 0x80;

/* Use These Fields To Save Info We Need For FindNext
----------------------------------------------------- */
SDA_SDB.par_clstr = TCP_RX.TCP_Data.SDA.sdb.par_clstr;
SDA_SDB.dir_entry = TCP_RX.TCP_Data.SDA.sdb.dir_entry;


/* Update found_file Directory Entry Record
------------------------------------------- */
for(i = 0; i < 11; i++)
SDA_FOUND_FILE.fname[i] = TCP_RX.TCP_Data.SDA.found_file.fname[i];


SDA_FOUND_FILE.time_lstupd =
TCP_RX.TCP_Data.SDA.found_file.time_lstupd;
SDA_FOUND_FILE.date_lstupd =
TCP_RX.TCP_Data.SDA.found_file.date_lstupd;

SDA_FOUND_FILE.fattr = TCP_RX.TCP_Data.SDA.found_file.fattr;
SDA_FOUND_FILE.fsiz = TCP_RX.TCP_Data.SDA.found_file.fsiz;


rsPtr->x.flags = TCP_RX.TCP_Data.REGS.x.flags;
rsPtr->x.ax = TCP_RX.TCP_Data.REGS.x.ax;


return( 0 ); // Call Processed
}

This is code from c# for XOPEN

internal static TCP_structs.TCP_data Xopen_file
(TCP_structs.TCP_data tcp_rx)// No wildcards here
{

FileStream fstream;
FileMode fmode;
FileAccess faccess;
FileShare share;
string fn1 = null;
string path = null;
string file_name_xp = null;

UInt16 ret_action = 0;
long reported_file_siz = 0;

System.IO.FileInfo this_file1 = null;

fn1 = ByteArrayToStr(@tcp_rx.SDA.fn1);

path = Path.GetDirectoryName(fn1);

file_name_xp = Path.GetFileName(fn1);


if (Directory.Exists(fn1)) // if directory only,
filename not provided use fffname
{
path = fn1;
file_name_xp = template_to_filename
(tcp_rx.SDA.found_file.fname);// is this the name to open?

}

//Debug.Print("\n\rSPOP ACT = {0} SPOP MODE = {1} FN1 = {2}
SDB fn = {3}", tcp_rx.SDA.spop_act, tcp_rx.SDA.spop_mode,
ByteArrayToStr(@tcp_rx.SDA.fn1), template_to_filename
(tcp_rx.SDA.found_file.fname));

if (Directory.Exists(path))
{
try
{
Directory.SetCurrentDirectory(path);
}

catch (Exception)
{

Debug.Print("fail set CD ");
return FailCall(tcp_rx, PATHNOTFOUND); ;
}

if (File.Exists(file_name_xp))
{
this_file1 = new System.IO.FileInfo(file_name_xp);

if ((tcp_rx.SDA.spop_act & 0x0F) == 0)
{
return FailCall(tcp_rx, ACCESSDENIED); // no
action in var?
}


if ((tcp_rx.SDA.spop_act & (ACT_FILE_TRUNC |
ACT_FILE_OPEN)) != 0)
{
/* Check Access Mode
-------------------- */

switch (tcp_rx.SDA.spop_mode & (MODE_RD_ONLY |
MODE_RD_WR | MODE_WR_ONLY))
{
case MODE_RD_ONLY: break; // Read-Only


case MODE_WR_ONLY: // Write-Only
if ((this_file1.Attributes &
FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
{
return FailCall(tcp_rx,
ACCESSDENIED); // Call Processed
}
break;

case MODE_RD_WR: // Read/Write
if ((this_file1.Attributes &
FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
{
return FailCall(tcp_rx,
ACCESSDENIED); // Call Processed
}
break;

default:
break;
}// end switch

}// end if truncate or open action

if ((tcp_rx.SDA.spop_act & ACT_FILE_TRUNC) ==
ACT_FILE_TRUNC)
{
reported_file_siz = 0;
ret_action |= (UInt16)FILE_REPLACED_OPENED;
reported_file_siz = 0;
fmode = FileMode.Truncate;
}
else
{
ret_action |= (UInt16)FILE_EXIST_OPENED;
reported_file_siz = this_file1.Length;
fmode = FileMode.Open;
}

} // end file exist

else
{
ret_action |= (UInt16)FILE_CREATED_OPENED;
reported_file_siz = 0;
fmode = FileMode.CreateNew; // so we make a new one


if (tcp_rx.SDA.spop_mode == MODE_RD_ONLY) // does
not exist but read only?
{

return FailCall(tcp_rx, PATHNOTFOUND);
}

}

//public const Int16 SH_COMPAT = 0x0000;
//public const Int16 SH_DENYRW = 0x0010;
//public const Int16 SH_DENYWR = 0x0020;
//public const Int16 SH_DENYRD = 0x0030;
//public const Int16 SH_DENYNONE = 0x0040;


//share = FileShare.None;

if ((tcp_rx.SDA.spop_mode & MODE_RD_ONLY) ==
MODE_RD_ONLY)
{
share = FileShare.Read;
faccess = FileAccess.Read;
}

if ((tcp_rx.SDA.spop_mode & MODE_WR_ONLY) ==
MODE_WR_ONLY)
{
share = FileShare.None;
faccess = FileAccess.Write;
}

if ((tcp_rx.SDA.spop_mode & MODE_RD_WR) == MODE_RD_WR)
{
share = FileShare.None;
faccess = FileAccess.ReadWrite;
}

if ((tcp_rx.SDA.spop_mode & SH_DENYRW) == SH_DENYRW)
{
share = FileShare.None;
faccess = FileAccess.ReadWrite;
}

if ((tcp_rx.SDA.spop_mode & SH_DENYWR) == SH_DENYWR)
{
share = FileShare.Read;
faccess = FileAccess.ReadWrite;
}

if ((tcp_rx.SDA.spop_mode & SH_DENYRD) == SH_DENYRD)
{
share = FileShare.Write;
faccess = FileAccess.ReadWrite;
}

if ((tcp_rx.SDA.spop_mode & SH_DENYNONE) == SH_DENYNONE)
{
share = FileShare.ReadWrite;
faccess = FileAccess.ReadWrite;
}


try
{
fstream = File.Open(file_name_xp, fmode, faccess,
share);
}
catch (Exception)
{
Debug.Print("Failed to OPEN = {0}", file_name_xp);
return FailCall(tcp_rx, ACCESSDENIED);
}

System.IO.FileInfo this_file = new System.IO.FileInfo
(file_name_xp);

int seconds = 0;
int minutes = 0;
int hours = 0;

seconds = (this_file.LastWriteTime.Second / 2) &
0x01f; // bits 0 - 4
minutes = (this_file.LastWriteTime.Minute & 0x3f) <<
5; // bits 5 - 10
hours = (this_file.LastWriteTime.Hour & 0x1f) << 11; //
bits 11 - 15 // 0 - 24 hours

int day = 0;
int month = 0;
int years = 0;

day = this_file.LastWriteTime.Day & 0x1f; // bits
0 - 4
month = ( this_file.LastWriteTime.Month & 0x0f) <<
5; // bits 5 - 8
years = ((this_file.LastWriteTime.Year - 1980) & 0x7f)
<< 9; // bits 9 - 15 // year ret = ie 2008 DOS needs years since
1980


// return values
tcp_rx.REGS.x.cx = ret_action;//3
tcp_rx.REGS.x.dx = tcp_rx.REGS.x.cx;
//tcp_rx.SDA.found_file.fname = DOS_filename_template
(file_name_xp, false);

tcp_rx.SDA.found_file.fsiz = (Int32)reported_file_siz;//
(Int32)this_file.Length;
tcp_rx.SDA.found_file.fattr = dos_attribute_get
(this_file);// fixit
tcp_rx.SDA.found_file.time_lstupd = (Int16)(seconds |
minutes | hours);
tcp_rx.SDA.found_file.date_lstupd = (Int16)(day | month
| years); ;

tcp_rx.REGS.x.ax = assign_DOS_handle(fstream);
Debug.Print("\n\rReported file size = {0}",
reported_file_siz);

return tcp_rx;

} // end dir exist?

return FailCall(tcp_rx, PATHNOTFOUND);

} // end XOPEN

Rod Pemberton

unread,
Nov 25, 2009, 9:23:56 PM11/25/09
to
"Rod Pemberton" <do_no...@nohavenot.cmm> wrote in message
news:hdrsqf$r8v$1...@aioe.org...
> There might be more [DOS redirector related projects]

> buried somewhere. I'd have to do more unique or more
> generic searches.
>

"Building a DOS Serial Network", by Kyle York, in Dr. Dobb's Journal, May 1,
1996.
http://www.ddj.com/184409879


Rod Pemberton


0 new messages