Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[HOWTO] - Preservation of CP/M Floppy's using Fluxengine

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
lkraemer
Posts: 209
Joined: 2011-02-09 05:02
Been thanked: 4 times

[HOWTO] - Preservation of CP/M Floppy's using Fluxengine

#1 Post by lkraemer »

[HOWTO] - Preservation of CP/M Floppy's using Fluxengine

Postby lkraemer » 2021-06-16 13:30

This HOWTO: explains how to Install the Fluxengine software version 06/04/2021, along with the required dependencies for
Debian 9.x - 64 Bit.

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 (Ver 9.x) Packages needed for Software Compile:
1. Build-Essential
2. Linux Debian 4.9.0-15-amd64 Headers (or the Headers for your Version)

Code: Select all

    uname -r
tells you the kernel you are currently running.

Code: Select all

    sudo apt-get install build-essential linux-headers-$(uname -r)
installs the software needed to successfully compile your source code.

Install the Additional Required Software to build fluxengine:

Code: Select all

    sudo apt-get install libncurses5-dev, zlib, sqlite3, libusb-1.0, protobuf, libprotobuf-dev, libprotoc-dev, protobuf-compiler, cscope


DOWNLOAD THE SOURCE:
Download the source package from: https://github.com/davidgiven/fluxengine/
Extract the source to your /home/user/Downloads/fluxengine-master

CHECK WHICH SHELL & ENV
The next step you need to do is to find the "SHELL" and "env" you are using, along with 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
want 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.....


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

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 fluxengine:

Code: Select all

    cd ~/Downloads/fluxengine-master/
    make
Fluxengine should build with no errors. If there are errors make sure to do a "make clean".

Code: Select all

make clean

VERIFY fluxengine executes properly:

Code: Select all

    ./fluxengine --help

Code: Select all

$ ./fluxengine --help
fluxengine: syntax: fluxengine <command> [<flags>...]
Try one of these commands:
  inspect: Low-level analysis and inspection of a disk.
  analyse: Disk and drive analysis tools.
  read: Reads a disk, producing a sector image.
  write: Writes a sector image to a disk.
  rawread: Reads raw flux from a disk. Warning: you can't use this to copy disks.
  rawwrite: Writes a flux file to a disk. Warning: you can't use this to copy disks.
  rpm: Measures the disk rotational speed.
  seek: Moves the disk head.
  test: Various testing commands.
  upgradefluxfile: Upgrades a flux file from a previous version of this software.
Fluxengine uses <profiles> for the floppy images it reads/writes. It isn't required to use one of these subsets of IBM. You can basically
roll your own profile by changing the Cylinders (start,end), Head Sides (0,1), Sector Base x, and Filename.

These are the current profiles:
IBM PC compatible
Acorn ADFS
Acorn DFS
Ampro Little Board
Apple II DOS 3.3
Amiga
Commodore 64 1541
Brother 120kB
Brother 240kB
Brother FB-100
Macintosh 800kB
TRS-80

When I tried to read a real floppy I kept getting a permissions error. I got around that for a short time by using the sudo command.

Here is a fix for that problem.

Code: Select all

larry@debian:~/Downloads/fluxengine/fluxengine-master$ ls -alt 49-fluxengine.rules
-rw-r--r-- 1 larry larry 615 Jun 23 16:53 49-fluxengine.rules
larry@debian:~/Downloads/fluxengine/fluxengine-master$
49-fluxengine.rules:

Code: Select all

# UDEV Rules for Fluxengine
#
# To install, type this command in a terminal:
#   sudo cp 49-fluxengine.rules /etc/udev/rules.d/.
#
# After this file is installed, physically unplug and reconnect the Fluxengine.
#
ATTRS{manufacturer}=="Cowlark Technologies", ATTRS{product}=="FluxEngine", \
    SUBSYSTEMS=="usb", MODE:="0666"
#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.

Code: Select all

