home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_27_1988_Transactor_Publishing.d64
/
shellram.sda
/
SHELLRAM.EDME
< prev
next >
Wrap
Text File
|
2023-02-26
|
5KB
|
182 lines
shellram: A shell for POWER C
designed to work with the
1764 RAM disk
The files in this archive allow you
to assemble, using c/assm, and link,
using the POWER C linker, a shell which
can be used on the Commodore 64 in
conjunction with the Commodore 1764
256K Ram Expander, since it leaves
a page of memory free for use as the
"RAM Disk Interface Page", as required
by the RAM Disk Software as provided
with the cartridge.
To assemble it will require the c/assm
program, from Mark Rinfret and Ray
Zarling. Each ".a" file from this
archive should be assembled to produce
the corresponding ".o".
Linking will require the POWER C (or C
Power) linker, as follows:
$ link -s $0801
> shellmain.o
> c$getchar.o
> dprintf.o
> doload.o
> srchcmd.o
> shellstr.o
> shellcenv.o
> c64kernal.o
> shellvar.o
>
output file name: shellram
$
To run it, using the RAM disk, the RAM
disk should first be initialized,
using page 22 (hex $16) as the
interface page. The small basic program
on the disk, 'cstart', actually does
this for you. It requires a copy of the
RAM disk binary image, ramdos??????.bas,
to be copied onto the disk. This
program should have come with your 1764
RAM expander. 'cstart' also arranges to
use the 'exec' utility (which you may or
may not have), to set up your RAM disk
for use.
The C program 'twincopy' is a relatively
convenient way of copying files from a
real disk to the RAM disk, or vice
versa. 'twincopy' will copy files from
the current 'sys' device to the current
'work' device.
Therefore:
% sys 8 0
% work 9 0
% twincopy xxx
will copy file 'xxx' from a device 8 to
device 9. Usually this will copy from
a real disk to the RAM disk.
% sys 9 0
% work 8 0
% twincopy xxx
would copy the other way.
Note that 'twincopy' must be linked
with the object file 'shellcenv.o' to
resolve some of its references.
Extra features in 'shellram':
1) a 'col' command can be optionally
assembled in (the source is distributed
to provide it), compatible with the
'col' command of the POWER C 128 shell:
col <char> <background> <dummy> <border>
2) Since leading non-alphabetics are
always ignored on each command line,
lines can easily be re-entered by
cursoring up to them and pressing
<return>. Some people might not like
this if they have taken to saying things
like ">> print ...", but "print ... >>"
is equivalent.
3) Better management is done of the
file units used for command channels.
This is primarily of significance to
users of dual disk drives, such as the
MSD SD-2. It allows "ls >", and,
means that programs loaded from the
sys drive of the dual drive can do
file redirection the first time they
are loaded. If you have a dual drive,
you might know what I mean. Otherwise,
don't worry about it.
4) prompt is '%' rather than '$' to
remind you it's different. Of course,
you can modify the source to use
whatever character you like.
The file 'newcc.a' is a c/assm source
to produce a of version of the 'cc.sh'
program which will work with both 'sys'
and 'work' devices set to be the RAM
disk. The 'compiler' and 'translator'
programs from the POWER C 64
distribution disk should be copied to
the RAM disk, as well as the C source
to be compiled for this version to work.
(It will also work with real disk
drives, however). In addition to
supporting the RAM disk, 'newcc' also
allows more than one C program to be
compiled with a single command line.
Note that both 'twincopy' and 'newcc'
must be linked with the object file
'shellcenv.o' to resolve some of their
references.
PROBLEMS with the 1764 Interface, and
the RAMDOS software in particula
(In addition to those noted in the
Commodore documentation):
1) A simple
chkin,chrin,clrchn,chkout,chrout,clrchn
loop to attempt to copy from one file
on the RAM disk to another also on the
RAM disk
a) is VERY slow
b) generates erroneous output
characters (at 256 byte intervals)
A multiple character buffer must be
used, which is generally better
programming practice, anyway. See
twincopy.c, for example.
2) (Possibly related)
While preparing the shell source
itself for distribution, I discovered
that assm.sh generated erroneous output
when assembling a file on/to the RAM
disk. But this was only in one case:
The file srchcmd.a, when the symbol
colcmd is set to zero, will generate
one erroneous output byte. I don't know
whether this is because of the nature
of the conditional compile, because it
uses a .dseg, or some other problem.
-- Adrian Pepper
March, 1988