This HOWTO: will explain how to Install libdsk Version 1.3.5 & cpmtools Version 2.18, along with the dependencies, that allow READ ONLY
access to Teledisk (*.TD0) files with your Debian 7.x install.
BEFORE YOU TRY A COMPILE YOU MUST INSTALL SOME REQUIRED SOFTWARE:
Typically you need to install build-essential, and the headers for the kernel you are running.
Debian Wheezy (Ver 7.x) Packages needed for Software Compile:
1. Build-Essential
2. Linux debian 3.2.0-4-amd64 Headers (or the Headers for your Version)
- Code: Select all
uname -r
will tell you the kernel you are currently running.
- Code: Select all
sudo apt-get install build-essential linux-headers-$(uname -r)
will install the software needed to successfully compile your source code.
Install Additional Required Software to Compile libdsk and cpmtools:
Install libncurses5-dev:
- Code: Select all
sudo apt-get install libncurses5-dev
At this point you may have had several directory changes or updates, and your system likely needs updated with:
- Code: Select all
sudo updatedb
It's a good idea to execute this command at a regular interval, to keep the database updated for the locate command.
DOWNLOAD THE SOURCE:
Create a new subdirectory of your choice to contain the downloaded source code.
Download both source packages from:
http://www.seasip.info/Unix/LibDsk/libdsk-1.3.5.tar.gz
http://www.moria.de/~michael/cpmtools/c ... .18.tar.gz
Create a subdirectory to contain the source. I used /home/larry/Downloads/cpmtools
Copy both source files to /home/larry/Downloads/cpmtools, then extract the source folders
- Code: Select all
tar -zxvf libdsk-1.3.5.tar.gz
tar -zxvf cpmtools-2.18.tar.gz
The next step you need to do is to find the "SHELL" and "env" you are using, and how many shells are installed and available.
1. env -- Display the current environment, find what Shell is being used with the following command.....
- Code: Select all
env | grep SHELL=
To get a list of available shells on your system, look in the /etc/shells file. This will list the available shells with their complete
path names. You can see the list of available shells by running:
- Code: Select all
cat /etc/shells
Additional shells may be available in your distribution's software repositories. Performing a search for the term "shell" in your
package manager should provide you with a list of alternative command line shells.
If you want to experiment with a shell, just for now, you can launch a shell from within the existing shell. For example, if you
ant to run the tcsh shell, you can run:
- Code: Select all
tcsh
When you are finished exploring tcsh you can type exit to return to the default shell. Once you have found a shell you want to continue using
you can switch to the default shell by running the chsh command. For example, if you want to switch to using the tcsh shell, you can run
- Code: Select all
chsh -s /usr/bin/tcsh
Please note that you must provided the full directory path to the new shell.
2. locate .*rc -- Find the current logged in user's home shell Configuration file (*rc)... use:
- Code: Select all
locate .*rc
REF:
http://en.wikipedia.org/wiki/Unix_shell
Bourne shell (sh)
Almquist shell (ash)
Bourne-Again shell (bash)
Debian Almquist shell (dash)
Korn shell (ksh)
Z shell (zsh)
C shell (csh)
TENEX C shell (tcsh)
other shells..............
There may be a .bash_profile file in /home/loginuser along with .bashrc file. You can put configurations in either file,
and you can create either if it doesn’t exist. But, why two different files? What is the difference?
According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.
If .bash_profile exists in /home/user with the following information already inserted:
- Code: Select all
PATH=$PATH:$HOME/bin
export PATH
just append your path modifications here instead of the .bashrc file. (ie. CentOS 6)
You need to list the *rc file to verify the contents and set the PATHS. I'm ASSUMING a Bash shell......Your may be different!
3. cat .bashrc -- List the configuration file, then append the proper search paths for the users shell with edit.
- Code: Select all
export LD_LIBRARY_PATH=????????????????????????????????
export LIBRARY_PATH=???????????????????????????????????
export C_INCLUDE_PATH=?????????????????????????????????
export CPATH=??????????????????????????????????????????
Mine happens to now be:
- Code: Select all
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
export LIBRARY_PATH=/usr/lib:/usr/local/lib
export C_INCLUDE_PATH=.:/usr/include:/usr/local/include
export CPATH=.:/usr/include:/usr/local/include
But, your's may vary accordingly. You won't be able to cut & paste mine, unless your system is built exactly like mine. It's up to you to locate
exactly where all the libs and includes are located. That is what all the previous commands should have helped you do. Just because you have
/usr/lib & /usr/local/lib included....doesn't mean your needed lib is in that path.
That is where your detective work comes to play. SEARCH and use grep to locate the libs.
Once you have the env set either reboot or reset the env. Once again, your system command for this can/may be different.
4. source .bashrc -- Reset the environment to what we need for Compiles, assuming the SHELL is bash. This may not be available on your system.....
REF:
http://linux.about.com/library/cmd/blcmdl1_ulimit.htm
source filename [arguments]
Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename.v If filename does not contain a slash, file names in PATH are used to find the directory containing filename. vThe file searched for in PATH need not be executable. vWhen bash is not in posix mode, the current directory is searched if no file is found in PATH. vIf the sourcepath option to the shopt builtin command is turned off, the PATH is not searched. vIf any arguments are supplied, they become the positional parameters when filename is executed. vOtherwise the positional parameters are unchanged. vThe return status is the status of the last command exited within the script (0 if no commands are executed), and false if filename is not found or cannot be read.
VERIFY the env is correct:
5. env -- Display the new environment to verify the paths.............PARTIAL DISPLAY of SPECIFIC's I NEEDED...
- Code: Select all
LIBRARY_PATH=/usr/lib:/usr/local/lib
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
CPATH=.:/usr/include:/usr/local/include
C_INCLUDE_PATH=.:/usr/include:/usr/local/include
Append the new CP/M Floppy Disk Definitions for cpmtools to the /usr/local/share/diskdefs file.
Append these sample diskdefs to /usr/local/share/diskdefs & /etc/cpmtools/diskdefs
Additional Definitions for diskdefs:
- Code: Select all
diskdef amp1
seclen 512 #= Sectors xx,512
tracks 40 #= (Cylinders * Sides) = 40*1 = 40
sectrk 10 #= Sectors 10,xxx
blocksize 2048 #= (128*(BLM+1)) = 2048
maxdir 64 #= (DRM+1) = 64
skew 0 #= SKEW 0
boottrk 2 #= OFS = 2
os 2.2
end
# setfdprm /dev/fd0 DS DD ssize=512 cyl=40 sect=10 head=2
diskdef amp2
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skew 0
boottrk 2
os 2.2
end
# setfdprm /dev/fd0 zerobased SS DD ssize=512 cyl=40 sect=10 head=1
# Kaypro II
diskdef kpii
seclen 512
tracks 40
sectrk 10
blocksize 1024
maxdir 64
skew 0
boottrk 1
os 2.2
end
# setfdprm /dev/fd0 zerobased DS DD ssize=512 cyl=40 sect=10 head=2
# Kayro IV
diskdef kpiv
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 64
skew 0
boottrk 1
os 2.2
end
diskdef zor1
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 64
skew 0
boottrk 2
os 2.2
end
diskdef zor2
seclen 512
tracks 160
sectrk 10
blocksize 4096
maxdir 128
skew 0
boottrk 2
os 2.2
end
UPDATE: 08/13/2014 cpmtools Version 2.19 has been released with additional disk definitions
I've attached my definition file because I've added (and tested) several additional definitions.
CORRECTED SKEW=2 in Radio Shack Model 4 CP/M Definitions.
Copy these sample libdskrc definitions to an External file at /home/user/.libdskrc
.libdskrc contains:
- Code: Select all
[amp1]
description = Ampro - SSDD 48 tpi 5.25"
cylinders = 40
heads = 1
sectors = 10
secbase = 1
secsize = 512
datarate = DD
rwgap = 12
fmtgap = 23
fm = N
multitrack = N
skipdeleted = Y
[amp2]
description = Ampro - DSDD 48 tpi 5.25"
sides=alt
cylinders = 40
heads = 2
sectors = 10
secbase = 17
secsize = 512
datarate = DD
rwgap = 12
fmtgap = 23
fm = N
multitrack = N
skipdeleted = Y
[kpii]
description = Kaypro II/2 - SSDD 48 tpi 5.25"
cylinders = 40
heads = 1
sectors = 10
secbase = 0
secsize = 512
datarate = DD
rwgap = 12
fmtgap = 23
fm = N
multitrack = N
skipdeleted = Y
[kpiv]
description = Kaypro 2X/4/10 - DSDD 48 tpi 5.25"
cylinders = 80
heads = 2
sectors = 10
secbase = 0
secsize = 512
datarate = DD
rwgap = 12
fmtgap = 23
fm = N
multitrack = N
skipdeleted = Y
[zor1]
description = Zorba - DSDD 48 tpi 5.25"
sides=alt
cylinders = 80
heads = 2
sectors = 10
secbase = 1
secsize = 512
datarate = DD
rwgap = 12
fmtgap = 23
fm = N
multitrack = N
skipdeleted = Y
[zor2]
description = Zorba - DSDD 48 tpi 5.25"
sides=alt
cylinders = 160
heads = 2
sectors = 10
secbase = 1
secsize = 512
datarate = DD
rwgap = 12
fmtgap = 23
fm = N
multitrack = N
skipdeleted = Y
- Code: Select all
sudo cp diskdefs /usr/local/share/diskdefs
sudo cp diskdefs /etc/cpmtools/diskdefs
cp .libdskrc /home/user/.libdskrc
TYPICAL COMPILE STEPS: (from within your source directory)
- Code: Select all
./configure
make clean
make
sudo make install
"make clean" won't remove anything on the first compile, but will clean up on a successive compile.
Build libdsk:
- Code: Select all
cd ~/Downloads/cpmtools
cd libdsk-1.3.5
./configure
make
sudo make install
sudo make install-man
Build cpmtools:
- Code: Select all
cd ..
cd cpmtools-2.18
./configure --with-libdsk=/usr/local
make
sudo make install
VERIFY cpmls executes properly:
- Code: Select all
cd ..
cpmls
If you don't get the following cli usage message:
Usage: cpmls [-f format] [-T libdsk-type] [-d|-D|-F|-A|[-l][-c][-i]] image [file ...]
try this command:
- Code: Select all
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/usr/local/lib"
Then do:
- Code: Select all
cpmls
Open a Teledisk *.TD0 file containing compressed CP/M Files, and view the CP/M Directory with the following commands:
- Code: Select all
man cpmls
cpmls -f kpii -T tele,kpii -d kii-b282.td0
cpmls -f kpiv -T tele,kpiv -l KAY2SYS.td0
cpmls -f amp1 -T tele,amp1 -i ampro.td0
cpmls -f zor1 -T tele,zor1 -l compat32.td0
cpmls -f zor1 -T tele,zor1 -d compat32.td0
man cpmcp
cpmcp -f a1 bb2mon.img 0:*.mac /home/larry/Downloads/cpmtools/xfer1
larry@debian:~/Downloads/cpmtools$ cpmls -f zor1 -T tele,zor1 -l compat32.td0
0:
-rwxrwxrwx 19072 Dec 31 1969 compat.com
-rwxrwxrwx 22784 Dec 31 1969 format.com
-rwxrwxrwx 4352 Dec 31 1969 install.com
-rwxrwxrwx 11008 Dec 31 1969 ms.com
-rwxrwxrwx 9472 Dec 31 1969 mycopy.com
-rw-rw-rw- 1408 Dec 31 1969 z2000q.hex
-rw-rw-rw- 4480 Dec 31 1969 z2000q.prl
-rw-rw-rw- 1280 Dec 31 1969 zorbad.hex
-rw-rw-rw- 4224 Dec 31 1969 zorbad.prl
-rw-rw-rw- 1280 Dec 31 1969 zorbaq.hex
-rw-rw-rw- 4352 Dec 31 1969 zorbaq.prl
larry@debian:~/Downloads/cpmtools$
larry@debian:~/Downloads/cpmtools$ cpmls -f zor1 -T tele,zor1 -d compat32.td0
COMPAT COM : FORMAT COM : MS COM : INSTALL COM
MYCOPY COM : ZORBAD PRL : ZORBAD HEX : ZORBAQ PRL
ZORBAQ HEX : Z2000Q PRL : Z2000Q HEX
larry@debian:~/Downloads/cpmtools$
THANKS to John Elliott (libdsk) & Michael Haardt (cpmtools) for developing each software package.
PM me with a valid email address if you would like a CP/M *.TD0 file to test.
Larry