$ cp 49-fluxengine.rules to /etc/udev/rules.d/.

Code: Select all

$ cd /etc/udev/rules.d
$ ls -alt 49-fluxengine.rules
-rw-r--r-- 1 root root  615 Jun 23 16:55 49-fluxengine.rules
larry@debian:/etc/udev/rules.d$ 
Test to see if ./fluxengine works without using sudo command

Code: Select all

$ ./fluxengine test bandwidth
Transferred 1048576 bytes from FluxEngine -> PC in 1096 ms (933 kB/s)
Transferred 1048576 bytes from PC -> FluxEngine in 1795 ms (570 kB/s)
larry@debian:~/Downloads/fluxengine/fluxengine-master$
fluxengine now works fine without the sudo command.


If I wanted to read an Ampro Floppy to an IMG file, I could use:

Code: Select all

./fluxengine read ampro -o amprorig.img
The Ampro profile has the following parameters:

Code: Select all

comment: 'Ampro 400kB/800kB 5.25" 40/80 track double sided'

input {
	flux {
		drive {}
	}
}

output {
	image {
		filename: "ampro.img"
		img {}
	}
}

decoder {
	ibm {
		sector_id_base: 17
	}
}

cylinders {
	start: 0
	end: 79
}

heads {
	start: 0
	end: 0
}
If I wanted to read an Ampro Floppy to a Flux File, I could use:

Code: Select all

./fluxengine read ampro --copy-flux-to amprorig.scp -o amprorig.img
For an existing .SCP file I can convert it to an img file, and send the output to a .log file

Code: Select all

./fluxengine read ampro -s amprorig_imd.scp -o amprorig_imd.img > amprorig_img.log
./fluxengine read ampro -c 0-39 -h 0 -s amprorig_imd.scp -o amprorig_imd.img > amprorig_imd.log

For other .SCP images I can also convert them as follows. Convert the SD Boot track, then the remaining tracks.

Code: Select all

./fluxengine read ibm --heads.step=2 -c 0 -h 0 -s dav1_imd.scp -o dav1_imd_boot.img > dav1_img_boot.log
./fluxengine read ibm --heads.step=2 -c 1-39 -h 0 -s dav1_imd.scp -o dav1_imd.img > dav1_img.log
Which will give the following information:
SCP tracks 0-39, heads 0-0
SCP sample resolution: 25 ns
0.0: 588.518 ms in 180093 bytes
108 records, 54 sectors; 3.27us clock (306kHz);
logical track 0.0; 2304 bytes decoded.
1.0: 591.537 ms in 156065 bytes
30 records, 15 sectors; 1.65us clock (605kHz);
logical track 2.0; 5120 bytes decoded.
2.0: 591.143 ms in 157736 bytes
30 records, 15 sectors; 1.65us clock (605kHz);
logical track 4.0; 5120 bytes decoded.
....
....
39.0: 594.313 ms in 146798 bytes
30 records, 15 sectors; 1.65us clock (605kHz);
logical track 78.0; 5120 bytes decoded.
Tracks -> 1 2 3 4 5 6 7 8
H.SS 012345678901234567890123456789012345678901234567890123456789012345678901234567890123
0. 0 .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
0. 1 .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
0. 2 .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
0. 3 .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
0. 4 .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
0. 5 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXX
Good sectors: 213/1422 (14%)
Missing sectors: 1209/1422 (85%)
Bad sectors: 0/1422 (0%)
wrote 79 tracks, 1 sides, 1422 kB total
For CP/M Definitions that have a Sector Base starting at zero, use this command line switch:

Code: Select all

./fluxengine read ibm --heads.step2 --decoder.ibm.sector_id_base=0 -c 0-39 -h 0-1 -s trsdiag2_imd.scp -o trsdiag-2_imd.img > trsdiag2_imd.log

