# URGENT: Transfer a file from linux to win95 via com1 or lpt1

## khermans

I am trying to get a file onto an old semi-corrupted install of win 95 on an old toshiba 620ct laptop which has:

- NO CDROM

- NO FLOPPY

- NO ETHERNET

but does have:

+ Keyboard

+ Serial port

+ Parallel port

+ PCMCIA (but no drivers for anything i try to plug in on win 95)

I am wondering if there is some way to transfer files with the available forms of input so that I can further get an external backpack cdrom driver working or the PCMCIA ethernet adapter (i have no driver on win 95 by default). I have successfully tested between two other laptops with floppies a transfer over paraller ports using LPTDOS, which sets up a client/server to transfer files over LPT ports. Can some old school linux/dos/win95 experts help me out here? Any suggestions? This is kind of urgent...

Kristian Hermansen

PS - I am trying to prevent myself from typing into windows 95 dos debug command all the hex data from LPTDOS.EXE, about 16,000 or 8,000 bytes if packed with UPX  :Wink:   I have tried "cat foo > /dev/lp0" and "cat foo /de/ttyS0", but the real problem is getting Windows 95 to accept any input and get it out to file.  If there is a way to "poison" the win 95 / dos memory that will work too, and then I can dump it to disk with the debug write command...thanks

----------

## papal_authority

I think I used HyperTerm (or something like it) years ago to transfer a file to SunOS. Can't you just take out the windows HD and mount it in your Linux box temporarily though?

----------

## khermans

 *papal_authority wrote:*   

> I think I used HyperTerm (or something like it) years ago to transfer a file to SunOS. Can't you just take out the windows HD and mount it in your Linux box temporarily though?

 

hahahah...this is a laptop so I can't have two devices in at the same time  :Razz:   I have anothe laptop, but if I try to put in the windows 95 harddrive into this other laptop, i can say quite surely that the OS wont boot and end in BSOD since there are no drivers for this laptop in the win 95 drive...good try though - i thought of that a while ago.  If this was a desktop, that wouldn't be a problem...

Kristian Hermansen

----------

## kpack

You should be able to create a PPP connection. See the following link:

http://www.linuxgazette.com/issue41/smyth.html

----------

## khermans

I am running latest Gentoo and 2.6.7 kernel and can't seem to locate the getty program anywhere.  I see mgetty and other variants in portage, but I can't get them set up correcty to work with this setup!  I am still lost andneed some help on this if anyone could lend a hand. I also have Windows machine to setup a connection so if anyone could figure out how to transfer files that way would be great.  I can't use DIRECT CABLE CONNECTION since it is not installed already on the win 95 laptop and ther eis no way to input data to the klaptop  :Sad:   Any more suggestions?  ctty com1 worked and I can now execute commands on the win95 system while in a terminal emulator from windows xp.  This doesn't allow me to send binary files though...really could use some suggestions!!!

Kristian Hermansen

----------

## nobspangle

hyperterminal has a "receive file" option, you might be able to use kermit to connect the two machines.

----------

## khermans

 *nobspangle wrote:*   

> hyperterminal has a "receive file" option, you might be able to use kermit to connect the two machines.

 

Hehehe...Windows 95 version doesn't support that feature  :Smile:   But noce try!  I am almost about to give up.  I managed to use "ctty com1" and "copy com1 foo.exe", but the resultant files get obliterated due to transmission corruption.  Also when do this, one needs to remove all or convert the CTRL-Z (hex 1A) characters and add one at the very end to allow the transmission to even occur and be written to disk, otherwise you get premature EOF writes to disk or nothing at all...I'm still playing with it to see if there is anything I can do...

Kristian Hermansen

----------

## pactoo

Maybe the net-misc/lrzsz port will do. There are a couple of free (beer)  x/y/z-modem Clients for windows floating around.

Rumors are, that even minicom can transfer files, but never tested it and I do not know the requirements on the windows side of things.

----------

## khermans

I tried to set up the ppp server on Linux, but getty is not around anymore and was replaced by mgetty and other variants.  The problem is that with the link toward the top about ppp and linux setup, the same config options don't apply and anything I have tried to hack together w/ mgetty have failed  :Sad:   Working with what I have on the 95 machine, I tried the DOS debug command to output/input bytes over a port, but that does not seem to work.  It seems that it should be possible to grab some short snippets of assembly code that opens a port on com1 and accepts binary data and outputs it to a file with some sort of CRC checking to prevent the corruption, but it needs to be really small to mitigate the problems and hopefully it could then be assembled using the DOS debug command and executed/written to disk.  I have taken intro level assembly programmign and love it, but I never did any type of networking with it  :Sad:   Could someone point me in the right direction to possible code snippets to make this happen?

