1
0
mirror of https://github.com/simh/simh.git synced 2026-02-14 11:55:51 +00:00

Notes For V2.10-0

WARNING: V2.10 has reorganized and renamed some of the definition
files for the PDP-10, PDP-11, and VAX.  Be sure to delete all
previous source files before you unpack the Zip archive, or
unpack it into a new directory structure.

WARNING: V2.10 has a new, more comprehensive save file format.
Restoring save files from previous releases will cause 'invalid
register' errors and loss of CPU option flags, device enable/
disable flags, unit online/offline flags, and unit writelock
flags.

WARNING: If you are using Visual Studio .NET through the IDE,
be sure to turn off the /Wp64 flag in the project settings, or
dozens of spurious errors will be generated.

WARNING: Compiling Ethernet support under Windows requires
extra steps; see the Ethernet readme file.  Ethernet support is
currently available only for Windows, Linux, NetBSD, and OpenBSD.

1. New Features

1.1 SCP and Libraries

- The VT emulation package has been replaced by the capability
  to remote the console to a Telnet session.  Telnet clients
  typically have more complete and robust VT100 emulation.
- Simulated devices may now have statically allocated buffers,
  in addition to dynamically allocated buffers or disk-based
  data stores.
- The DO command now takes substitutable arguments (max 9).
  In command files, %n represents substitutable argument n.
- The initial command line is now interpreted as the command
  name and substitutable arguments for a DO command.  This is
  backward compatible to prior versions.
- The initial command line parses switches.  -Q is interpreted
  as quiet mode; informational messages are suppressed.
- The HELP command now takes an optional argument.  HELP <cmd>
  types help on the specified command.
- Hooks have been added for implementing GUI-based consoles,
  as well as simulator-specific command extensions.  A few
  internal data structures and definitions have changed.
- Two new routines (tmxr_open_master, tmxr_close_master) have
  been added to sim_tmxr.c.  The calling sequence for
  sim_accept_conn has been changed in sim_sock.c.
- The calling sequence for the VM boot routine has been modified
  to add an additional parameter.
- SAVE now saves, and GET now restores, controller and unit flags.
- Library sim_ether.c has been added for Ethernet support.

1.2 VAX

- Non-volatile RAM (NVR) can behave either like a memory or like
  a disk-based peripheral.  If unattached, it behaves like memory
  and is saved and restored by SAVE and RESTORE, respectively.
  If attached, its contents are loaded from disk by ATTACH and
  written back to disk at DETACH and EXIT.
- SHOW <device> VECTOR displays the device's interrupt vector.
  A few devices allow the vector to be changed with SET
  <device> VECTOR=nnn.
- SHOW CPU IOSPACE displays the I/O space address map.
- The TK50 (TMSCP tape) has been added.
- The DEQNA/DELQA (Qbus Ethernet controllers) have been added.
- Autoconfiguration support has been added.
- The paper tape reader has been removed from vax_stddev.c and
  now references a common implementation file, dec_pt.h.
- Examine and deposit switches now work on all devices, not just
  the CPU.
- Device address conflicts are not detected until simulation starts.

1.3 PDP-11

- SHOW <device> VECTOR displays the device's interrupt vector.
  Most devices allow the vector to be changed with SET
  <device> VECTOR=nnn.
- SHOW CPU IOSPACE displays the I/O space address map.
- The TK50 (TMSCP tape), RK611/RK06/RK07 (cartridge disk),
  RX211 (double density floppy), and KW11P programmable clock
  have been added.
- The DEQNA/DELQA (Qbus Ethernet controllers) have been added.
- Autoconfiguration support has been added.
- The paper tape reader has been removed from pdp11_stddev.c and
  now references a common implementation file, dec_pt.h.
- Device bootstraps now use the actual CSR specified by the
  SET ADDRESS command, rather than just the default CSR.  Note
  that PDP-11 operating systems may NOT support booting with
  non-standard addresses.
- Specifying more than 256KB of memory, or changing the bus
  configuration, causes all peripherals that are not compatible
  with the current bus configuration to be disabled.
- Device address conflicts are not detected until simulation starts.

1.4 PDP-10

- SHOW <device> VECTOR displays the device's interrupt vector.
  A few devices allow the vector to be changed with SET
  <device> VECTOR=nnn.
- SHOW CPU IOSPACE displays the I/O space address map.
- The RX211 (double density floppy) has been added; it is off
  by default.
- The paper tape now references a common implementation file,
  dec_pt.h.
- Device address conflicts are not detected until simulation starts.

1.5 PDP-1

- DECtape (then known as MicroTape) support has been added.
- The line printer and DECtape can be disabled and enabled.

1.6 PDP-8

- The RX28 (double density floppy) has been added as an option to
  the existing RX8E controller.
- SHOW <device> DEVNO displays the device's device number.  Most
  devices allow the device number to be changed with SET <device>
  DEVNO=nnn.
- Device number conflicts are not detected until simulation starts.

1.7 IBM 1620

- The IBM 1620 simulator has been released.

1.8 AltairZ80

- A hard drive has been added for increased storage.
- Several bugs have been fixed.

1.9 HP 2100

- The 12845A has been added and made the default line printer (LPT).
  The 12653A has been renamed LPS and is off by default.  It also
  supports the diagnostic functions needed to run the DCPC and DMS
  diagnostics.
- The 12557A/13210A disk defaults to the 13210A (7900/7901).
- The 12559A magtape is off by default.
- New CPU options (EAU/NOEAU) enable/disable the extended arithmetic
  instructions for the 2116.  These instructions are standard on
  the 2100 and 21MX.
- New CPU options (MPR/NOMPR) enable/disable memory protect for the
  2100 and 21MX.
- New CPU options (DMS/NODMS) enable/disable the dynamic mapping
  instructions for the 21MX.
- The 12539 timebase generator autocalibrates.

1.10 Simulated Magtapes

- Simulated magtapes recognize end of file and the marker
  0xFFFFFFFF as end of medium.  Only the TMSCP tape simulator
  can generate an end of medium marker.