There are only 47 CP/M Floppy Definitions that use a Sector Base starting at zero, but some start at a number greater than 1, such as 17.
The possible Sector Base values are {0, 1, 2, 11, 15, 17, 22, 27, 65, 128, 129, 193}.

Code: Select all

ACN1  Acorn CP/M on Acorn Z80 second processor. - 256 x 10
ACN2  Acorn CP/M on Acorn Z80 second processor (Alternate). - 256 x 10
ACN3  Sloger DDCPM on Acorn Z80 second processor. - 512 x 10
ACN4  Sloger DDCPM on Acorn Z80 second processor (alternate). - 512 x 10
AST1  Aster CT-80 - DSDD 96 tpi 5.25" - 1024 x 5
BON1  Bondwell 12 - SSDD 48 tpi 5.25" - 256 x 18
BON2  Bondwell 14 - DSDD 48 tpi 5.25" - 256 x 18
BON3  Bondwell 2 - SSDD 3.5" - 256 x 18
BTI1  BTI Systems - DSDD 48 tpi 5.25" - 512 x 9
CDC1  CDC-110 Viking - DSDD 8" - 512 x 16
DIG3  Digitech 500 series - SSDD 3.5" - 512 x 10
DIG4  Digitech 500 series - DSDD 3.5" - 512 x 10
DIM1  Dimension 68000 - DSDD 48 tpi 5.25" - 512 x 10
GEM1  Gemini Galaxy - DSDD 96 tpi 5.25" - 512 x 10
HEA4  Heath H89, Magnolia CP/M SSSD 48 tpi 5.25" - 256 x 10
HEW1  Hewlett-Packard HP86/87/120/125 - DSDD 48 tpi 5.25" - 256 x 16
HEW2  Hewlett Packard HP 125 - SSSD 8" - 256 x 16
HEW3  Hewlett Packard HP 125 - SSDD 3.5" - 256 x 16
HUB1  Hubotics/Micromation Hubot - DSDD 48 tpi 5.25" - 512 x 10
KAY1  Kaypro II/2 - SSDD 48 tpi 5.25" - 512 x 10
KAY2  Kaypro 2X/4/10 - DSDD 48 tpi 5.25" - 512 x 10
KAY3  Kaypro 2X/4/10 (Alternate) - DSDD 48 tpi 5.25" - 512 x 10
KAY4  Kaypro, Pro-8 ROM - DSDD 96 tpi 5.25" - 512 x 10
LOB1  Lobo Max-80 - SSDD 48 tpi 5.25" - 256 x 18
LOB2  Lobo Max-80 (256) - DSDD 48 tpi 5.25" - 256 x 18
LOB3  Lobo Max-80 - DSDD 48 tpi 5.25" - 512 x 10
LOB4  Lobo Max-80 - DSDD 96 tpi 5.25" - 512 x 10
LOB5  Lobo CP/M 2.2 - SSHD 8" - 256 x 30
MAR1  Marconi Midata 510 - DSDD 3.5" - 512 x 10
MUP1  MUPD/MDISK, Side I - SSSD 96 tpi 5.25" - 256 x 10
MUP2  MUPD/MDISK, Side II - SSSD 96 tpi 5.25" - 256 x 10
OCT1  Octagon 8/16 - SSDD 8" - 1024 x 9
OEM1  OEM Screen Typist - SSDD 3.5" - 512 x 10
OLI5  Olivetti ETV 1010, CP/M 86 - DSDD 48 tpi 5.25" - 512 x 10
PHY1  Physical Acoustics - DSDD 48 tpi 5.25" - 256 x 18
RC71  PICCOLO RC702 - DSDD 48 TPI 5.25"  - 512 x 9
SPE6  Spectravideo - DSDD 48 tpi 5.25" - 512 x 10
TAT1  Tatung TPC2000 - DSDD 96 tpi 5.25" - 512 x 9
TRS7  TRS-80, Holmes CP/M - DSDD 48 tpi 5.25" - 512 x 10
VID1  Videcom Apollo II - DSDD 96 tpi 5.25" - 512 x 10
I did a test read of a TRS-80 Model 4's TRSDOS ver 6.2 - 3.5" DS/DD Floppy, and logged the output.

