[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI> Hitch-Hiking from Sun/*NIX to Apple // via Mac and back




Hi there,

I have just transferred some CP/M text files from an Apple //c to my Sun and
I'm about to LaTeX them in a different window; here's the story about
this (fianlly successful) endeavour, the problems and some possible solutions.

Thanks for those who provided pointers, putting all of them together
(almost) got me the solution...

Have fun,	-joke
--

                   HITCH-HIKING
         FROM CP/M TO PRODOS TO MACOS TO SUNOS
                     AND BACK
              (IN ONLY FOURTEEN DAYS)

               by Joerg Heitkoetter
               joke@Germany.EU.net


Prelude
****************************************************************************

Well, folks, I really hope this makes it's way into some FAQs, it's a short
story about how to get some old short stories I wrote using WORDSTAR under
Apple CP/M 56k on my Apple ][+.


Dramatis Personae
****************************************************************************

1 x Sun SPARC Classic SunOS 4.1.3
1 x PowerMac MacOS 7.5.1
1 x Apple //c ProDOS 8, CP/M 56k
1 x Ex-Apple 2 Hacker (31) Really hot & strong coffee
+ various folks from the net


ONE
****************************************************************************
A (possibly impossible) Mission

I still keep my old 5.25" Apple disks in a bottom drawer and always wanted to
convert some of the files, in particular some of my ten year old short
stories, since I don't want to type them in again; I simply want to copy the
files so I could use them on my Sun; but only recently I found some time, so I
reassembled my Apple ][, but found that the 80 column & printer card seem to
be broke. Well I didn't touch it for almost 8 years, so that's understandable.
But what now?

Luckily, a colleague of mine offered me his Apple //c which has 2x5.25" (#6)
and 2x3.5" drives (#5); and so I just neeed a program that would be able
to transfer the CP/M files from the 5.25" disks to the ProDOS 3.5" (800k)
disks, whcih then can be read my my PowerMac and moved over to my Sun
SPARC ia TCP/IP. That's the theoretical part.

On with the practical part: the first thing to do is to find a FAQ because
many other folks might have had the same problem. But which FAQ? The CP/M FAQ
im comp.os.cpm or the comp.sys.apple FAQ or ...?

Ok; I got stuck and send out a request in some newsgroups on
August 18  with "Subject: Q> from CP/M to DOS?"

Many folks replied, I was pointed to the FAQs, the repository at asimov.net
and a program called CHAMELEON which would do the transfer job.

[BTW: I remember that the PEEKER, a German Apple 2 magazine which has long
folded once offered a contest in writing the shortest conversion program to
convert anything from Apple CP/M, UCSD Pascal, DOS3.3 and ProDOS to anything
else; maybe someone still has the program which won this contest? Is Uli
Stiehl, the editor of PEEKER online anywhere?]


TWO
****************************************************************************
A troublesome Chameleon

I now have CHAMELEON.SHK on my Sun, but how do I unpack it? The c.s.a2 FAQ 
tells me I have to find nulib432; I find it on a SunSITE Linux mirror
and try to compile the beast; error messages appear...

I take a closer look and find a "stdio.h" in the source directory.
Wow! Truly a UNIX professional, who ceated this package... oh, boy.
So I delete the" stdio.h" and I got nulib compiled without any
tweaks.

[I also tried to download A2dearc.gz from asimov.net which is said to be
a Mac utility to unpack .SHK files; I don't know since downloading with
Netscape which results in automatic UnStuffing, which doens't give me an
executable; I'd suggest to upload A2dearc.hqx to asimov!!]

Ok, it's time for a second mail.
--
From: jh@Germany.EU.net (Joerg Heitkoetter)
Newsgroups: comp.sys.apple2,comp.emulators.apple2
Subject: Sun to Mac to //c and back
Date: 30 Aug 1996 19:44:03 +0200
Organization: EUnet Deutschland GmbH, Research & Development

Folks,

I want to transfer some old textfiles from CP/M on 5.25"
disks to my Sun; so I first have to gather the programs for this
task from the net, as per FAQ:

(1) get CHAMELEON.SHK a progam that is said to be able to read
    CP/M disks from ProDOS

(2) get an archiver which can read the CHAMELON.SHK file;

Fine; So I get the CHAMELON.SHK file, and find I need nulib,
for UNIX so I get nulib (from a Linux archive) [which btw is bundled
with a stdio.h (Wow!) and therefore cannot be compiled out of
the box -> THROW the stdio.h away! and it compiles fine...]

I compile nulib and find that my CHAMELON.SHK file contains the
things I want:

jazz(jh): ~/tmp/apple2> nulib v CHAMELEON.SHK
 CHAMELEON.SHK   Created:01-Jul-91  21:52   Mod:01-Jul-91  21:52     Recs:    2

 Name                  Kind  Typ  Auxtyp Archived         Fmat Size Un-Length
-----------------------------------------------------------------------------
 CHAM.SYSTEM           File  SYS  $2000  01-Jul-91  21:52  shk  83%     19516
 CHAMELEON.DOC         File  TXT  $0000  01-Jul-91  21:52  shk  54%     27341

(have an eye on the "Typ" section) so I extract the files:

jazz(jh): ~/tmp/apple2> nulib xv CHAMELEON.SHK
Extracting 'CHAM.SYSTEM' (data)...overwriting...unshrinking (I)...done.
Extracting 'CHAMELEON.DOC' (data)...overwriting...unshrinking (I)...done.

Then I start Fetch on my Mac and transfer the files to a ProDOS 720K
disk; great I think and move the disk over to the //c and voila
the disk is readable; but--the files have type $00 not SYS and TXT
as expected; ok I thought, let's bload the files and bsave them with the
appropriate type; but this doesn't seem to work; it's
always WRONG FILE TYPE (load, bload, run, exec, whatever);

So here's the question: How do I change the attribute of a ProDOS
file from $00 to SYS/TXT/whatever? and What's wrong in the above?

-- 
Have fun,	-joke

Boah ey, bei EUnet gib's jetz' den Interschrott Exploder 3.0 f�r umsonst.
(Wow, EUnet now offers the fine Microsoft Explorer 3.0 for free download.)


THREE
****************************************************************************
Problems, and non-problems.

The second requests gives me many answers of which I would like to quote some,
because none of them works. And I have to come up with an alternate solution.

Newsgroups: comp.sys.apple2,comp.emulators.apple2
From: skaratso@oucsace.cs.ohiou.edu (Stavros Robert Karatsoridis)
Subject: Re: Sun to Mac to //c and back
Organization: Ohio University C.S. Dept, Athens
Date: Fri, 30 Aug 96 20:52:04 MET DST

[..]
Well, I don't know about the ".DOC" file, which you should be able to read
on the UNIX box or the Mac. As for the other program, here is a work-around:

Get into ProDOS BASIC

Insert the Chameleon disk, and type

PR#3
CATALOG

Look at the catalog, at the ENDFILE column. Write the number you see there
on the line that contains CHAM.SYSTEM

Then type,

CREATE CHAM2.SYSTEM,TSYS
BLOAD CHAM.SYSTEM,TSYS,A$2000
BSAVE CHAM2.SYSTEM,TSYS,A$2000,Lxxxxx (where xxxxx is the number you got from

the ENDFILE part of the catalog.

To run the program, you should be able to type

-CHAM2.SYSTEM

Hope this helps

Stavros
[EOT]

Good idea, but it doesn't work. My ProDOS version always gets me a FILE TYPE
MISMATCH.


From: shack@deimos.frii.com (Randy Shackelford)
Newsgroups: comp.sys.apple2,comp.emulators.apple2
Subject: Re: Sun to Mac to //c and back
Date: Sat, 31 Aug 96 02:40:39 MET DST
Organization: Front Range Internet, Inc, Fort Collins, Colorado

In article <507pv7$s38@darla.visi.com>, Nathan Mates <nathan@visi.com> wrote:
>In article <507993$2qv@Germany.EU.net>,
>Joerg Heitkoetter <jh@Germany.EU.net> wrote:
>>Then I start Fetch on my Mac and transfer the files to a ProDOS 720K
>>disk; great I think and move the disk over to the //c and voila
>>the disk is readable; but--the files have type $00 not SYS and TXT
>>as expected; ok I thought, let's bload the files and bsave them with the
>>appropriate type; but this doesn't seem to work; it's
>>always WRONG FILE TYPE (load, bload, run, exec, whatever);

Actually BASIC gives FILE TYPE MISMATCH since that's the closest it can get to
ProDOS 8's unsupported storage_type error

>   Shoulda noticed this before; the problem (as email conversations
>seems to have turned out) comes down to 3 letters: M-A-C. Idiot box
>****ing insisits on adding resource forks to files, making them
>unreadable under ProDOS 8.

If a file has no resource fork, copying it to a ProDOS disk doesn't add one;
I just verified this on my Powerbook. I took a copy of Appleworks on a 3.5 disk
and copied all the files to my Powerbook's RAM disk, then put in a blank ProDOS
disk and copied 'em to it. Appleworks ran fine off this disk.

>   I am > < (fingers about 1/8" apart) close to actually recommending
>that people wishing to download stuff to Apple IIs AVOID Macintoshes
>completely. In the FAQ. This is because of their BONEHEADED and
>UNNECESSARY inisistence on adding resource forks.

Doing so would be propagating an inaccuracy, something you've been railing
against so much lately. I have my workstation equipped //e and my IIgses
networked with my Macs, and I can transfer files under ProDOS 8 and they
work slicker than snot.

>   When something appears to do what you want, but prevents you from
>actually doing it, that is worse than not supporting it directly.  If>it's going to trip up far more people than will benefit, I'm going to
>recommend against such things.

What say you get off your Mac hating high horse and help find a solution?
Didn't I see someone saying here not long ago that any file with with a
certain file type/creator combo can be copied to a ProDOS disk without
making the file an extended storage type file? I never worried about finding
out since I never use sneakernet. If you can set the type such that the
files copy properly, end of problem, correct?

Failing that, I have a ProDOS 8 program I wrote for my own use which can read
an extended file's data fork and write its data into a standard file. I also
have an unfinished program for deleting extended files under ProDOS 8. Last
I worked on it, it worked except for causing the blocks_used field of the
volume directory header on the affected disk to be off by one.
--
Randy Shackelford                                 US Air Force officer
shack@frii.com                                    and Apple aficionado
[EOT]


From: shack@deimos.frii.com (Randy Shackelford)
Newsgroups: comp.sys.apple2,comp.emulators.apple2
Subject: problem solved (Re: Sun to Mac to //c and back)
Date: Sat, 31 Aug 96 03:34:38 MET DST
Organization: Front Range Internet, Inc, Fort Collins, Colorado

I jumped on info-mac to see if there was any app to strip the resource fork
off a file. In the disk directory, I found the very thang. It's the file

<ftp://mirrors.aol.com/mir02/INFOMAC/info-mac/disk/file-stripper-utilities.hqx>

It has a drag and drop app for stripping the resource fork and another to do
the same for the data fork. There's even one to strip the name resource,
maybe that would cause files copied to DOS disks to not be forked, who knows.
Here's the procedure for getting a Mac downloaded file to work in ProDOS 8:

download it
drag the file's icon onto the resource fork stripper app icon
copy the file to a ProDOS disk
stick the disk in your Apple II

I tested this with a simpletext file, I got Appleworks to open it pretty as
you please.

Just goes to show how much more productive a little resourcefulness is rather
than mindless griping.
--
Randy Shackelford                                 US Air Force officer
shack@frii.com                                    and Apple aficionado
[EOT]

Good point, resource forks are no problem if all downloads have been
done in binary mode; anyway, I fetched:
ftp://mirrors.aol.com/mir02/INFOMAC/info-mac/disk/file-attributes.hqx
and use it in my solution below.


FOUR
****************************************************************************
What does ProDOS stand for? Professional or Problematic DOS?

ProDOS doesn't have a sort of MS-DOS "attrib" or UNIX "chmod" prgram; however
from the c.s.a FAQ we learn that there's fazz.2.3.bsq which is said to do to
ProDOS files what attrib/chmod/etc does for other operating systems.

However, the .bsq extension tells us that we have to convert this file
with BINSCII, then we need to UnShrink it, see below.

As for ProDOS, the generic way to change the attribute of a ProDOS program is
copied from a reply by Nathan Mates (the very helpful c.s.a2-FAQ maintainer):

     With BLOAD and BSAVE, and non-'BIN' filetypes, you must specify the
  alternate type. For example, to change a filetype from $00 to SYS, try
  the following:

     BLOAD FUBAR,T$00,A$1000,Lxxx
     CREATE BARFU,TSYS
     BSAVE BARFU,TSYS,A$1000,Lxxx

     Where 'xxx' is the file length of the file. If you didn't force
  binary mode in downloading, the filesize will pribably be different
  from what nulib showed. [By the way, the c.s.a2 FAQ has a section on
  changing ProDOS filetypes with a program (that you'd have to
  download), as well as changing it manuall like above in the
  downloading Todd Whitesel's BINSCII.TXT section.]

Now, here comes the fun part: my ProDOS downs't have this byte count (which
anyone else seem to have) I would need for the ",L<bytes>" option.  A "CAT" on
my system just gives me FILENAME, TYPE, LENGTH IN BLOCKS and MODIFIED DATE; I
seem to have a very old version of ProDOS? (It's ProDOS 8 v1.9 10-Jul-89)

And when I try the above I ALWAYS get a "FILE TYPE MISMATCH" error, #@$@$@!


FIVE
****************************************************************************
To BINSCII or not to BINSCII?

Ok, there is a file attribute changing program called fazz.2.3.bsq, which
comes BINSCII encoded; and the BINSCII.TXT file is available from various FTP
servers; so I get it using Netscape and copy it on the ProDOS disk; funny it
has type "$00" which, as we know already, cannot be changed to anything; I
always get a FILE TYPE MISMATCH.

Interesting chicken & egg problem: I cannot use a BINSCII encoded
program with which I would be able to change the file type because I cannot 
change the file type of the BISCII.TXT distribution; and then: if
I was able to change the file type of the BINSCII.TXT file, I wouldn't
need BINSCII.TXT since the  I could simply change the file type of
CHAM.SYSTEM, are you still with me? ;-)


SIX
****************************************************************************
Creators, Resources forks and other Crap

Ok; here's what I did. Since the program was transferred to the Mac via Fetch,
and Fetch asks me which type and creator I would like to add, I simply have a
look at the type/creator of the PRODOS/BASIC.SYSTEM file on the ProDOS disk.
It's PSYS/pdos; so I unpack the CHAMELEON.SHK archive on my Sun using nulib
and download CHAM.SYSTEM once again with Fetch, and give PSYS/pdos as
type/creator; then I copy the file to the ProDOS disk; reboot the Apple //c
with this disk and voila, chameleon starts up; I transfer the files to the
ProDOS disk (unfortunately you have to do this one by one), and insert the
disk into the Mac.

I select all the text files from the disk and drop them in the Fetch
window; then I hurry to the Sun and load the first file; yeah;
we got it made!!!!!

[I also tried to give CHAMELON.DOC a type creator or PTXT/pdos but this
doens't work; I thought that ProDOS TYPES may be P<ProDOS type>, but that's
not the case; for the textfile chose TEXT/pdos and voila...do the same for
BINSCII.TXT, if you have the time...]

Hmm, yes, one caveat: *always* do the conversion on the Mac desktop!
Then copy the file to the ProDOS disk; if you copy anything directly to the
disk, it doesn't work. Only a MacOS-guru will be able to tell us why.


Postlude
****************************************************************************

My requests seem to have triggered a short Mac/Apple 2 flame in comp.sys.
apple2; this was certainly unintended; we all know, that all the Apple 2
afficionados were very angry when Apple release the Macintosh, and it was
simply unaffordable for the rest of us;

Many of the old Apple 2 hackers couldn't go on with Apple but had to get into
other, cheaper platforms. I went on to use an Atari ST, others went PC, et
cetera; well, all this should be (and stay) in the past; peace! ;-)


Unresolved Riddles
****************************************************************************

Well--I still don't know why my ProDOS' CAT doesn't list the byte count of
a file.

Resource forks are no problem, if all downloads happen in binary mode;
forks are added on ProDOS disks, but they are separated from the files,
just like on PC disks; i.e., they do NOT modify the file content.

Some problems may arise, when you download the files directly to the
ProDOS disk; you have to store the files on the Mac's desktop; THEN
copy the files to the disk; I still don't know why.

I guess that the file type can easily be changed with a sector/disk
editor, since it's stored in the ProDOS directory entry somewhere;
who knows which byte has to be changed?

Would anyone please upload A2dearc.hqx to asimov.net?

Have fun,       -joke

===== ______  __         __    ==  J�rg Heitk�tter
==== / __/ / / /__  ___ / /_  ===  Research Fellow, EUnet Engineering Task Force
=== / _// /_/ / _ \/ -_) __/ ====  Emil-Figge-Str. 80, D-44227 Dortmund
== /___/\____/_//_/\__/\__/ =====  Tel/Fax +49-231-972 -1038/-1188

"We are what we repeatedly do. Excellence, then, is not an act, but a habit."
        --Aristotle
-- 
Have fun,	-joke

Boah ey, bei EUnet gib's jetz' den Mickeyschrott Exploder 3.0 f�r lau.
(Wow, EUnet now offers the fine Microsoft Explorer 3.0 for free download.)