home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 17
/
amigaformatcd17.iso
/
-in_the_mag-
/
emulation
/
flex
/
readme
< prev
next >
Wrap
Text File
|
1997-07-01
|
26KB
|
601 lines
ReadMe for the Amiga FLEX Emulation System
---------------------------------------------------------------------
Revision: 1.0 - March 25th, 1994
Revision: 1.1 - March 26th, 1994
Author: Ben Williams
---------------------------------------------------------------------
Many Thanks To: Pete Gerardi - KE4TP
Tim Heffield - N4IFP
Bob Phillips @ GIMIX Corporation, Chicago
Frank Hogg @ Frank Hogg Laboratories
---------------------------------------------------------------------
Overview
============
What is it?
-----------
This is a complete emulation of a 6809 processor based FLEX system.
Flex is a disk operating system (DOS) which, along with CP/M and a few
others, truly pioneered small "personal" computers.
Feature List
------------
+ Extremely stable - no known problems or bugs whatsoever
+ Supports up to four virtual disks, fully cached
+ Virtual disks from 85k to 16 megabytes
+ Amiga-based disk maintainance utilities
+ Printer support via Flex "P" command via Amiga prefs printer
+ Flex system time, date set from Amiga clock on startup
+ 2 editors, BASIC, assembler, disassembler, utiltiies, much more
+ Amiga-based startup script automates logging virtual disks on
+ Amiga environment is custom screen - terminal look-alike - deja vu!
+ Abortable so system problems cannot harm virtual disks
+ Well documented (assuming you know how to use flex, that is)
+ Memory efficient operation (but watch those disk sizes!)
+ Full-boat 63k RAM 6809 virtual machine, plus 2k virtual ROM
+ ACIA Serial port emulation @ $E004/$E005 & $E002/$E003
+ Complete 6809 instruction set emulation (except "HALT")
+ Emulates SOROC IQ-120 terminal (so screen editor can work)
+ Runs at about 1 mhz 6809 equivalent on 25 mhz 68040 Amiga a4000
+ PSYMON machine code monitor runs on "Mon" command
+ PSYMON source code included on virtual disk
+ Completely isolated from Amiga, totally safe for experimenting
Distribution
------------
You'll find these files in the emulator archive:
flex - The emulator itself
flex.bin - 6809 Flex DOS, PSYMON low level machine code monitor
mad - "Make A Disk" virtual disk creator & formatter
fdir - Displays directories of Flex virtual disks from AmigaDOS
inject - Transfers files AmigaDOS->Flex, under AmigaDOS
distill - Transfers files Flex->AmigaDOS, under AmigaDOS
unpush.rexx - Utility for transferring files from "real" flex systems
drive0 - Virtual system disk for Flex
drive1 - Virtual work disk for Flex
startup.txt - Flex startup commands (NOTE: resides under AmigaDOS!)
readme - This file
This software provides emulation of all instructions with the
exception of "HALT". The virtual computer which the emulator creates
has 64k of memory, 2k of which is "ROM", or read-only. There is also
a low-level "monitor"; this is called "PSYMON". It originally came
from Percom corporation.
The software provides character I/O via emulation of a Motorola 6850
ACIA chip located at addresses $E008 and $E009, and aliased at $E004 &
$E005. It provides Disk I/O via emulation of a powerful DMA disk
controller that lets the Amiga do 99% of the work using the 68xxx
processor directly, which means that disk I/O is considerably faster
under the emulation than it was for any concievable 6809 system.
Unfortunately, this is pretty well hidden by the enormous amount of
work that the emulation itself must do unless you have a very fast
processor such as a 68040. Printer support is likewise handled by the
Amiga's processor directly as a DMA operation. Under Flex, you just
use the "P" command as you usually would.
Where are they now?
-------------------
TSC is out of business, its principals scattered, and the source code
for the operating system lost. I was also unable to locate Percom;
perhaps they too have gone out of business - but I've not been able to
confirm this. The number of Flex systems in use today is probably
none, or certainly a very small number. Other companies that were
involved in Flex-based computers are still around (such as GIMIX &
Frank Hogg Laboratories) but they understandably have moved on to
other projects. I contacted both companies I just mentioned, and
while the principals were very helpful, no commercial activity takes
place with regard to Flex any longer.
So why do this?
---------------
There are several reasons.
First, I personally have a great deal of interesting 6809 source code
around from the time of my life when I was designing 6809 based arcade
games, and I wanted to be able to experiment with that code.
Second, although I was able to get an SS-50 based machine up and
running Flex, I have a serious concern that if the hardware fails, I
might be unable to get it running again due to a lack of available
parts. The Amiga has a longer likely lifespan. I think. Somewhat.
My next task in this project is to port the whole thing to Windows,
but that's quite a ways out in the future at this point.
Third, the emulation itself makes available a very powerful "small"
computer system inside the Amiga which is actually a very nice, very
safe environment for playing around with assembly language
programming. You can't hurt the Amiga at all no matter how bad a
mistake you make within the emulation, and as a computer, the 6809
sports extremely powerful addressing modes, a decent register set, and
a solid instruction set which make experimenting with it very
enjoyable. Since the disks are cached in the Amiga's memory, even if
you foul up the disks, you can still abort the emulator and you're
100% safe.
Finally, it was a challenge to write the emulation and get it all
working, one which provided me with a great deal of personal
satisfaction.
The results - the complete emulation - appear to me to clearly have
absolutely no commercial value, and although all the companies that
produced the software which run within the emulation are long gone, I
am extremely uncomfortable with the idea of selling something that
contains, and depends upon, commercial work that they did long ago.
The alternative is to have Flex fade away into the past, forgotten,
which would be a damn shame - Flex was an important part of the
computer revolution! For these reasons the entire project is
freeware. I hope that this project will bring some enjoyment to
someone, somewhere. It certainly has done so for me!
Documentation for Flex DOS
--------------------------
Here are some very basic docs for the Flex commands:
<> = REQUIRED [] = OPTIONAL
H = HEXADECIMAL NUMBER DIGIT
D = DECIMAL NUMBER DIGIT
FILESPEC = [drivenumber]<filename>[extension]
examples: 0.COPY.CMD
COPY
COPY.CMD
0.COPY
DRIVESPEC = [DRIVENUMBER]
examples: 0
1
2
MATCHLIST = [PARTIAL FILENAME][EXTENSION]
examples: C
C.CMD
CO
CO.CMD
COPY.CMD
DRIVELIST = <DRIVENUMBER> [DRIVENUMBER] [DRIVENUMBER]...
examples: 0
0 2
0 1 3
0 1 2 3
Flex Command List
-----------------
APPEND <FILESPEC> <FILELIST> <FILESPEC>
ASMB <FILESPEC> [FILESPEC] (you need to know 6809 Assembly Language)
ASN [W=DRIVENUMBER] [S=DRIVENUMBER]
BASIC (complete extended basic interpreter, with online help via HELP)
BUILD <FILESPEC>
CAT <DRIVELIST> <MATCHLIST>
CHECK <DRIVE>
COPY <FILESPEC> <FILESPEC>
COPY <FILESPEC> <DRIVE>
COPY <DRIVE> <DRIVE> [MATCHLIST]
DASMB (help is available inside the dissasembler... press ?)
DATE [MM-DD-YY]
DEBUG (no help available... good luck - I have NO idea how this works!)
DELETE <FILESPEC> [FILELIST]
DIR [+P] [DRIVELIST] [MATCHLIST]
DISKEX (no parameters... commands are:
^ - Scroll forward through current sector
A - New track & sector to process
C [HH]- Change data in sector
D - New disk to process
F - Forward link to next sector (using link in sector)
N - Next Sector
P - Previous Sector
S - Scroll Value
W - Write sector back to disk (BE CAREFUL!!!!)
X - Exit to Flex)
DUMP <FILESPEC>
ECHO <TEXTSTRING>
EDIT [FILENAME] (fully WYSIWYG text editor... an amazing tool)
- Menu driven; press control-A for help in edit mode.
EX <FILESPEC>
EXTEND <DRIVESPEC> <SECTORS>
FILES <DRIVESPEC> [MATCHLIST]
FILESORT (file cataloging utility by Brian Bailey)
FREE <DRIVESPEC>
FREEMAP <DRIVESPEC>
HECHO <HH> [HH] [HH] [HH]...
HELP [COMMAND] (online help system uses .DIR files)
I <FILESPEC> <flex command...> (takes input from file, not console)
JUMP <HHHH>
LEDIT <FILESPEC> (line based text editor... basic commands include:
[dd] - New current line number
C"ORIGTEXT"NEWTEXT" - change text in line (any delimiter works)
P[DD] - Display from current line, DD lines
P! - Display from current line to end
[DD]P[dd] - Display from DD, dd lines
I[DD] - Insert at line DD (#<return> to exit insert mode)
REN - Renumber all lines
S - Save file and exit)
LIST <FILESPEC>
MAP <FILESPEC>
MEMEX (no parameters... commands are:
A <HHHH> - New address
C <HHHH> - Change data at address
S <HH> - Set new scroll value
X - Exit to Flex)
N <flex command> (answers all questions with N)
NAME <DISKNAME>
P <flex command> (directs output to AmigaDOS printer)
PCOPY <DRIVESPEC> <DRIVESPEC>
PDEL <DRIVESPEC>
PROTECT <FILESPEC> [D][W][C][X]
PUSH <FILESPEC>
RENAME <FILESPEC> <FILESPEC>
REORDER <DRIVESPEC>
RUN <FILESPEC>
SAVE <HHHH 0000-BFFF> <HHHH 0000-BFFF>
SAVE.LOW <HHHH C000-FFFF> <HHHH C000-FFFF>
SLEUTH (help is available inside the dissasembler... press ?)
SPLIT <FILESPEC>
TTYSET [BS=HH] [BE=HH] [DL=HH] [EL=HH] [DP=DD]
TTYSET [WD=DD] [NL=DD] [TB=HH] [EJ=DD] [PS=Y|N]
TTYSET [ES=HH]
UPDATE <FILESPEC>
VERIFY [ON] [OFF]
WIDECAT <DRIVESPEC>
XOUT <DRIVESPEC>
Y <flex command> (answers all questions with Y)
YEAR <YY>
STYHLP1 (help file for STYLUS/EDIT)
STYHLP2 (help file for STYLUS/EDIT)
STYHLP3 (help file for STYLUS/EDIT)
STYHLP4 (help file for STYLUS/EDIT)
STYHLP5 (help file for STYLUS/EDIT)
STYHLP6 (help file for STYLUS/EDIT)
PRINT.SYS (for printer driver)
HELPFILE.DIR (help for Flex commands, via HELP command)
BASIC.DIR (help for BASIC, via HELP command)
EXAMPLE.DIR (shows you how to write your own help databases)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
How it works
===================
Startup
-------
1 - After extraction, copy all files to a subdirectory, extract them
there in the first place. I suggest you make a directory for this
application... there are enough files in here that it's probably
best if you don't mix them up with other applications.
2 - Open a NEW shell (Really! Don't use your usual shell!)
3 - In that shell, CD to the location where the files now reside
4 - type: ChangeTaskPri -1<return>
5 - type: run flex<return>
When the emulation starts, PSYMON and Flex are loaded into emulator
memory and initialized. An external text startup file is used
(startup.txt, from the same directory as the emulator and its other
files) to supply an initial set of commands to Flex in order to get
things the rest of the way up and running. You'll see the following
when the emulator starts:
+++LOGIN DRIVE0 0
+++LOGIN DRIVE1 1
+++DATE
<current date is printed>
These commands come from the "startup.txt" file which is an AmigaDOS
file. Do not change this file until you completely understand what's
going on with the LOGIN commands. These are new to Flex! See the next
section for details.
Virtual Disks & Virtual Disk Drives
-----------------------------------
Because the emulation uses virtual disks (these are the "drive0" and
"drive1" files) you need a way inside Flex to "change" disks. There
are two new built in commands within this version of Flex to do this:
"login" and "logout". To put a disk in a virtual drive, you use
"login". To remove a disk from a drive you use logout. The syntax for
these commands is as follows:
login <AmigaDOSFileName> <FlexDriveNumber>
logout <FlexDriveNumber>
When logging in a new disk, any disk that was previously in that drive
is logged out automatically.
When you exit the emulator, all virtual disks are logged out
automatically.
Creating Virtual Disks
----------------------
You may notice that there is no "format" or "newdisk" command on the
Flex disks. This is because the disks are created outside of Flex,
under AmigaDOS. This is natural because AmigaDOS is the home of the
virtual disk files, not Flex. The Disk formatting utility command MAD
(Make A Disk) is provided and has the following parameters:
<required> [optional]
---------------------
MAD <AmigaFileName> <FlexDiskName> <FlexDiskNumber> <Tracks> <Sectors>
AmigaFileName is the name that will be given to the virtual disk under
AmigaDOS. FlexDiskName is the name that will be given to the virtual
disk under Flex. FlexDiskNumber is the volume number under Flex.
Tracks is the number of tracks that the disk will have; sectors is the
number of sectors per track the disk will have. These two parameters
together determine the size of the disk in the following manner:
(tracks - 1) X sectors X 252 = User Data Bytes On Disk
Standard disk sizes under Flex were 35, 40 or 80 tracks, with 10, 20
or 40 sectors per track. This table shows you how much room these
standard sizes provided:
Tracks Sectors Bytes Drive Type
----------------------------------------------------------
35 10 85,680 Single Sided, Single Density
35 20 171,360 Single Sided, Double Density
35 20 171,360 Double Sided, Single Density
35 40 342,720 Double Sided, Double Density
40 10 98,280 Single Sided, Single Density
40 20 196,560 Single Sided, Double Density
40 20 196,560 Double Sided, Single Density
40 40 393,120 Double Sided, Double Density
80 10 199,080 Single Sided, Single Density
80 20 398,160 Single Sided, Double Density
80 20 398,160 Double Sided, Single Density
80 40 796,320 Double Sided, Double Density
The track that is not counted in these calcuations is used in all
formats to hold the directory of files for the disk. In unusual cases,
there may be enough files on a disk to require more directory space
than the first reserved track; in that case, Flex will automatically
add sectors to the directory from the currently unused data sectors.
Alternatively, there is a utility provided called "extend" which will
reserve a block of sectors if you know ahead of time that you will be
placing an unusually large number of files on a disk. Extending a
directory this way makes the directory searches run faster on a floppy
system; within this emulated system, the file I/o is not noticably
affected by fragmentation.
"Normal" Disks
--------------
The MAD utility can create disks with any reasonable format; and the
emulator's disk drivers for Flex can read any disk MAD is willing to
create regardless of the format. For the reason that more simplistic
Flex utilities may expect certain sizes, unless you have a particular
need for an unusual size, we suggest that you stick with one of the
standard sizes from the table above.
Large Disks
-----------
Using the MAD utility, you can create disks with up to 255 tracks and
255 sectors. This is about 16 megabytes. Remember that the disk files
actually take up that much space - so don't do this just for fun. But
if you're doing something that needs lots of disk space, you can do it.
Multiple Virtual Disks
----------------------
Flex was pretty much designed for systems with a minimum of two floppy
drives. There are no well thought out facilities for copying files
using only one drive, for example. That's why the emulator is
configured to start with two drives. If you like, you can add up to
two more drives (drives 2 and 3) using the LOGIN command. Drive sizes
may be mixed and matched in any way, keeping in mind of course that
when you're copying from one disk to another, the target disk needs to
have enough room to hold everything you're copying... Also, each disk
that you log in takes up as much of your ram as it has bytes; so
unless you have scads of memory (hey, I do... doesn't everyone?)
you'll want to be thoughtful about how many disk you keep on line at
once.
Exiting the Emulator
--------------------
Using the right mouse button, menu options are available to either
abort, or to exit gracefully, which saves all changes made to the
disks. WARNING: If you abort, any changes made to the disks since
you started the emulator are LOST.
The Emulator Runs all the time
------------------------------
Because of the way that Flex was written, there is no effective way to
put the emulator to "sleep" while it is waiting for a character.
Several issues prevent this; for instance, Flex has print spooling,
and in order for that to work, the emulated CPU needs to run while
polling the ACIA so it can handle interrupts and so forth. This poses
a problem for Amiga users, in that the emulator task slows everything
else down quite a bit if it is run at normal Amiga priority (0).
To get around this, when starting the program open a new shell just
for the emulator, and type the following command into that new shell
before you run the emulator itself:
ChangeTaskPri -1
When you run the emulator after this command, it will stop processing
whenever any other program in the Amiga needs the Amiga's processor.
As long as no other program runs all the time, this will work very
well.
Printer Support
---------------
Flex supports printing via the "P" command prefix. For instance, if
you type:
LIST FILENAME
The file is listed to the monitor. If you type:
P LIST FILENAME
Then the file is sent to the printer. This version of Flex drives the
Amiga's printer (via PRT: and the emulation software) and so you can
make use of the Amiga printer control codes if you need to.
Obtaining Listings of Files inside Virtual Flex Disks
-----------------------------------------------------
When you are working under AmigaDOS, the command "fdir" will provide
you with a listing of the files contained in a virtual Flex disk.
Syntax is as follows:
<required> [optional]
---------------------
fdir <DiskName>
Copying files into Flex Virtual Disks from AmigaDOS
---------------------------------------------------
We have supplied the utility command "inject". Inject has the
following parameters:
<required> [optional]
---------------------
inject <SourceName> <DiskName> <DestName> [T]
SourceName is the filename of the file to be injected under AmigaDOS,
DiskName is the name of the Virtual Disk file under AmigaDOS, and
DestName is the filename of the file to be created in the virtual disk
under Flex. The optional T parameter deals with text translation,
discussed next.
Note that text files under Flex use the Carriage Return character as
an end of line marker, while text files under AmigaDOS use the Line
Feed as an end of line marker. If you supply the "T" parameter to the
inject command, Line Feeds are translated into Carriage Returns
automatically as the file is transferred to the virtual Flex disk.
Otherwise, you will have to change the characters yourself. If you're
transferring a binary file, you should never use the T parameter.
The inject command will not allow you to copy a file into a Flex
virtual disk if that filename already exists within the directory of
the virtual disk. You have two choices of remedy when this occurs: use
inject with a different target filename, or execute the emulator and
delete the previously existing file.
Obtaining files from a "real" Flex System
-----------------------------------------
This is difficult because it requires some kind of command over on the
Flex system itself. We provide an ARexx script called "UnPush.rexx"
which is designed to deal with the output of a Flex command called
"PUSH" (which you will find on the drive0 virtual disk as PUSH.CMD and
on the drive1 virtual disk as PUSH.TXT, which is the 6809 assembly
source code). PUSH takes any Flex file and send it to the console
terminal as a series of well formatted HEX numbers. The correct
procedure is to:
1 - Use the Amiga as a serial terminal on the Flex system;
2 - "Capture" the output of the PUSH command as it's filename;
3 - Edit the Capture file to remove any extraneous information
such as the +++ prompt, unrelated commands, blank lines, and so on;
4 - Use the UnPush script to turn the captured data back into binary as:
rx unpush filename drivename
* (note that unpush uses the inject utility we supply)
The problem here is that the PUSH.CMD file must exist over on the flex
system. So you will need to copy the PUSH.TXT file into your Flex
machine and assemble it in order to transfer files. That's fairly easy
to do as long as you have a 6809 assembler over there... open an
editor and use a terminal program to send the text over.
Copying files from Flex Virtual Disks to AmigaDOS
-------------------------------------------------
We have supplied the utility command "distill". Distill has the
following parameters:
<required> [optional]
---------------------
distill <SourceName> <DiskName> <DestName> [T]
Where SourceName is the filename of the file to be distilled under
Flex, DiskName is the name of the Virtual Disk file under AmigaDOS,
and DestName is the filename of the file to be created in the Amiga
filesystem. The optional "T" parameter deals with text translation, as
described above for the inject command.
Note: Flex compresses text files in a special way; the TAB character
(0x09) is used as a signal that the next byte in the file is a
count of compressed spaces. So, 0x09,0x04 means four spaces -
not the ASCII sequence, "TAB", "EOT". Distill will automatically
decompress files with a .TXT extension. The only time this could
cause problems is if a binary file had a .TXT extension, which
you should of course avoid. This would also cause problems
within Flex. Text files also can contain NULL characters at the end;
the decompressor in distill will automatically remove these if you
use the T option. Otherwise, you have to deal with the space
compression and the final nulls.
Questions or Ideas?
-------------------
Please write to me at Black Belt Systems if you have something to
contribute to this project.
Bugs
----
Bugs? There are no bugs in this software, whatever can you be thinking?
Seriously, if you find anything (like an unusual 6809 instruction that
isn't emulated properly), let me know and I'll fix it ASAP. I have a
very strong interest in seeing the emulation run flawlessly.
Terminal I/O
------------
The serial terminal output emulation simply uses the Amiga ANSI
control codes, along with a minimal emulation of a SOROC IQ-140
terminal. If you start any console sequences with 0x9B, they'll work
fine; whereas the SOROC sequences all start with 0x1B. The SOROC
emulation is provided specifically so that the STYLUS editor will work.
Another change made to the emulator for STYLUS was the address
"mirroring" of the ACIA to address $E004 & $E005, since STYLUS hits
the ACIA directly in order to obtain max speed; although this is very
bad coding practice, it was more or less understandable in the
day this was written.
Here are the controls common to the SOROC and the Amiga Console:
$08 - Backspace
$0A - Line Feed
$0D - Carrriage Return
Here are the controls unique to the SOROC I've implemented:
$1E - Home Up
$1B,E - Insert Line
$1B,R - Delete Line
$1B,T - Erase EOL
$1B,t - Erase EOL
$1B,* - Home Up & Erase EOF
$1B,Y - Erase EOF
$1B,y - Erase EOF
$1B,( - Set Write BLUE
$1B,) - Set Write GREEN
$1B,=,yy,xx - Write Cursor Position ("xx" & "yy" are 0x20 + cursorvalue)
Changes from Version 1.0
------------------------
v1r1, March 26th, 1994
- Emulation runs about 2x as fast as v1r0
- Disks are now kept in memory, rewritten ONLY if you change them
- Critical (for Stylus) Soroc IQ140 terminal emulation operating
- Distribution includes Stylus ("EDIT") and help files
- Distribution includes RENAME command (left out by mistake in 1.0)
- Distribution includes Excellent "SLEUTH" dissasember
- Distribution includes HELP.CMD and helpfiles (.DIR files)
- Distribution includes FILESORT command by Brian Bailey
- Distribution includes PUSH command (left out by mistake in 1.0)
- Distribution includes UPDATE command
- Distribution includes BASIC command (helpfile, too!)
- Distribution includes FREEMAP command
- EDIT command (line editor) renamed to LEDIT
---------------------------- End of Document ---------------------