Code: Select all

$ ./fluxengine read ibm --decoder.ibm.sector_id_base=0 -c 0-79 -h 0-1 -s ub4-80_dsk.scp -o ub4-80_dsk.img > ub4-80_dsk.log
TRSDOS6.2 Floppy Image is DS/DD 2 Sides 80 Tracks = 18 sectors of 256 bytes * 2 Sides * 80 Tracks = (((18 * 256) * 2) *80) = 737280 Bytes.

SCP tracks 0-79, heads 0-1
SCP sample resolution: 25 ns
0.0: 602.106 ms in 162955 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 0.0; 4608 bytes decoded.
0.1: 602.106 ms in 163579 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 0.1; 4608 bytes decoded.
1.0: 602.106 ms in 169672 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 1.0; 4608 bytes decoded.
1.1: 602.106 ms in 174547 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 1.1; 4608 bytes decoded.
2.0: 602.106 ms in 174187 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 2.0; 4608 bytes decoded.
2.1: 602.106 ms in 174388 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 2.1; 4608 bytes decoded.
3.0: 602.106 ms in 173986 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 3.0; 4608 bytes decoded.
3.1: 602.106 ms in 170896 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 3.1; 4608 bytes decoded.
4.0: 602.106 ms in 169942 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 4.0; 4608 bytes decoded.
4.1: 602.106 ms in 168919 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 4.1; 4608 bytes decoded.
....
....
....
75.1: 602.106 ms in 163684 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 75.1; 4608 bytes decoded.
76.0: 602.106 ms in 163630 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 76.0; 4608 bytes decoded.
76.1: 602.106 ms in 163684 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 76.1; 4608 bytes decoded.
77.0: 602.106 ms in 163633 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 77.0; 4608 bytes decoded.
77.1: 602.106 ms in 163690 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 77.1; 4608 bytes decoded.
78.0: 602.106 ms in 163636 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 78.0; 4608 bytes decoded.
78.1: 602.106 ms in 163693 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 78.1; 4608 bytes decoded.
79.0: 602.106 ms in 163633 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 79.0; 4608 bytes decoded.
79.1: 602.106 ms in 163687 bytes
108 records, 54 sectors; 2.00us clock (500kHz);
logical track 79.1; 4608 bytes decoded.
Tracks -> 1 2 3 4 5 6 7 8
H.SS 012345678901234567890123456789012345678901234567890123456789012345678901234567890123
0. 0 ................................................................................
0. 1 ................................................................................
0. 2 ................................................................................
0. 3 ................................................................................
0. 4 ................................................................................
0. 5 ................................................................................
0. 6 ................................................................................
0. 7 ................................................................................
0. 8 ................................................................................
0. 9 ................................................................................
0.10 ................................................................................
0.11 ................................................................................
0.12 ................................................................................
0.13 ................................................................................
0.14 ................................................................................
0.15 ................................................................................
0.16 ................................................................................
0.17 ................................................................................
1. 0 ................................................................................
1. 1 ................................................................................
1. 2 ................................................................................
1. 3 ................................................................................
1. 4 ................................................................................
1. 5 ................................................................................
1. 6 ................................................................................
1. 7 ................................................................................
1. 8 ................................................................................
1. 9 ................................................................................
1.10 ................................................................................
1.11 ................................................................................
1.12 ................................................................................
1.13 ................................................................................
1.14 ................................................................................
1.15 ................................................................................
1.16 ................................................................................
1.17 ................................................................................
Good sectors: 2880/2880 (100%)
Missing sectors: 0/2880 (0%)
Bad sectors: 0/2880 (0%)
wrote 80 tracks, 2 sides, 720 kB total


Larry

Post Reply