- The error handling in simulated magtapes was overhauled to be
  consistent through all simulators.

1.11 Simulated DECtapes

- Added support for RT11 image file format (256 x 16b) to DECtapes.

2. Release Notes

2.1 Bugs Fixed

- TS11/TSV05 was not simulating the XS0_MOT bit, causing failures
  under VMS.  In addition, two of the CTL options were coded
  interchanged.
- IBM 1401 tape was not setting a word mark under group mark for
  load mode reads.  This caused the diagnostics to crash.
- SCP bugs in ssh_break and set_logon were fixed (found by Dave
  Hittner).
- Numerous bugs in the HP 2100 extended arithmetic, floating point,
  21MX, DMS, and IOP instructions were fixed.  Bugs were also fixed
  in the memory protect and DMS functions.  The moving head disks
  (DP, DQ) were revised to simulate the hardware more accurately.
  Missing functions in DQ (address skip, read address) were added.

2.2 HP 2100 Debugging

- The HP 2100 CPU nows runs all of the CPU diagnostics.
- The peripherals run most of the peripheral diagnostics.  There
  is still a problem in overlapped seek operation on the disks.
  See the file hp2100_diag.txt for details.

3. In Progress

These simulators are not finished and are available in a separate
Zip archive distribution.

- Interdata 16b/32b: coded, partially tested.  See the file
  id_diag.txt for details.
- SDS 940: coded, partially tested.
This commit is contained in:
Bob Supnik
2002-11-17 15:54:00 -08:00
committed by Mark Pizzolato
parent df6475181c
commit 2c2dd5ea33
218 changed files with 44103 additions and 17112 deletions

View File