Kristian Hermansen

----------

## NeddySeagoon

khermans,

First, get a serial link going both ways between the PCs involved. You will need hardware handshaking - a null modem cable should provide all the connectivity you need.

Experiment with speed - 9,600 baud will be OK - I hope its a small file. DOS will drop characters above this rate. 

Since it appears you are trying to send a binary file, you need to encode it to send it as ASCII. Use UUencode at the transmitting end and UUdecode at the receving end. You may need to run the encoding and decoding steps as pre and post processing steps.

At the receiving end, in a DOS box, type com1: > UUenc.txt to save the incoming file. At the tramsmitting end, send the UUencoded file to the serial port. When the file has gone, send another 8kb or so of text rubbish. This is to ensure the end of the transmitted file is written to disc before you manually break the connection.

At the receiving end, hit Ctrl-C. This terminates the receiver without flushing buffers to disc, hence the requirement for the rubbish. The rubbish needs to be at least the disc cluster size on the receiving machine. If UUdecode complains that the end of the file is missing, send it all again and double the size of the rubbish, up to a max of 32kb 

Now decode the file. I'm sure Win95 has can do UUdecoding without further help. Try a mail application - it was a popular way to send 8 bit stuff over a 7 bit channel at one time. the rubbish at the end of the file will be ignored by UUdecode.

Practice with a small file.

----------

## hardcore

Do you have access to a desktop computer?  If so you can get a laptop to IDE converter.  Mount the laptop drive on your desktop, and problem solved.

----------

## khermans

 *hardcore wrote:*   

> Do you have access to a desktop computer?  If so you can get a laptop to IDE converter.  Mount the laptop drive on your desktop, and problem solved.

 

Yes I thought about that.  hehehe...although I wasn't sure that they even made laptop to IDE converters!  I took the whole laptop apart (almost broke it in the process) only to realize that I did not have such a converter  :Sad:   I am going to google for one right now, but post a link if you know where to find them on the cheap!!!  Newegg???

Kristian Hermansen

----------

## hardcore

 *khermans wrote:*   

> 
> 
> Yes I thought about that.  hehehe...although I wasn't sure that they even made laptop to IDE converters!  I took the whole laptop apart (almost broke it in the process) only to realize that I did not have such a converter   I am going to google for one right now, but post a link if you know where to find them on the cheap!!!  Newegg???
> 
> Kristian Hermansen

 

I think they even sell them at Radioshack.  Lemme look around real quick like.

----------

## hardcore

Well I can't find them at either Radioshack or Newegg.  Newegg has USB to Serial and USB to parallel converters.

Wait I found one at TigerDirect, here's the link, only $10  :Wink: 

http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=244974&Tab=11&NoMapp=0

----------

## tatesworld

did you try what NeddySeagoon suggested,

if you have qbasic.exe or gwbasic  installed in windows 95

hand type in uudecode.bas (serach in google, its on simtel net) to create uudecode.com to decode

or alternately if you have debug.exe somewhere to get uudecode binary 

search for a file uudecode.dbg (also on simtel net) and hand type in debug.

----------

## khermans

 *tatesworld wrote:*   

> did you try what NeddySeagoon suggested,
> 
> if you have qbasic.exe or gwbasic  installed in windows 95
> 
> hand type in uudecode.bas (serach in google, its on simtel net) to create uudecode.com to decode
> ...

 

Yeah I found the basic conversion stuff, about 75 lines of code only, not bad  :Smile:   Now I don't get to see the laptop again until this weekend, but I will keep you posted on what happens.  My only concern is that the Win 95 laptop may have an OEM Windows 95 OS version installed which lacks QBASIC  :Sad:   I will find out soon enough...I am going insane!

BTW, I found a laptop ---> IDE cable converter for $4.50 on Amazon.com used!  It should take a little while before it gets here though, and if I end up not needing it immediately, well I'll probably need it sometime in the future on other frustrating time-consuming projects...

Kristian Hermansen

----------