@@ -51,7 +51,7 @@ extern char ascii_to_bcd[128];
int32 s1sel, s2sel, s4sel, s8sel;
char rbuf[CBUFSIZE]; /* > CDR_WIDTH */
t_stat cdr_svc (UNIT *uptr);
t_stat cdr_boot (int32 unitno);
t_stat cdr_boot (int32 unitno, DEVICE *dptr);
t_stat cdr_attach (UNIT *uptr, char *cptr);
t_stat cd_reset (DEVICE *dptr);
@@ -158,7 +158,7 @@ if (ferror (cdr_unit.fileref)) { /* error? */
return SCPE_OK; }
cdr_unit.pos = ftell (cdr_unit.fileref); /* update position */
if (ssa) { /* if last cd on */
i = getc (cdr_unit.fileref); /* see if more */
getc (cdr_unit.fileref); /* see if more */
if (feof (cdr_unit.fileref)) ind[IN_LST] = 1; /* eof? set flag */
fseek (cdr_unit.fileref, cdr_unit.pos, SEEK_SET); }
for (i = 0; i < CDR_WIDTH; i++) { /* cvt to BCD */
@@ -181,17 +181,17 @@ int32 i;
if (s1sel) uptr = &stack_unit[1]; /* stacker 1? */
else if (s2sel) uptr = &stack_unit[2]; /* stacker 2? */
else uptr = &stack_unit[0]; /* then default */
if ((uptr -> flags & UNIT_ATT) == 0) return SCPE_OK; /* attached? */
if ((uptr->flags & UNIT_ATT) == 0) return SCPE_OK; /* attached? */
for (i = 0; i < CDR_WIDTH; i++) rbuf[i] = bcd_to_ascii[rbuf[i]];
for (i = CDR_WIDTH - 1; (i >= 0) && (rbuf[i] == ' '); i--) rbuf[i] = 0;
rbuf[CDR_WIDTH] = 0; /* null at end */
fputs (rbuf, uptr -> fileref); /* write card */
fputc ('\n', uptr -> fileref); /* plus new line */
if (ferror (uptr -> fileref)) { /* error? */
fputs (rbuf, uptr->fileref); /* write card */
fputc ('\n', uptr->fileref); /* plus new line */
if (ferror (uptr->fileref)) { /* error? */
perror ("Card stacker I/O error");
clearerr (uptr -> fileref);
clearerr (uptr->fileref);
if (iochk) return SCPE_IOERR; }
uptr -> pos = ftell (uptr -> fileref); /* update position */
uptr->pos = ftell (uptr->fileref); /* update position */
return SCPE_OK;
}
@@ -210,21 +210,21 @@ UNIT *uptr;
if (s8sel) uptr = &stack_unit[2]; /* stack 8? */
else if (s4sel) uptr = &stack_unit[4]; /* stack 4? */
else uptr = &cdp_unit; /* normal output */
if ((uptr -> flags & UNIT_ATT) == 0) return SCPE_UNATT; /* attached? */
if ((uptr->flags & UNIT_ATT) == 0) return SCPE_UNATT; /* attached? */
ind[IN_PNCH] = s4sel = s8sel = 0; /* clear flags */
M[CDP_BUF - 1] = 012; /* set prev loc */
for (i = 0; i < CDP_WIDTH; i++) pbuf[i] = bcd_to_ascii[M[CDP_BUF + i] & CHAR];
for (i = CDP_WIDTH - 1; (i >= 0) && (pbuf[i] == ' '); i--) pbuf[i] = 0;
pbuf[CDP_WIDTH] = 0; /* trailing null */
fputs (pbuf, uptr -> fileref); /* output card */
fputc ('\n', uptr -> fileref); /* plus new line */
if (ferror (uptr -> fileref)) { /* error? */
fputs (pbuf, uptr->fileref); /* output card */
fputc ('\n', uptr->fileref); /* plus new line */
if (ferror (uptr->fileref)) { /* error? */
perror ("Card punch I/O error");
clearerr (uptr -> fileref);
clearerr (uptr->fileref);
if (iochk) return SCPE_IOERR;
ind[IN_PNCH] = 1; }
uptr -> pos = ftell (uptr -> fileref); /* update position */
uptr->pos = ftell (uptr->fileref); /* update position */
return SCPE_OK;
}
@@ -269,7 +269,7 @@ return attach_unit (uptr, cptr);
static const unsigned char boot_rom[] = {
OP_R + WM, OP_NOP + WM }; /* R, NOP */
t_stat cdr_boot (int32 unitno)
t_stat cdr_boot (int32 unitno, DEVICE *dptr)
{
int32 i;
extern int32 saved_IS;

View File

@@ -103,8 +103,8 @@
4. Adding I/O devices. These modules must be modified:
i1401_cpu.c add IO dispatches to iodisp
i1401_sys.c add pointer to data structures to sim_devices
i1401_cpu.c add device dispatching code to iodisp
i1401_sys.c add sim_devices table entry
*/
#include "i1401_defs.h"
@@ -1178,7 +1178,7 @@ as_err = ADDR_ERR (AS); /* get addr err flags */
bs_err = ADDR_ERR (BS);
AS = AS & ADDRMASK; /* clean addresses */
BS = BS & ADDRMASK;
pcq_r -> qptr = pcq_p; /* update pc q ptr */
pcq_r->qptr = pcq_p; /* update pc q ptr */
return reason;
} /* end sim_instr */
@@ -1314,7 +1314,7 @@ ind[IN_UNC] = 1;
AS = 0; as_err = 1;
BS = 0; bs_err = 1;
pcq_r = find_reg ("ISQ", NULL, dptr);
if (pcq_r) pcq_r -> qptr = 0;
if (pcq_r) pcq_r->qptr = 0;
else return SCPE_IERR;
sim_brk_types = sim_brk_dflt = SWMASK ('E');
return SCPE_OK;

View File

@@ -273,4 +273,4 @@
#define IN_SSG 067 /* sense switch G */
#define IN_READ 072 /* reader error */
#define CRETIOE(f,c) return ((f)? (c): SCPE_OK)
#define CRETIOE(f,c) return ((f)? (c): SCPE_OK)

View File

@@ -1,7 +1,7 @@
To: Users
From: Bob Supnik
Subj: IBM 1401 Simulator Usage
Date: 15-Jun-2002
Date: 15-Nov-2002
COPYRIGHT NOTICE
@@ -37,9 +37,13 @@ This memorandum documents the IBM 1401 simulator.
1. Simulator Files
sim/ sim_defs.h
sim_rev.h
sim_sock.h
sim_tmxr.h
scp.c
scp_tty.c
sim_rev.c
sim_sock.c
sim_tmxr.c
sim/i1401/ i1401_defs.h
i1401_cpu.c
@@ -297,8 +301,7 @@ pack options include the ability to enable address writing (formatting).
SET DPn ADDROFF set unit n address enable off
SET DPn ADDRON set unit n address enable on
Units can also be set ONLINE or OFFLINE. Disk data is buffered in
memory; IO errors cannot occur.
Units can also be set ONLINE or OFFLINE.
Unlike most simulated disks, the 1311 includes explicit representation
for sector addresses. This is to support non-standard formats, such as
@@ -327,6 +330,11 @@ The disk pack controller implements these registers:
LASTF 3 most recent function
TIME 24 seek time
The 1311 has a primative overlapped seek capability. If TIME is set
non-zero, the 1311 will report itself busy for the specified amount
of time following a seek. This allows programs to utilize the seek
time for processing.
Error handling is as follows:
error processed as
@@ -334,10 +342,8 @@ Error handling is as follows:
not attached set DSK indicator
if IOCHK set, report error and stop
The 1311 has a primative overlapped seek capability. If TIME is set
non-zero, the 1311 will report itself busy for the specified amount
of time following a seek. This allows programs to utilize the seek
time for processing.
1311 data files are buffered in memory; therefore, end of file and OS
I/O errors cannot occur.
2.6 729 Magnetic Tape (MT)
@@ -367,12 +373,11 @@ Error handling is as follows:
not attached report error and stop
end of file (read or space) end of physical tape
(write) ignored
end of file set error indicator
OS I/O error print error message
set error indicator
if IOCHK set, report error and stop
otherwise, set ERR indicator
2.7 Symbolic Display and Input

View File

@@ -25,7 +25,9 @@
dp 1311 disk pack
15-Jun-02 Reworked address comparison logic
18-Oct-02 RMS Fixed bug in address comparison logic
19-Sep-02 RMS Minor edit for consistency with 1620
15-Jun-02 RMS Reworked address comparison logic
The 1311 disk pack has 100 cylinders, 10 tracks/cylinder, 20 sectors/track.
Each sector contains 106 characters of information:
@@ -49,7 +51,6 @@
#define DP_NUMDR 5 /* #drives */
#define UNIT_V_WAE (UNIT_V_UF + 0) /* write addr enab */
#define UNIT_WAE (1 << UNIT_V_WAE)
#define UNIT_W_UF 2 /* #save flags */
/* Disk format */
@@ -105,10 +106,10 @@ t_stat dp_rdadr (UNIT *uptr, int32 sec, int32 flg, int32 wchk);
t_stat dp_rdsec (UNIT *uptr, int32 sec, int32 flg, int32 wchk);
t_stat dp_wradr (UNIT *uptr, int32 sec, int32 flg);
t_stat dp_wrsec (UNIT *uptr, int32 sec, int32 flg);
int32 dp_fndsec (UNIT *uptr, int32 sec, int32 dcf, int32 flg);
t_stat dp_nexsec (UNIT *uptr, int32 psec, int32 dcf, int32 flg);
int32 dp_fndsec (UNIT *uptr, int32 sec, int32 dcf);
t_stat dp_nexsec (UNIT *uptr, int32 psec, int32 dcf);
t_bool dp_zeroad (uint8 *ap);
t_bool dp_cmp_ad (uint8 *ap, int32 dcf, int32 flg);
t_bool dp_cmp_ad (uint8 *ap, int32 dcf);
int32 dp_trkop (int32 drv, int32 sec);
int32 dp_cvt_bcd (int32 ad, int32 len);
void dp_cvt_bin (int32 ad, int32 len, int32 val, int32 flg);
@@ -146,8 +147,6 @@ REG dp_reg[] = {
{ DRDATA (TIME, dp_time, 24), PV_LEFT },
{ URDATA (CYL, dp_unit[0].CYL, 10, 8, 0,
DP_NUMDR, PV_LEFT + REG_RO) },
{ URDATA (FLG, dp_unit[0].flags, 8, UNIT_W_UF, UNIT_V_UF - 1,
DP_NUMDR, REG_HRO) },
{ NULL } };
MTAB dp_mod[] = {
@@ -175,7 +174,7 @@ t_stat dp_io (int32 fnc, int32 flg, int32 mod)
{
int32 dcf, drv, sec, psec, cnt, qwc, qzr, diff;
UNIT *uptr;
t_stat r = SCPE_OK;
t_stat r;
dcf = BS; /* save DCF addr */
qwc = 0; /* not wcheck */
@@ -194,7 +193,7 @@ if ((drv == 0) || (drv & 1) || (drv > BCD_ZERO)) /* bad drive #? */
return STOP_INVDSK;
drv = bcd_to_bin[drv] >> 1; /* convert */
uptr = dp_dev.units + drv; /* get unit ptr */
if ((uptr -> flags & UNIT_ATT) == 0) { /* attached? */
if ((uptr->flags & UNIT_ATT) == 0) { /* attached? */
ind[IN_DSK] = ind[IN_ACC] = 1; /* no, error */
CRETIOE (iochk, SCPE_UNATT); }
@@ -205,10 +204,10 @@ if ((fnc == FNC_SEEK) && /* seek and */
diff = diff >> 1; /* diff is *2 */
if ((M[dcf + DCF_DIR + DCF_DIR_LEN - 1] & ZONE) == BBIT)
diff = -diff; /* get sign */
uptr -> CYL = uptr -> CYL + diff; /* bound seek */
if (uptr -> CYL < 0) uptr -> CYL = 0;
else if (uptr -> CYL >= DP_NUMCY) { /* too big? */
uptr -> CYL = 0; /* system hangs */
uptr->CYL = uptr->CYL + diff; /* bound seek */
if (uptr->CYL < 0) uptr->CYL = 0;
else if (uptr->CYL >= DP_NUMCY) { /* too big? */
uptr->CYL = 0; /* system hangs */
return STOP_INVDCY; }
sim_activate (&dp_unit[0], dp_time); /* set ctlr busy */
return SCPE_OK; } /* done! */
@@ -217,7 +216,7 @@ sec = dp_cvt_bcd (dcf + DCF_SEC, DCF_SEC_LEN); /* cvt sector */
if ((sec < 0) || (sec >= (DP_NUMDR * DP_TOTSC))) /* bad sector? */
return STOP_INVDSC;
if (fnc == FNC_SEEK) { /* seek? */
uptr -> CYL = (sec / (DP_NUMSF * DP_NUMSC)) % /* set cyl # */
uptr->CYL = (sec / (DP_NUMSF * DP_NUMSC)) % /* set cyl # */
DP_NUMCY;
sim_activate (&dp_unit[0], dp_time); /* set ctlr busy */
return SCPE_OK; } /* done! */
@@ -236,13 +235,13 @@ if (mod == BCD_W) { /* write? */
fnc = fnc + FNC_WOFF; } } /* change to write */
else if (mod == BCD_R) dp_lastf = fnc; /* read? save func */
else return STOP_INVM; /* other? error */
psec = dp_fndsec (uptr, sec, dcf, flg); /* find sector */
switch (fnc) { /* case on function */
case FNC_RSCO: /* read sec cnt ov */
BS = dcf + DCF_CNT; /* set count back */
/* fall thru */
case FNC_READ: /* read */
psec = dp_fndsec (uptr, sec, dcf); /* find sector */
if (psec < 0) CRETIOE (iochk, STOP_INVDAD); /* addr cmp error? */
for (;;) { /* loop */
qzr = (--cnt == 0); /* set zero latch */
@@ -254,7 +253,7 @@ case FNC_READ: /* read */
if (qzr) break; /* zero latch? done */
sec++; psec++; /* next sector */
dp_cvt_bin (dcf + DCF_SEC, DCF_SEC_LEN, sec, flg); /* rewr sec */
if (r = dp_nexsec (uptr, psec, dcf, flg)) break; /* find next */
if (r = dp_nexsec (uptr, psec, dcf)) break; /* find next */
}
break; /* done, clean up */
@@ -278,6 +277,7 @@ case FNC_WRSCO: /* write sec cnt ov */
BS = dcf + DCF_CNT; /* set count back */
/* fall through */
case FNC_WRITE: /* read */
psec = dp_fndsec (uptr, sec, dcf); /* find sector */
if (psec < 0) CRETIOE (iochk, STOP_INVDAD); /* addr cmp error? */
for (;;) { /* loop */
qzr = (--cnt == 0); /* set zero latch */
@@ -286,12 +286,12 @@ case FNC_WRITE: /* read */
if (qzr) break; /* zero latch? done */
sec++; psec++; /* next sector */
dp_cvt_bin (dcf + DCF_SEC, DCF_SEC_LEN, sec, flg); /* rewr sec */
if (r = dp_nexsec (uptr, psec, dcf, flg)) break; /* find next */
if (r = dp_nexsec (uptr, psec, dcf)) break; /* find next */
}
break; /* done, clean up */
case FNC_WRTRK: /* write track */
if ((uptr -> flags & UNIT_WAE) == 0) /* enabled? */
if ((uptr->flags & UNIT_WAE) == 0) /* enabled? */
return STOP_WRADIS;
AS = dcf + 9; /* special AS */
psec = dp_trkop (drv, sec); /* start of track */
@@ -323,7 +323,7 @@ t_stat dp_rdadr (UNIT *uptr, int32 sec, int32 flg, int32 qwc)
int32 i;
uint8 ac;
int32 da = (sec % DP_TOTSC) * DP_NUMCH; /* char number */
uint8 *ap = ((uint8 *) uptr -> filebuf) + da; /* buf ptr */
uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
t_bool zad = dp_zeroad (ap); /* zero address */
static const int32 dec_tab[DP_ADDR] = /* powers of 10 */
{ 100000, 10000, 1000, 100, 10, 1} ;
@@ -337,13 +337,13 @@ for (i = 0; i < DP_ADDR; i++) { /* copy address */
sec = sec % dec_tab[i]; /* get remainder */
ac = bcd_to_bin[ac]; } /* cvt to BCD */
else ac = *ap; /* addr char */
if (qwc) { /* wr chk? zad ok */
if (!zad && (flg? (M[BS] != *ap): /* L? cmp with WM */
((M[BS] & CHAR) != (*ap & CHAR)))) { /* M? cmp w/o WM */
if (qwc) { /* wr chk? skip if zad */
if (!zad && (flg? (M[BS] != ac): /* L? cmp with WM */
((M[BS] & CHAR) != (ac & CHAR)))) { /* M? cmp w/o WM */
ind[IN_DPW] = ind[IN_DSK] = 1;
return STOP_WRCHKE; } }
else if (flg) M[BS] = *ap & CHAR; /* load mode */
else M[BS] = (M[BS] & WM) | (*ap & CHAR); /* move mode */
else if (flg) M[BS] = ac & CHAR; /* load mode */
else M[BS] = (M[BS] & WM) | (ac & CHAR); /* move mode */
ap++; BS++; /* adv ptrs */
if (ADDR_ERR (BS)) return STOP_WRAP; }
return SCPE_OK;
@@ -355,7 +355,7 @@ t_stat dp_rdsec (UNIT *uptr, int32 sec, int32 flg, int32 qwc)
{
int32 i, lim;
int32 da = (sec % DP_TOTSC) * DP_NUMCH; /* char number */
uint8 *ap = ((uint8 *) uptr -> filebuf) + da + DP_ADDR; /* buf ptr */
uint8 *ap = ((uint8 *) uptr->filebuf) + da + DP_ADDR; /* buf ptr */
lim = flg? (DP_DATA - 10): DP_DATA; /* load vs move */
for (i = 0; i < lim; i++) { /* copy data */
@@ -380,7 +380,7 @@ t_stat dp_wradr (UNIT *uptr, int32 sec, int32 flg)
{
int32 i;
uint32 da = (sec % DP_TOTSC) * DP_NUMCH; /* char number */
uint8 *ap = ((uint8 *) uptr -> filebuf) + da; /* buf ptr */
uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
for (i = 0; i < DP_ADDR; i++) { /* copy address */
if (M[BS] == (WM | BCD_GRPMRK)) { /* premature GWM? */
@@ -389,7 +389,7 @@ for (i = 0; i < DP_ADDR; i++) { /* copy address */
return STOP_INVDLN; }
if (flg) *ap = M[BS] & (WM | CHAR); /* L? copy WM */
else *ap = M[BS] & CHAR; /* M? strip WM */
if (da >= uptr -> hwmark) uptr -> hwmark = da + 1;
if (da >= uptr->hwmark) uptr->hwmark = da + 1;
da++; ap++; BS++; /* adv ptrs */
if (ADDR_ERR (BS)) return STOP_WRAP; }
return SCPE_OK;
@@ -401,7 +401,7 @@ t_stat dp_wrsec (UNIT *uptr, int32 sec, int32 flg)
{
int32 i, lim;
uint32 da = ((sec % DP_TOTSC) * DP_NUMCH) + DP_ADDR; /* char number */
uint8 *ap = ((uint8 *) uptr -> filebuf) + da; /* buf ptr */
uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
lim = flg? (DP_DATA - 10): DP_DATA; /* load vs move */
for (i = 0; i < lim; i++) { /* copy data */
@@ -411,7 +411,7 @@ for (i = 0; i < lim; i++) { /* copy data */
return STOP_INVDLN; }
if (flg) *ap = M[BS] & (WM | CHAR); /* load, copy WM */
else *ap = M[BS] & CHAR; /* move, strip WM */
if (da >= uptr -> hwmark) uptr -> hwmark = da + 1;
if (da >= uptr->hwmark) uptr->hwmark = da + 1;
da++; ap++; BS++; /* adv ptrs */
if (ADDR_ERR (BS)) return STOP_WRAP; }
return SCPE_OK;
@@ -419,37 +419,37 @@ return SCPE_OK;
/* Find sector */
int32 dp_fndsec (UNIT *uptr, int32 sec, int32 dcf, int32 flg)
int32 dp_fndsec (UNIT *uptr, int32 sec, int32 dcf)
{
int32 ctrk = sec % (DP_NUMSF * DP_NUMSC); /* curr trk-sec */
int32 psec = ((uptr -> CYL) * (DP_NUMSF * DP_NUMSC)) + ctrk;
int32 psec = ((uptr->CYL) * (DP_NUMSF * DP_NUMSC)) + ctrk;
int32 da = psec * DP_NUMCH; /* char number */
uint8 *ap = ((uint8 *) uptr -> filebuf) + da; /* buf ptr */
uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
int32 i;
if (dp_zeroad (ap)) return psec; /* addr zero? ok */
if (dp_cmp_ad (ap, dcf, flg)) return psec; /* addr comp? ok */
if (dp_cmp_ad (ap, dcf)) return psec; /* addr comp? ok */
psec = psec - (psec % DP_NUMSC); /* sector 0 */
for (i = 0; i < DP_NUMSC; i++, psec++) { /* check track */
da = psec * DP_NUMCH; /* char number */
ap = ((uint8 *) uptr -> filebuf) + da; /* word pointer */
ap = ((uint8 *) uptr->filebuf) + da; /* word pointer */
if (dp_zeroad (ap)) continue; /* no implicit match */
if (dp_cmp_ad (ap, dcf, flg)) return psec; } /* match? */
if (dp_cmp_ad (ap, dcf)) return psec; } /* match? */
ind[IN_UNA] = ind[IN_DSK] = 1; /* no match */
return -1;
}
/* Find next sector - must be sequential, cannot cross cylinder boundary */
t_stat dp_nexsec (UNIT *uptr, int32 psec, int32 dcf, int32 flg)
t_stat dp_nexsec (UNIT *uptr, int32 psec, int32 dcf)
{
int32 ctrk = psec % (DP_NUMSF * DP_NUMSC); /* curr trk-sec */
int32 da = psec * DP_NUMCH; /* word number */
uint8 *ap = ((uint8 *) uptr -> filebuf) + da; /* buf ptr */
uint8 *ap = ((uint8 *) uptr->filebuf) + da; /* buf ptr */
if (ctrk) { /* not trk zero? */
if (dp_zeroad (ap)) return SCPE_OK; /* addr zero? ok */
if (dp_cmp_ad (ap, dcf, flg)) return SCPE_OK; }/* addr comp? ok */
if (dp_cmp_ad (ap, dcf)) return SCPE_OK; } /* addr comp? ok */
ind[IN_UNA] = ind[IN_DSK] = 1; /* no, error */
return STOP_INVDAD;
}
@@ -467,7 +467,7 @@ return TRUE; /* all zeroes */
/* Compare disk address to memory sector address - always omit word marks */
t_bool dp_cmp_ad (uint8 *ap, int32 dcf, int32 flg)
t_bool dp_cmp_ad (uint8 *ap, int32 dcf)
{
int32 i;
uint8 c;
@@ -533,8 +533,8 @@ return cnt;
void dp_fill (UNIT *uptr, uint32 da, int32 cnt)
{
while (cnt-- > 0) { /* fill with blanks */
*(((uint8 *) uptr -> filebuf) + da) = BCD_BLANK;
if (da >= uptr -> hwmark) uptr -> hwmark = da + 1;
*(((uint8 *) uptr->filebuf) + da) = BCD_BLANK;
if (da >= uptr->hwmark) uptr->hwmark = da + 1;
da++; }
return;
}

View File

@@ -37,9 +37,11 @@ extern uint8 M[];
extern int32 BS, iochk, ind[64];
extern char ascii_to_bcd[128], bcd_to_ascii[64];
extern UNIT cpu_unit;
int32 inq_char = 033; /* request inq */
t_stat inq_svc (UNIT *uptr);
t_stat inq_reset (DEVICE *dptr);
void puts_tty (char *cptr);
/* INQ data structures

View File

@@ -34,11 +34,14 @@
extern uint8 M[];
extern char bcd_to_ascii[64];
extern int32 iochk, ind[64];
int32 cct[CCT_LNT] = { 03 };
int32 cctlnt = 66, cctptr = 0, lines = 0, lflag = 0;
t_stat lpt_reset (DEVICE *dptr);
t_stat lpt_attach (UNIT *uptr, char *cptr);
t_stat space (int32 lines, int32 lflag);
char bcd_to_pca[64] = {
' ', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '0', '#', '@', ' ', ' ', ' ',
@@ -89,7 +92,6 @@ REG lpt_reg[] = {
{ DRDATA (LINES, lines, 8), PV_LEFT },
{ DRDATA (CCTP, cctptr, 8), PV_LEFT },
{ DRDATA (CCTL, cctlnt, 8), REG_RO + PV_LEFT },
{ GRDATA (CHAIN, lpt_unit.flags, 10, 2, UNIT_V_PCHAIN), REG_HRO },
{ NULL } };
MTAB lpt_mod[] = {

View File

@@ -25,7 +25,11 @@
mt 7-track magtape
12-Jun-02 RMS End-of-record on read sets GM without WM
31-Oct-02 RMS Added error record handling
10-Oct-02 RMS Fixed end-of-record on load read writes WM plus GM
30-Sep-02 RMS Revamped error handling
28-Aug-02 RMS Added end of medium support
12-Jun-02 RMS End-of-record on move read preserves old WM under GM
(found by Van Snyder)
03-Jun-02 RMS Modified for 1311 support
30-May-02 RMS Widened POS to 32b
@@ -58,8 +62,9 @@
#define MT_NUMDR 7 /* #drives */
#define UNIT_V_WLK (UNIT_V_UF + 0) /* write locked */
#define UNIT_V_PNU (UNIT_V_UF + 1) /* pos not upd */
#define UNIT_WLK (1 << UNIT_V_WLK)
#define UNIT_W_UF 2 /* #save flags */
#define UNIT_PNU (1 << UNIT_V_PNU)
#define UNIT_WPRT (UNIT_WLK | UNIT_RO) /* write protect */
#define MT_MAXFR (MAXMEMSIZE * 2) /* max transfer */
@@ -69,7 +74,8 @@ extern int32 BS, iochk;
extern UNIT cpu_unit;
uint8 dbuf[MT_MAXFR]; /* tape buffer */
t_stat mt_reset (DEVICE *dptr);
t_stat mt_boot (int32 unitno);
t_stat mt_boot (int32 unitno, DEVICE *dptr);
t_stat mt_attach (UNIT *uptr, char *cptr);
UNIT *get_unit (int32 unit);
/* MT data structures
@@ -104,18 +110,6 @@ REG mt_reg[] = {
{ DRDATA (POS4, mt_unit[4].pos, 32), PV_LEFT + REG_RO },
{ DRDATA (POS5, mt_unit[5].pos, 32), PV_LEFT + REG_RO },
{ DRDATA (POS6, mt_unit[6].pos, 32), PV_LEFT + REG_RO },
{ GRDATA (FLG1, mt_unit[1].flags, 8, UNIT_W_UF, UNIT_V_UF - 1),
REG_HRO },
{ GRDATA (FLG2, mt_unit[2].flags, 8, UNIT_W_UF, UNIT_V_UF - 1),
REG_HRO },
{ GRDATA (FLG3, mt_unit[3].flags, 8, UNIT_W_UF, UNIT_V_UF - 1),
REG_HRO },
{ GRDATA (FLG4, mt_unit[4].flags, 8, UNIT_W_UF, UNIT_V_UF - 1),
REG_HRO },
{ GRDATA (FLG5, mt_unit[5].flags, 8, UNIT_W_UF, UNIT_V_UF - 1),
REG_HRO },
{ GRDATA (FLG6, mt_unit[6].flags, 8, UNIT_W_UF, UNIT_V_UF - 1),
REG_HRO },
{ NULL } };
MTAB mt_mod[] = {
@@ -127,7 +121,7 @@ DEVICE mt_dev = {
"MT", mt_unit, mt_reg, mt_mod,
MT_NUMDR, 10, 31, 1, 8, 8,
NULL, NULL, &mt_reset,
&mt_boot, NULL, NULL };
&mt_boot, &mt_attach, NULL };
/* Function routine
@@ -140,50 +134,59 @@ DEVICE mt_dev = {
t_stat mt_func (int32 unit, int32 mod)
{
int32 err;
int32 err, pnu;
t_mtrlnt tbc;
UNIT *uptr;
static t_mtrlnt bceof = { 0 };
static t_mtrlnt bceof = { MTR_TMK };
if ((uptr = get_unit (unit)) == NULL) return STOP_INVMTU; /* valid unit? */
if ((uptr -> flags & UNIT_ATT) == 0) return SCPE_UNATT; /* attached? */
pnu = MT_TST_PNU (uptr); /* get pos not upd */
MT_CLR_PNU (uptr); /* and clear */
if ((uptr->flags & UNIT_ATT) == 0) return SCPE_UNATT; /* attached? */
switch (mod) { /* case on modifier */
case BCD_B: /* backspace */
ind[IN_END] = 0; /* clear end of reel */
if (uptr -> pos == 0) return SCPE_OK; /* at bot? */
fseek (uptr -> fileref, uptr -> pos - sizeof (t_mtrlnt),
if (pnu || (uptr->pos < sizeof (t_mtrlnt))) /* bot or pnu? */
return SCPE_OK;
fseek (uptr->fileref, uptr->pos - sizeof (t_mtrlnt),
SEEK_SET);
fxread (&tbc, sizeof (t_mtrlnt), 1, uptr -> fileref);
if ((err = ferror (uptr -> fileref)) ||
(feof (uptr -> fileref))) break;
if (tbc == 0) /* file mark? */
uptr -> pos = uptr -> pos - sizeof (t_mtrlnt);
else uptr -> pos = uptr -> pos - ((MTRL (tbc) + 1) & ~1) -
fxread (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
if ((err = ferror (uptr->fileref)) || /* err or eof? */
feof (uptr->fileref)) break;
if ((tbc == MTR_TMK) || (tbc == MTR_EOM)) /* tmk or eom? */
uptr->pos = uptr->pos - sizeof (t_mtrlnt);
else uptr->pos = uptr->pos - ((MTRL (tbc) + 1) & ~1) -
(2 * sizeof (t_mtrlnt));
break; /* end case */
case BCD_E: /* erase = nop */
if (uptr -> flags & UNIT_WPRT) return STOP_MTL;
if (uptr->flags & UNIT_WPRT) return STOP_MTL;
return SCPE_OK;
case BCD_M: /* write tapemark */
if (uptr -> flags & UNIT_WPRT) return STOP_MTL;
fseek (uptr -> fileref, uptr -> pos, SEEK_SET);
fxwrite (&bceof, sizeof (t_mtrlnt), 1, uptr -> fileref);
err = ferror (uptr -> fileref);
uptr -> pos = uptr -> pos + sizeof (t_mtrlnt);
if (uptr->flags & UNIT_WPRT) return STOP_MTL;
fseek (uptr->fileref, uptr->pos, SEEK_SET);
fxwrite (&bceof, sizeof (t_mtrlnt), 1, uptr->fileref);
if (err = ferror (uptr->fileref)) MT_SET_PNU (uptr); /* error */
else uptr->pos = uptr->pos + sizeof (t_mtrlnt);
break;
case BCD_R: /* rewind */
uptr -> pos = 0; /* update position */
uptr->pos = 0; /* update position */
return SCPE_OK;
case BCD_U: /* unload */
uptr -> pos = 0; /* update position */
uptr->pos = 0; /* update position */
return detach_unit (uptr); /* detach */
default:
return STOP_INVM; }
if (err != 0) { /* I/O error */
perror ("MT I/O error");
clearerr (uptr -> fileref);
if (iochk) return SCPE_IOERR;
ind[IN_TAP] = 1; }
clearerr (uptr->fileref);
ind[IN_TAP] = 1; /* set indicator */
if (iochk) return SCPE_IOERR; }
return SCPE_OK;
}
@@ -199,31 +202,36 @@ return SCPE_OK;
t_stat mt_io (int32 unit, int32 flag, int32 mod)
{
int32 err, i, t, wm_seen;
t_mtrlnt tbc;
int32 err, t, wm_seen;
t_mtrlnt i, tbc, ebc;
UNIT *uptr;
if ((uptr = get_unit (unit)) == NULL) return STOP_INVMTU; /* valid unit? */
if ((uptr -> flags & UNIT_ATT) == 0) return SCPE_UNATT; /* attached? */
uptr->flags = uptr->flags & ~UNIT_PNU; /* clr pos not upd */
if ((uptr->flags & UNIT_ATT) == 0) return SCPE_UNATT; /* attached? */
switch (mod) {
case BCD_R: /* read */
ind[IN_TAP] = ind[IN_END] = 0; /* clear error */
wm_seen = 0; /* no word mk seen */
fseek (uptr -> fileref, uptr -> pos, SEEK_SET);
fxread (&tbc, sizeof (t_mtrlnt), 1, uptr -> fileref);
if ((err = ferror (uptr -> fileref)) || (feof (uptr -> fileref))) {
ind[IN_END] = 1; /* err or eof? */
fseek (uptr->fileref, uptr->pos, SEEK_SET);
fxread (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
if (err = ferror (uptr->fileref)) break; /* error? */
if (feof (uptr->fileref) || (tbc == MTR_EOM)) { /* eom or eof? */
ind[IN_TAP] = 1; /* pretend error */
MT_SET_PNU (uptr); /* pos not upd */
break; }
if (tbc == 0) { /* tape mark? */
if (tbc == MTR_TMK) { /* tape mark? */
ind[IN_END] = 1; /* set end mark */
uptr -> pos = uptr -> pos + sizeof (t_mtrlnt);
uptr->pos = uptr->pos + sizeof (t_mtrlnt);
break; }
tbc = MTRL (tbc); /* ignore error flag */
if (MTRF (tbc)) ind[IN_TAP] = 1; /* error? set flag */
tbc = MTRL (tbc); /* clear error flag */
if (tbc > MT_MAXFR) return SCPE_MTRLNT; /* record too long? */
i = fxread (dbuf, sizeof (int8), tbc, uptr -> fileref);
i = fxread (dbuf, sizeof (int8), tbc, uptr->fileref);
if (err = ferror (uptr->fileref)) break; /* I/O error? */
for ( ; i < tbc; i++) dbuf[i] = 0; /* fill with 0's */
if (err = ferror (uptr -> fileref)) break; /* I/O error? */
uptr -> pos = uptr -> pos + ((tbc + 1) & ~1) +
uptr->pos = uptr->pos + ((tbc + 1) & ~1) +
(2 * sizeof (t_mtrlnt));
for (i = 0; i < tbc; i++) { /* loop thru buf */
if (M[BS] == (BCD_GRPMRK + WM)) { /* GWM in memory? */
@@ -243,12 +251,16 @@ case BCD_R: /* read */
if (ADDR_ERR (BS)) { /* check next BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; } }
if (flag == MD_WM) M[BS] = BCD_GRPMRK; /* load? clear WM */
if (flag == MD_WM) M[BS] = WM | BCD_GRPMRK; /* load? set WM */
else M[BS] = (M[BS] & WM) | BCD_GRPMRK; /* move? save WM */
BS++; /* adv BS */
if (ADDR_ERR (BS)) { /* check final BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
break;
case BCD_W:
if (uptr -> flags & UNIT_WPRT) return STOP_MTL; /* locked? */
if (uptr->flags & UNIT_WPRT) return STOP_MTL; /* locked? */
if (M[BS] == (BCD_GRPMRK + WM)) return STOP_MTZ; /* eor? */
ind[IN_TAP] = ind[IN_END] = 0; /* clear error */
for (tbc = 0; (t = M[BS++]) != (BCD_GRPMRK + WM); ) {
@@ -259,13 +271,13 @@ case BCD_W:
if (ADDR_ERR (BS)) { /* check next BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; } }
fseek (uptr -> fileref, uptr -> pos, SEEK_SET);
fxwrite (&tbc, sizeof (t_mtrlnt), 1, uptr -> fileref);
fxwrite (dbuf, sizeof (int8), (tbc + 1) & ~1, uptr -> fileref);
fxwrite (&tbc, sizeof (t_mtrlnt), 1, uptr -> fileref);
if (err = ferror (uptr -> fileref)) break; /* I/O error? */
uptr -> pos = uptr -> pos + ((tbc + 1) & ~1) +
(2 * sizeof (t_mtrlnt));
ebc = (tbc + 1) & ~1; /* force even */
fseek (uptr->fileref, uptr->pos, SEEK_SET);
fxwrite (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
fxwrite (dbuf, sizeof (int8), ebc, uptr->fileref);
fxwrite (&tbc, sizeof (t_mtrlnt), 1, uptr->fileref);
if (err = ferror (uptr->fileref)) break; /* I/O error? */
uptr->pos = uptr->pos + ebc + (2 * sizeof (t_mtrlnt));
if (ADDR_ERR (BS)) { /* check final BS */
BS = BA | (BS % MAXMEMSIZE);
return STOP_WRAP; }
@@ -273,14 +285,15 @@ case BCD_W:
default:
return STOP_INVM; }
if (err != 0) { /* I/O error */
if (err != 0) { /* I/O error? */
perror ("MT I/O error");
clearerr (uptr -> fileref);
clearerr (uptr->fileref);
MT_SET_PNU (uptr); /* pos not upd */
ind[IN_TAP] = 1; /* flag error */
if (iochk) return SCPE_IOERR; }
return SCPE_OK;
}
/* Get unit pointer from unit number */
UNIT *get_unit (int32 unit)
@@ -293,13 +306,26 @@ else return mt_dev.units + unit;
t_stat mt_reset (DEVICE *dptr)
{
int32 i;
UNIT *uptr;
for (i = 0; i < MT_NUMDR; i++) { /* clear pos flag */
if (uptr = get_unit (i)) MT_CLR_PNU (uptr); }
ind[IN_END] = ind[IN_TAP] = 0; /* clear indicators */
return SCPE_OK;
}
/* Attach routine */
t_stat mt_attach (UNIT *uptr, char *cptr)
{
MT_CLR_PNU (uptr);
return attach_unit (uptr, cptr);
}
/* Bootstrap routine */
t_stat mt_boot (int32 unitno)
t_stat mt_boot (int32 unitno, DEVICE *dptr)
{
extern int32 saved_IS;

View File

@@ -202,7 +202,7 @@ extern int32 op_table[64], len_table[9];
if (sw & SWMASK ('C')) { /* character? */
t = val[0];
if (uptr -> flags & UNIT_BCD)
if (uptr->flags & UNIT_BCD)
fprintf (of, (t & WM)? "~%c": "%c", bcd_to_ascii[t & CHAR]);
else fprintf (of, FMTASC (t & 0177));
return SCPE_OK; }
@@ -302,7 +302,7 @@ if ((sw & SWMASK ('C')) || (sw & SWMASK ('S')) || (*cptr == '~') ||
for (i = 0; (i < sim_emax) && (*cptr != 0); ) {
t = *cptr++; /* get character */
if (cflag && (wm_seen == 0) && (t == '~')) wm_seen = WM;
else if (uptr -> flags & UNIT_BCD) {
else if (uptr->flags & UNIT_BCD) {
if (t < 040) return SCPE_ARG;
val[i++] = ascii_to_bcd[t] | wm_seen;
wm_seen = 0; }