mirror of
https://github.com/rcornwell/sims.git
synced 2026-03-26 01:56:18 +00:00
SEL32: Update sel32_ec.c to correctly handle EC diag in modes 0-3.
SEL32: update to current simh version. SEL32: do some code cleanup on various modules. SEL32: update HIO processing in sel32_chan.c. SEL32: speed up mt handling in sel32_mt.c. SEL32: Update SetupNet for network setup.
This commit is contained in:
@@ -255,7 +255,6 @@ int32 IOCLQ_Get(IOCLQ *qptr, uint32 *old)
|
||||
|
||||
/* see if the IOCLQ is empty */
|
||||
if (qptr->ioclq_in == qptr->ioclq_out) {
|
||||
// sim_debug(DEBUG_EXP, &cpu_dev, "IOCLQ_Get IOCLQ empty\n");
|
||||
return -1; /* IOCLQ is empty, tell caller */
|
||||
}
|
||||
*old = qptr->ioclq_fifo[qptr->ioclq_out]; /* get the next entry */
|
||||
@@ -707,7 +706,6 @@ loop:
|
||||
/* DC can only be used with a read/write cmd */
|
||||
/* TODO move ccw code to LPR processing */
|
||||
/* TEMP FIX FOR LPR */
|
||||
// if (chp->ccw_flags & FLAG_DC) {
|
||||
if ((chp->ccw_flags & FLAG_DC) && (chsa != 0x7ef8)) {
|
||||
if ((chp->ccw_cmd != 0x02) && (chp->ccw_cmd != 0x01)) {
|
||||
chp->chan_status |= STATUS_PCHK; /* program check for invalid DC */
|
||||
@@ -959,7 +957,6 @@ void chan_end(uint16 chsa, uint16 flags) {
|
||||
sim_debug(DEBUG_EXP, &cpu_dev,
|
||||
"chan_end INFO_CEND set chsa %04x ccw_flags %04x status %04x byte %02x\n",
|
||||
chsa, chp->ccw_flags, chp->chan_status, chp->chan_byte);
|
||||
/// return; /* just return */
|
||||
}
|
||||
chp->chan_info |= INFO_CEND; /* we have been here */
|
||||
|
||||
@@ -1284,7 +1281,6 @@ nothere:
|
||||
*status = 0; /* CCs = 0, OK return */
|
||||
else
|
||||
/* return CC1 for non iop/mfp devices */
|
||||
//1003 *status = CC1BIT; /* CCs = 1, not busy */
|
||||
*status = 0; /* CCs = 0, OK return */
|
||||
sim_debug(DEBUG_DETAIL, &cpu_dev,
|
||||
"checkxio lchsa %04x rchsa %04x done CC status %08x\n",
|
||||
@@ -1449,7 +1445,6 @@ missing:
|
||||
/* handle an Ethernet controller busy by sending interrupt/status */
|
||||
chp->chan_status = STATUS_BUSY|STATUS_CEND|STATUS_DEND; /* set busy status */
|
||||
chp->ccw_count = 0; /* zero count */
|
||||
//0312 store_csw(chp); /* store the status */
|
||||
push_csw(chp); /* store the status */
|
||||
chp->chan_status = tstat; /* restore status */
|
||||
chp->ccw_count = tcnt; /* restore count */
|
||||
@@ -1522,7 +1517,6 @@ missing:
|
||||
"SIO pre_io call return NO INCH %04x chsa %04x cstat %02x cmd %02x cnt %02x\n",
|
||||
incha, chsa, tempa, cmd, word2);
|
||||
if ((cmd != 0) || ((MASK16 & word2) == 0)) {
|
||||
// *status = CC1BIT; /* request accepted, no status, so CC1 */
|
||||
*status = 0; /* request accepted, no status, so CC1 */
|
||||
return SCPE_OK; /* just do nothing until inch */
|
||||
}
|
||||
@@ -1776,8 +1770,6 @@ t_stat stopxio(uint16 lchsa, uint32 *status) { /* stop XIO */
|
||||
itva = SPAD[0xf1] + (inta<<2); /* int vector address */
|
||||
chan_icb = RMW(itva); /* Interrupt context block addr */
|
||||
iocla = RMW(chan_icb+16); /* iocla is in wd 4 of ICB */
|
||||
// /* reset the DC or CC bits to force completion after current IOCD */
|
||||
// chp->ccw_flags &= ~(FLAG_DC|FLAG_CC); /* reset chaining bits */
|
||||
/* reset the CC bit to force completion after current IOCD */
|
||||
chp->ccw_flags &= ~FLAG_CC; /* reset chaining bits */
|
||||
sim_debug(DEBUG_CMD, &cpu_dev,
|
||||
@@ -1790,18 +1782,6 @@ t_stat stopxio(uint16 lchsa, uint32 *status) { /* stop XIO */
|
||||
sim_debug(DEBUG_CMD, &cpu_dev,
|
||||
"STPIO not busy return rchsa %04x cmd %02x ccw_flags %04x status %04x byte %02x\n",
|
||||
rchsa, chp->ccw_cmd, chp->ccw_flags, *status, chp->chan_byte);
|
||||
#ifdef GIVE_STATUS_ON_NOT_BUSY_05112021
|
||||
// NOW off 05142021 */
|
||||
chp->chan_byte = BUFF_DONE; /* we are done */
|
||||
chp->chan_status = (STATUS_DEND|STATUS_CEND);
|
||||
// store_csw(chp); /* store the status */
|
||||
push_csw(chp); /* store the status 1st in FIFO */
|
||||
/* change chan_byte to BUFF_POST */
|
||||
chp->chan_byte = BUFF_POST; /* show done with data */
|
||||
chp->chan_status = 0; /* no status anymore */
|
||||
chp->ccw_cmd = 0; /* no command anymore */
|
||||
irq_pend = 1; /* flag to test for int condition */
|
||||
#endif
|
||||
return SCPE_OK; /* No CC's all OK */
|
||||
}
|
||||
|
||||
@@ -2071,7 +2051,6 @@ t_stat haltxio(uint16 lchsa, uint32 *status) { /* halt XIO */
|
||||
irq_pend = 1; /* flag to test for int condition */
|
||||
|
||||
/* see if any status ready to post */
|
||||
// if (FIFO_Num(rchsa)) {
|
||||
if ((FIFO_Num(rchsa)) && (CPUSTATUS & BIT24)) { /* interrupts blocked? */
|
||||
sim_debug(DEBUG_IRQ, &cpu_dev,
|
||||
"HIO rchsa %04x LOOK FIFO #%1x irq %02x inch %06x chp %p icba %06x chan_byte %02x\n",
|
||||
@@ -2090,21 +2069,23 @@ t_stat haltxio(uint16 lchsa, uint32 *status) { /* halt XIO */
|
||||
sim_debug(DEBUG_XIO, &cpu_dev,
|
||||
"HIO END incha %06x chan_icba+20 %08x rchsa %04x sw1 %08x sw2 %08x\n",
|
||||
incha, RMW(chan_icb+20), rchsa, RMW(incha), RMW(incha+4));
|
||||
// if ((CPUSTATUS & BIT24) == 0) /* interrupts blocked? */
|
||||
// INTS[inta] &= ~INTS_REQ; /* clear any level request if no status */
|
||||
// INTS[inta] |= INTS_REQ; /* set level request if status */
|
||||
*status = CC2BIT; /* status stored from SIO, so CC2 */
|
||||
return SCPE_OK; /* No CC's all OK */
|
||||
/*ADDED 111921 to disable int request after data posted */
|
||||
INTS[inta] &= ~INTS_REQ; /* clear any level request */
|
||||
*status = CC2BIT; /* status stored from SIO, so CC2 */
|
||||
return SCPE_OK; /* No CC's all OK */
|
||||
} else {
|
||||
sim_debug(DEBUG_IRQ, &cpu_dev,
|
||||
"HIO rchsa %04x NOT POSTED FIFO #%1x irq %02x inch %06x chan_icba %06x chan_byte %02x\n",
|
||||
rchsa, FIFO_Num(rchsa), inta, chp->chan_inch_addr, chan_icb, chp->chan_byte);
|
||||
/* now store the status dw address into word 5 of the ICB for the channel */
|
||||
WMW(chan_icb+20, 0); /* post sw addr 0 in ICB+5w & reset CCs */
|
||||
*status = 0; /* no status stored from TIO, so no CC */
|
||||
return SCPE_OK; /* No CC's all OK */
|
||||
WMW(chan_icb+20, 0); /* post sw addr 0 in ICB+5w & reset CCs */
|
||||
*status = 0; /* no status stored from HIO, so no CC */
|
||||
return SCPE_OK; /* No CC's all OK */
|
||||
}
|
||||
}
|
||||
if ((CPUSTATUS & BIT24) == 0) { /* interrupts blocked? */
|
||||
sim_debug(DEBUG_DETAIL, &cpu_dev, "HIO after END2 INTS not blocked!\n");
|
||||
}
|
||||
return SCPE_OK; /* CC1 & all OK */
|
||||
}
|
||||
/* the device is not busy, so cmd is completed */
|
||||
@@ -2121,7 +2102,6 @@ t_stat haltxio(uint16 lchsa, uint32 *status) { /* halt XIO */
|
||||
sim_debug(DEBUG_EXP, &cpu_dev,
|
||||
"haltxio BUFF_DONE2 chp %p chan_byte %04x\n", chp, chp->chan_byte);
|
||||
chp->chan_status = (STATUS_DEND|STATUS_CEND);
|
||||
// store_csw(chp); /* store the status */
|
||||
push_csw(chp); /* store the status 1st in FIFO */
|
||||
/* change chan_byte to BUFF_POST */
|
||||
chp->chan_byte = BUFF_POST; /* show done with data */
|
||||
@@ -2249,12 +2229,10 @@ t_stat grabxio(uint16 lchsa, uint32 *status) { /* grab controller XIO n/u */
|
||||
// try using CC4 on MPX3X when still busy
|
||||
if (chp->chan_byte == BUFF_POST) {
|
||||
uint32 chan_icb; /* Interrupt level context block address */
|
||||
// uint32 iocla; /* I/O channel IOCL address int ICB */
|
||||
uint32 inta = ((~spadent)>>16)&0x7f; /* get channel interrupt level */
|
||||
/* get the address of the interrupt IVL in main memory */
|
||||
uint32 itva = SPAD[0xf1] + (inta<<2); /* int vector address */
|
||||
chan_icb = RMW(itva); /* Interrupt context block addr */
|
||||
// iocla = RMW(chan_icb+16); /* iocla is in wd 4 of ICB */
|
||||
*status = CC1BIT; /* request accepted, no status, so CC1 */
|
||||
/* see if any status ready to post */
|
||||
if (FIFO_Num(rchsa)) {
|
||||
@@ -2566,7 +2544,6 @@ uint32 scan_chan(uint32 *ilev) {
|
||||
TPSD[0] = M[0]; /* save PSD from loc 0&4 */
|
||||
TPSD[1] = M[1];
|
||||
/* save the status double word to memory */
|
||||
// WMW(tempa, sw1); /* save sa & IOCD address in status WD 1 loc */
|
||||
/* set BIT 1 to show status stored */
|
||||
WMW(tempa, sw1|BIT1); /* save sa & IOCD address in status WD 1 loc */
|
||||
WMW(tempa+4, sw2); /* save status and residual cnt in status WD 2 loc */
|
||||
@@ -2789,7 +2766,6 @@ t_stat chan_set_devs() {
|
||||
if ((dptr->flags & DEV_DIS) || /* Skip disabled devices */
|
||||
((dibp->chan_prg) == NULL)) { /* must have channel info for each device */
|
||||
chsa = GET_UADDR(uptr->u3); /* ch/sa value */
|
||||
//printf("Device %s chsa %04x not set up dibp %p uptr %p\n", dptr->name, chsa, dibp, uptr);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2797,8 +2773,6 @@ t_stat chan_set_devs() {
|
||||
/* Check if address is in unit or dev entry */
|
||||
for (j = 0; j < dptr->numunits; j++) { /* loop through unit entries */
|
||||
chsa = GET_UADDR(uptr->u3); /* ch/sa value */
|
||||
//printf("Setup device %s%d chsa %04x type %02x dibp %p uptr %p\n",
|
||||
//dptr->name, j, chsa, GET_TYPE(uptr->flags), dibp, uptr);
|
||||
/* zero some channel data loc's for device */
|
||||
chp->unitptr = uptr; /* set the unit back pointer */
|
||||
chp->chan_status = 0; /* clear the channel status */
|
||||
@@ -2819,10 +2793,8 @@ t_stat chan_set_devs() {
|
||||
if (dptr->flags & DEV_CHAN) {
|
||||
/* see if channel address already defined */
|
||||
if (dib_chan[get_chan(chsa)] != 0) {
|
||||
//printf("Channel mux %04x already defined, aborting\n", chsa);
|
||||
return SCPE_IERR; /* no, arg error */
|
||||
}
|
||||
//printf("Setting Channel mux %04x dibp %p\n", chsa, dibp);
|
||||
/* channel mux, save dib for channel */
|
||||
dib_chan[get_chan(chsa)] = dibp;
|
||||
if (dibp->dev_ini != NULL) /* if there is an init routine, call it now */
|
||||
@@ -2830,13 +2802,11 @@ t_stat chan_set_devs() {
|
||||
} else {
|
||||
/* we have unit 0 of non-IOP/MFP device */
|
||||
if (dib_unit[chsa] != 0) {
|
||||
//printf("Channel/Dev %04x already defined uptr %p\n", chsa, uptr);
|
||||
return SCPE_IERR; /* no, arg error */
|
||||
} else {
|
||||
/* channel mux, save dib for channel */
|
||||
/* for now, save any zero dev as chan */
|
||||
if (chsa) {
|
||||
//printf("Setting Channel zero unit 0 device %04x dibp %p uptr %p\n", chsa, dibp, uptr);
|
||||
dib_unit[chsa] = dibp; /* no, save the dib address */
|
||||
if (dibp->dev_ini != NULL) /* if there is an init routine, call it now */
|
||||
dibp->dev_ini(uptr, 1); /* init the channel */
|
||||
@@ -2846,7 +2816,6 @@ t_stat chan_set_devs() {
|
||||
} else {
|
||||
/* see if address already defined */
|
||||
if (dib_unit[chsa] != 0) {
|
||||
//printf("Channel/SubAddress %04x multiple defined, aborting\n", chsa);
|
||||
return SCPE_IERR; /* no, arg error */
|
||||
}
|
||||
dib_unit[chsa] = dibp; /* no, save the dib address */
|
||||
@@ -2868,10 +2837,8 @@ t_stat chan_set_devs() {
|
||||
if (dib_unit[i<<8]) {
|
||||
/* write dibp to channel array */
|
||||
dib_chan[i] = dib_unit[i<<8]; /* save the channel dib */
|
||||
//printf("Chan_set_dev new Channel %04x defined at dibp %p\n", i<<8, dib_unit[i<<8]);
|
||||
}
|
||||
} else {
|
||||
//printf("Chan_set_dev Channel %04x defined at dibp %p\n", i<<8, dib_chan[i]);
|
||||
/* channel is defined, see if defined in dib_unit array */
|
||||
if ((dib_unit[i<<8]) == 0) {
|
||||
/* write dibp to units array */
|
||||
@@ -2899,15 +2866,12 @@ t_stat set_dev_addr(UNIT *uptr, int32 val, CONST char *cptr, void *desc) {
|
||||
dptr = get_dev(uptr); /* find the device from unit pointer */
|
||||
if (dptr == NULL) { /* device not found, so error */
|
||||
fprintf(stderr, "Set dev no DEVICE cptr %s uptr %p\r\n", cptr, uptr);
|
||||
//printf("Set dev no DEVICE ptr %s\r\n", cptr);
|
||||
return SCPE_IERR; /* error */
|
||||
}
|
||||
|
||||
//printf("Set dev DEVICE ptr %s uptr %p\r\n", cptr, uptr);
|
||||
dibp = (DIB *)dptr->ctxt; /* get dib pointer from device struct */
|
||||
if (dibp == NULL) { /* we need a DIB */
|
||||
fprintf(stderr, "Set dev no DIB ptr %s uptr %p\r\n", cptr, uptr);
|
||||
//printf("Set dev no DIB ptr %s\r\n", cptr);
|
||||
return SCPE_IERR; /* no DIB, so error */
|
||||
}
|
||||
|
||||
@@ -2915,7 +2879,6 @@ t_stat set_dev_addr(UNIT *uptr, int32 val, CONST char *cptr, void *desc) {
|
||||
if (r != SCPE_OK) /* need good number */
|
||||
return r; /* number error, return error */
|
||||
|
||||
//printf("Set new dev DEVICE ptr %s chan %04x\r\n", cptr, chan);
|
||||
dibp->chan_addr = chan; /* set new parent channel addr */
|
||||
|
||||
/* change all the unit addresses with the new channel, but keep sub address */
|
||||
@@ -2926,21 +2889,12 @@ t_stat set_dev_addr(UNIT *uptr, int32 val, CONST char *cptr, void *desc) {
|
||||
for (i = 0; i < dibp->numunits; i++) {
|
||||
int mask=dibp->mask; /* sa bits that are used */
|
||||
ochsa = GET_UADDR(tuptr->u3); /* get old chsa for this unit */
|
||||
//printf("Got unit %x old chsa %04x mask %04x\r\n", i, ochsa, mask);
|
||||
dib_unit[ochsa] = NULL; /* clear sa dib pointer */
|
||||
dib_unit[ochsa&0x7f00] = NULL; /* clear the channel dib address */
|
||||
chan &= ~mask; /* remove the unit number */
|
||||
chsa = chan | (ochsa & mask); /* put in new sa */
|
||||
//6 if (ochsa & 0xf0) { /* Is this a channel device IOP/MFP */
|
||||
//6 chan &= 0x7ff0; /* clean channel sub-address */
|
||||
//6 chsa = chan | (ochsa & 0xf); /* merge new channel with old sa */
|
||||
//6 } else {
|
||||
//6 chan &= 0x7f00; /* clean channel address */
|
||||
//6 chsa = chan | (ochsa & 0xff); /* merge new channel with old sa */
|
||||
//6 }
|
||||
if (chsa != ochsa) {
|
||||
fprintf(stderr, "Set unit %x new chsa %04x old chsa %04x\r\n", i, chsa, ochsa);
|
||||
//printf("Set unit %x new chsa %04x old chsa %04x\r\n", i, chsa, ochsa);
|
||||
}
|
||||
tuptr->u3 &= ~UNIT_ADDR_MASK; /* clear old chsa for this unit */
|
||||
tuptr->u3 |= UNIT_ADDR(chsa); /* set new chsa for this unit */
|
||||
|
||||
@@ -6006,7 +6006,9 @@ skipdqe2:
|
||||
case 0x3: /* LPSD F980 */
|
||||
/* fall through */;
|
||||
case 0x5: /* LPSDCM FA80 */
|
||||
#ifdef MAYBE_NO
|
||||
irq_pend = 1; /* start scanning interrupts again */
|
||||
#endif
|
||||
if ((MODES & PRIVBIT) == 0) { /* must be privileged */
|
||||
TRAPME = PRIVVIOL_TRAP; /* set the trap to take */
|
||||
if ((CPU_MODEL == MODEL_97) || (CPU_MODEL == MODEL_V9))
|
||||
@@ -6317,7 +6319,9 @@ skipdqe:
|
||||
/* |-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------| */
|
||||
/* */
|
||||
case 0xFC>>2: /* 0xFC IMM - IMM */ /* XIO, CD, TD, Interrupt Control */
|
||||
#ifdef MAYBE_NO
|
||||
irq_pend = 1; /* start scanning interrupts again */
|
||||
#endif
|
||||
if ((MODES & PRIVBIT) == 0) { /* must be privileged to do I/O */
|
||||
TRAPME = PRIVVIOL_TRAP; /* set the trap to take */
|
||||
if ((CPU_MODEL == MODEL_97) || (CPU_MODEL == MODEL_V9))
|
||||
|
||||
@@ -414,7 +414,7 @@ extern DEBTAB dev_debug[];
|
||||
/* general instruction decode equates */
|
||||
#define IND 0x00100000 /* indirect bit in instruction, bit 11 */
|
||||
#define F_BIT 0x00080000 /* byte flag addressing bit 11 in instruction */
|
||||
#define C_BITS 0x00000003 /* byte number or hw, dw, dw flags bits 20 & 31 */
|
||||
#define C_BITS 0x00000003 /* byte number or hw, dw, dw flags bits 30 & 31 */
|
||||
#define BIT0 0x80000000 /* general use for bit 0 testing */
|
||||
#define BIT1 0x40000000 /* general use for bit 1 testing */
|
||||
#define BIT2 0x20000000 /* general use for bit 2 testing */
|
||||
|
||||
@@ -587,8 +587,6 @@ uint32 get_dmatrk(UNIT *uptr, uint32 star, uint8 buf[])
|
||||
int unit = (uptr - dptr->units); /* get the UNIT number */
|
||||
int len, i, cn, found = -1;
|
||||
|
||||
#define SPEEDUP
|
||||
#ifdef SPEEDUP
|
||||
int ds = ((CYL(type) - 3) * HDS(type)) * SPT(type); /* diag start */
|
||||
/* get file offset in sectors */
|
||||
tstart = STAR2SEC(star, SPT(type), SPC(type));
|
||||
@@ -599,12 +597,6 @@ uint32 get_dmatrk(UNIT *uptr, uint32 star, uint8 buf[])
|
||||
buf[4] = 0;
|
||||
return nstar; /* not in diag track, return */
|
||||
}
|
||||
#else
|
||||
/* get file offset in sectors */
|
||||
tstart = STAR2SEC(star, SPT(type), SPC(type));
|
||||
/* convert sector number back to chs value to sync disk for diags */
|
||||
nstar = disksec2star(tstart, type);
|
||||
#endif
|
||||
|
||||
cyl = (nstar >> 16) & 0xffff; /* get the cylinder */
|
||||
trk = (nstar >> 8) & 0xff; /* get the track */
|
||||
@@ -612,7 +604,6 @@ uint32 get_dmatrk(UNIT *uptr, uint32 star, uint8 buf[])
|
||||
|
||||
/* get track number */
|
||||
tstart = (cyl * HDS(type)) + trk;
|
||||
// sim_debug(DEBUG_EXP, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"get_dmatrk RTL star %08x nstar %08x cyl %4x(%d) trk %x sec# %06x\n",
|
||||
star, nstar, cyl, cyl, trk, tstart);
|
||||
@@ -632,7 +623,6 @@ uint32 get_dmatrk(UNIT *uptr, uint32 star, uint8 buf[])
|
||||
buf[i] = tkl_label[unit].tkl[cn].label[i];
|
||||
found = cn;
|
||||
tkl_label[unit].tkl[cn].age++;
|
||||
// sim_debug(DEBUG_EXP, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"get_dpatrk found in Cache to %06x\n", offset);
|
||||
break;
|
||||
@@ -642,7 +632,6 @@ uint32 get_dmatrk(UNIT *uptr, uint32 star, uint8 buf[])
|
||||
/* see if found in cache */
|
||||
if (found == -1) {
|
||||
/* file offset in bytes */
|
||||
// sim_debug(DEBUG_EXP, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"get_dpatrk RTL SEEK on seek to %06x\n", offset);
|
||||
|
||||
@@ -729,7 +718,6 @@ t_stat disk_iocl(CHANP *chp, int32 tic_ok)
|
||||
uint32 word1 = 0;
|
||||
uint32 word2 = 0;
|
||||
int32 docmd = 0;
|
||||
// DIB *dibp = dib_unit[chp->chan_dev];/* get the DIB pointer */
|
||||
UNIT *uptr = chp->unitptr; /* get the unit ptr */
|
||||
uint16 chan = get_chan(chp->chan_dev); /* our channel */
|
||||
uint16 chsa = chp->chan_dev; /* our chan/sa */
|
||||
@@ -781,9 +769,6 @@ loop:
|
||||
chp->chan_caw, chan, word1, word2);
|
||||
|
||||
chp->chan_caw = (chp->chan_caw & 0xfffffc) + 8; /* point to next IOCD */
|
||||
#ifdef BAD_05142021
|
||||
chp->ccw_cmd = (word1 >> 24) & 0xff; /* set command from IOCD wd 1 */
|
||||
#endif
|
||||
|
||||
/* Check if we had data chaining in previous iocd */
|
||||
/* if we did, use previous cmd value */
|
||||
@@ -871,14 +856,9 @@ loop:
|
||||
}
|
||||
|
||||
/* Check if we had data chaining in previous iocd */
|
||||
#ifdef BAD_05152021
|
||||
if ((chp->chan_info & INFO_SIOCD) || /* see if 1st IOCD in channel prog */
|
||||
((chp->ccw_flags & FLAG_DC) == 0)) { /* last IOCD have DC set? */
|
||||
#else
|
||||
if ((chp->chan_info & INFO_SIOCD) || /* see if 1st IOCD in channel prog */
|
||||
(((chp->chan_info & INFO_SIOCD) == 0) && /* see if 1st IOCD in channel prog */
|
||||
((chp->ccw_flags & FLAG_DC) == 0))) { /* last IOCD have DC set? */
|
||||
#endif
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
"disk_iocl @%06x DO CMD No DC, ccw_flags %04x cmd %02x\n",
|
||||
chp->chan_caw, chp->ccw_flags, chp->ccw_cmd);
|
||||
@@ -925,7 +905,6 @@ loop:
|
||||
return 1; /* if none, error */
|
||||
}
|
||||
|
||||
// sim_debug(DEBUG_XIO, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_iocl @%06x before start_cmd chan %04x status %04x count %04x SNS %08x\n",
|
||||
chp->chan_caw, chan, chp->chan_status, chp->ccw_count, uptr->u5);
|
||||
@@ -937,7 +916,6 @@ loop:
|
||||
chp->chan_status = (chp->chan_status & 0xff00) | devstat;
|
||||
chp->chan_info &= ~INFO_SIOCD; /* show not first IOCD in channel prog */
|
||||
|
||||
// sim_debug(DEBUG_XIO, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_iocl @%06x after start_cmd chan %04x status %08x count %04x byte %02x\n",
|
||||
chp->chan_caw, chan, chp->chan_status, chp->ccw_count, chp->chan_byte);
|
||||
@@ -962,7 +940,6 @@ loop:
|
||||
if (chp->chan_status & (STATUS_DEND|STATUS_CEND)) {
|
||||
uint16 chsa = GET_UADDR(uptr->u3); /* get channel & sub address */
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* show I/O complete */
|
||||
// sim_debug(DEBUG_XIO, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_iocl @%06x FIFO #%1x cmd complete chan %04x status %04x count %04x\n",
|
||||
chp->chan_caw, FIFO_Num(chsa), chan, chp->chan_status, chp->ccw_count);
|
||||
@@ -970,7 +947,6 @@ loop:
|
||||
}
|
||||
/* the device processor returned OK (0), so wait for I/O to complete */
|
||||
/* nothing happening, so return */
|
||||
// sim_debug(DEBUG_XIO, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_iocl @%06x return, chan %04x status %04x count %04x irq_pend %1x\n",
|
||||
chp->chan_caw, chan, chp->chan_status, chp->ccw_count, irq_pend);
|
||||
@@ -984,7 +960,6 @@ t_stat disk_startcmd(UNIT *uptr, uint16 chan, uint8 cmd)
|
||||
int32 unit = (uptr - dptr->units);
|
||||
CHANP *chp = find_chanp_ptr(chsa); /* find the chanp pointer */
|
||||
|
||||
// sim_debug(DEBUG_CMD, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_startcmd chsa %04x unit %02x cmd %02x CMD %08x\n",
|
||||
chsa, unit, cmd, uptr->CMD);
|
||||
@@ -1001,7 +976,6 @@ t_stat disk_startcmd(UNIT *uptr, uint16 chan, uint8 cmd)
|
||||
return SNS_BSY;
|
||||
}
|
||||
uptr->SNS2 |= SNS_USEL; /* unit selected */
|
||||
// sim_debug(DEBUG_CMD, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_startcmd CMD continue unit=%02x cmd %02x iocla %06x cnt %04x\n",
|
||||
unit, cmd, chp->chan_caw, chp->ccw_count);
|
||||
@@ -1017,11 +991,9 @@ t_stat disk_startcmd(UNIT *uptr, uint16 chan, uint8 cmd)
|
||||
uptr->SNS &= ~SNS_CMDREJ; /* not rejected yet */
|
||||
uptr->CMD |= DSK_INCH2; /* use 0xF0 for inch, just need int */
|
||||
#ifdef FAST_FOR_UTX
|
||||
// sim_activate(uptr, 40); /* start things off */
|
||||
sim_activate(uptr, 30); /* start things off */
|
||||
#else
|
||||
sim_activate(uptr, 250); /* start things off */
|
||||
// sim_activate(uptr, 500); /* start things off */
|
||||
#endif
|
||||
return SCPE_OK; /* good to go */
|
||||
break;
|
||||
@@ -1061,22 +1033,13 @@ t_stat disk_startcmd(UNIT *uptr, uint16 chan, uint8 cmd)
|
||||
"disk_startcmd starting disk cmd %02x chsa %04x\n",
|
||||
cmd, chsa);
|
||||
#ifdef FAST_FOR_UTX
|
||||
// sim_activate(uptr, 40); /* start things off */
|
||||
/* when value was 50, UTX would get a spontainous interrupt */
|
||||
/* when value was 30, UTX would get a spontainous interrupt */
|
||||
/* when starting cron */
|
||||
/* changed to 25 from 30 121420 */
|
||||
//121420sim_activate(uptr, 30); /* start things off */
|
||||
#ifdef BAD_05142021
|
||||
sim_activate(uptr, 25); /* start things off */
|
||||
#else
|
||||
sim_activate(uptr, 20); /* start things off */
|
||||
/* when using 500, UTX gets "ioi: sio at 801 failed, cc3, retry=0" */
|
||||
// sim_activate(uptr, 50); /* start things off */
|
||||
// sim_activate(uptr, 500); /* start things off */
|
||||
#endif
|
||||
#else
|
||||
// sim_activate(uptr, 250); /* start things off */
|
||||
sim_activate(uptr, 500); /* start things off */
|
||||
#endif
|
||||
return SCPE_OK; /* good to go */
|
||||
@@ -1097,7 +1060,6 @@ t_stat disk_haltio(UNIT *uptr) {
|
||||
int cmd = uptr->CMD & DSK_CMDMSK;
|
||||
CHANP *chp = find_chanp_ptr(chsa); /* find the chanp pointer */
|
||||
|
||||
// sim_debug(DEBUG_EXP, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_haltio enter chsa %04x cmd = %02x\n", chsa, cmd);
|
||||
|
||||
@@ -1148,7 +1110,6 @@ t_stat disk_srv(UNIT *uptr)
|
||||
uint8 buf2[1024];
|
||||
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
// sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_srv entry unit %02x CMD %08x chsa %04x count %04x %x/%x/%x \n",
|
||||
unit, uptr->CMD, chsa, chp->ccw_count,
|
||||
STAR2CYL(uptr->CHS), (uptr->CHS >> 8)&0xff, (uptr->CHS&0xff));
|
||||
@@ -1161,7 +1122,6 @@ t_stat disk_srv(UNIT *uptr)
|
||||
}
|
||||
}
|
||||
|
||||
// sim_debug(DEBUG_CMD, dptr,
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_srv cmd=%02x chsa %04x count %04x\n", cmd, chsa, chp->ccw_count);
|
||||
|
||||
@@ -1543,7 +1503,6 @@ iha_error:
|
||||
/* we have already seeked to the required sector */
|
||||
/* we do not need to seek again, so move on */
|
||||
chan_end(chsa, SNS_DEVEND|SNS_CHNEND);
|
||||
// return SCPE_OK;
|
||||
break;
|
||||
} else {
|
||||
/* we have wasted enough time, we are there */
|
||||
@@ -1552,12 +1511,9 @@ iha_error:
|
||||
unit, uptr->STAR >> 16, uptr->CHS >> 16);
|
||||
uptr->CHS = uptr->STAR; /* we are there */
|
||||
#ifdef FAST_FOR_UTX
|
||||
// sim_activate(uptr, 25); /* start things off */
|
||||
// sim_activate(uptr, 20); /* start things off */
|
||||
sim_activate(uptr, 15); /* start things off */
|
||||
#else
|
||||
sim_activate(uptr, 150); /* start things off */
|
||||
// sim_activate(uptr, 300); /* start things off */
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1691,11 +1647,8 @@ iha_error:
|
||||
"disk_srv seeking unit=%02x to %04x/%02x/%02x from cyl %04x (%04x)\n",
|
||||
unit, cyl, trk, buf[3], tcyl, diff);
|
||||
#ifdef FAST_FOR_UTX
|
||||
// sim_activate(uptr, 20); /* start us off */
|
||||
// sim_activate(uptr, 25); /* start things off */
|
||||
sim_activate(uptr, 15); /* start things off */
|
||||
#else
|
||||
// sim_activate(uptr, 200+diff); /* start us off */
|
||||
sim_activate(uptr, 400+diff); /* start us off */
|
||||
#endif
|
||||
} else {
|
||||
@@ -1831,8 +1784,6 @@ iha_error:
|
||||
|
||||
case DSK_FNSK: /* 0x0B Format for no skip */
|
||||
/* buffer must be on halfword boundry if not STATUS_PCHK and SNS_CMDREJ status */
|
||||
// chp->chan_status |= STATUS_PCHK; /* program check for invalid cmd */
|
||||
// uptr->SNS |= SNS_CMDREJ; /* cmd rejected */
|
||||
/* byte count can not exceed 20160 for the track */
|
||||
uptr->CMD &= LMASK; /* remove old status bits & cmd */
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
@@ -1962,14 +1913,6 @@ if ((chp->ccw_addr == 0x3cde0) && (buf[0] == 0x4a)) {
|
||||
sim_debug(DEBUG_CMD, dptr, "disk_srv READ buf %s\n", bufp);
|
||||
}
|
||||
#endif
|
||||
#if 0
|
||||
sim_debug(DEBUG_DETAIL, dptr,
|
||||
"disk_srv READ data %02x%02x%02x%02x %02x%02x%02x%02x "
|
||||
"%02x%02x%02x%02x %02x%02x%02x%02x\n",
|
||||
buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7],
|
||||
buf[8], buf[9], buf[10], buf[11], buf[12], buf[13], buf[14], buf[15]);
|
||||
#endif
|
||||
|
||||
uptr->CHS++; /* next sector number */
|
||||
/* process the next sector of data */
|
||||
for (i=0; i<len; i++) {
|
||||
@@ -2072,17 +2015,8 @@ if ((chp->ccw_addr == 0x3cde0) && (buf[0] == 0x4a)) {
|
||||
"DISK sector read complete, %x bytes to go from diskfile %04x/%02x/%02x\n",
|
||||
chp->ccw_count, STAR2CYL(uptr->CHS), ((uptr->CHS) >> 8)&0xff, (uptr->CHS&0xff));
|
||||
#ifdef FAST_FOR_UTX
|
||||
// sim_activate(uptr, 25); /* start things off */
|
||||
// sim_activate(uptr, 20); /* start things off */
|
||||
#ifdef BAD_05142021
|
||||
sim_activate(uptr, 15); /* start things off */
|
||||
#else
|
||||
// sim_activate(uptr, 10); /* start things off */
|
||||
// sim_activate(uptr, 50); /* start things off */
|
||||
sim_activate(uptr, 10); /* start things off */
|
||||
#endif
|
||||
#else
|
||||
// sim_activate(uptr, 150); /* wait to read next sector */
|
||||
sim_activate(uptr, 300); /* wait to read next sector */
|
||||
#endif
|
||||
break;
|
||||
@@ -2291,11 +2225,8 @@ if ((chp->ccw_addr == 0x3cde0) && (buf[0] == 0x4a)) {
|
||||
}
|
||||
|
||||
#ifdef FAST_FOR_UTX
|
||||
// sim_activate(uptr, 25); /* start things off */
|
||||
// sim_activate(uptr, 20); /* start things off */
|
||||
sim_activate(uptr, 15); /* start things off */
|
||||
#else
|
||||
// sim_activate(uptr, 150); /* wait to read next sector */
|
||||
sim_activate(uptr, 300); /* wait to read next sector */
|
||||
#endif
|
||||
break;
|
||||
@@ -2783,11 +2714,7 @@ int disk_label(UNIT *uptr) {
|
||||
int32 daddr = (CYL(type)-4) * SPC(type) + (HDS(type)-2) * SPT(type);
|
||||
/* get sector address of utx flaw map sec 1 pointer */
|
||||
/* use this address for sec 1 label pointer */
|
||||
#ifndef NOT_NEEDED_0128
|
||||
int32 uaddr = (CYL(type)-4) * SPC(type) + (HDS(type)-4) * SPT(type);
|
||||
#else
|
||||
int32 uaddr = (CYL(type)-4) * SPC(type) + (HDS(type)-3) * SPT(type);
|
||||
#endif
|
||||
|
||||
/* write 30 byte track labels for all tracks on disk */
|
||||
/* tot_tracks entries will be created starting at end of disk */
|
||||
@@ -2864,7 +2791,6 @@ int disk_label(UNIT *uptr) {
|
||||
}
|
||||
/* if this is removed, utx is unable to create newfs */
|
||||
/* get preposterous size 0 error message */
|
||||
#ifndef XXXX_121720
|
||||
/* maybe not needed, but left anyway */
|
||||
/* uaddr has umap value for track zero label */
|
||||
if (CHS == 0) { /* only write dmap address in trk 0 */
|
||||
@@ -2874,7 +2800,6 @@ int disk_label(UNIT *uptr) {
|
||||
label[18] = (uaddr >> 8) & 0xff;
|
||||
label[19] = (uaddr) & 0xff;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* the tech doc shows the cyl/trk/sec data is in the first 4 bytes */
|
||||
/* of the track label, BUT it is really in the configuration data */
|
||||
@@ -2939,22 +2864,6 @@ int disk_label(UNIT *uptr) {
|
||||
label[14] = 0;
|
||||
label[15] = 0;
|
||||
|
||||
/* if this is written, UTX will not be able to do a newfs */
|
||||
/* gets preposterous size 0 error */
|
||||
#ifdef XXXX_121720
|
||||
/* uaddr has umap value for sector one label */
|
||||
if (CHS == 1) { /* only write dmap address in trk 0 */
|
||||
/* output last sector address of disk */
|
||||
label[12] = (uaddr >> 24) & 0xff; /* lumapp UMAP pointer */
|
||||
label[13] = (uaddr >> 16) & 0xff;
|
||||
label[14] = (uaddr >> 8) & 0xff;
|
||||
label[15] = (uaddr) & 0xff;
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
"disk_format WSL uaddr star %02x %02x %02x %02x\n",
|
||||
label[12], label[13], label[14], label[15]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* the tech doc shows the cyl/trk/sec data is in the first 4 bytes */
|
||||
/* of the track label, BUT it is really in the configuration data */
|
||||
/* area too. Byte 27 is sectors/track and byte 28 is number of heads. */
|
||||
@@ -3000,10 +2909,8 @@ int disk_format(UNIT *uptr) {
|
||||
/* last sector address of disk (cyl * hds * spt) - 1 */
|
||||
uint32 laddr = CAP(type) - 1; /* last sector of disk */
|
||||
|
||||
#ifndef NOT_NEEDED_0128
|
||||
/* last track address of disk (cyl * hds * spt) - spt */
|
||||
uint32 ltaddr = CAP(type)-SPT(type); /* last track of disk */
|
||||
#endif
|
||||
|
||||
/* get sector address of vendor defect table VDT */
|
||||
/* put data = 0xf0000000 0xf4000000 */
|
||||
@@ -3014,19 +2921,13 @@ int disk_format(UNIT *uptr) {
|
||||
/* 0x9a000000 + (cyl-1), 0xf4000000 */
|
||||
int32 daddr = (CYL(type)-4) * SPC(type) + (HDS(type)-2) * SPT(type);
|
||||
|
||||
#ifndef NOT_NEEDED_0128
|
||||
/* get sector address of utx flaw data (1 track long) */
|
||||
/* set trace data to zero */
|
||||
int32 faddr = (CYL(type)-4) * SPC(type) + (HDS(type)-3) * SPT(type);
|
||||
#endif
|
||||
|
||||
/* get sector address of utx flaw map sec 1 pointer */
|
||||
/* use this address for sec 1 label pointer */
|
||||
#ifndef NOT_NEEDED_0128
|
||||
int32 uaddr = (CYL(type)-4) * SPC(type) + (HDS(type)-4) * SPT(type);
|
||||
#else
|
||||
int32 uaddr = (CYL(type)-4) * SPC(type) + (HDS(type)-3) * SPT(type);
|
||||
#endif
|
||||
|
||||
/* vendor flaw map in vaddr */
|
||||
uint32 vmap[2] = {0xf0000004, 0xf4000000};
|
||||
@@ -3035,18 +2936,15 @@ int disk_format(UNIT *uptr) {
|
||||
uint32 dmap[4] = {0xf0000000 | (cap-1), 0x8a000000 | daddr,
|
||||
0x9a000000 | (cap-1), 0xf4000000};
|
||||
|
||||
#ifndef NOT_NEEDED_0128
|
||||
/* utx flaw map */
|
||||
uint32 fmap[4] = {0xf0000000 | (cap-1), 0x8a000000 | daddr,
|
||||
0x9a000000 | ltaddr, 0xf4000000};
|
||||
#endif
|
||||
|
||||
/* see if -i or -n specified on attach command */
|
||||
if (!(sim_switches & SWMASK('N')) && !(sim_switches & SWMASK('I'))) {
|
||||
sim_switches = 0; /* simh tests 'N' & 'Y' switches */
|
||||
/* see if user wants to initialize the disk */
|
||||
if (!get_yn("Initialize disk? [Y] ", TRUE)) {
|
||||
// printf("disk_format init question is false\r\n");
|
||||
sim_switches = oldsw;
|
||||
return 1;
|
||||
}
|
||||
@@ -3055,7 +2953,6 @@ int disk_format(UNIT *uptr) {
|
||||
|
||||
/* VDT 249264 (819/18/0) 0x3cdb0 for 9346 - 823/19/16 vaddr */
|
||||
/* MDT 249248 (819/17/0) 0x3cda0 for 9346 - 823/19/16 daddr */
|
||||
// /* UMAP 249232 (819/16/0) 0x3cd90 for 9346 - 823/19/16 uaddr */
|
||||
/* UMAP 249216 (819/15/0) 0x3cd80 for 9346 - 823/19/16 uaddr */
|
||||
|
||||
/* seek to sector 0 */
|
||||
@@ -3100,12 +2997,10 @@ int disk_format(UNIT *uptr) {
|
||||
((dmap[i] & 0xff0000) >> 8) | ((dmap[i] >> 24) & 0xff));
|
||||
}
|
||||
|
||||
#ifndef NOT_USED_0128
|
||||
for (i=0; i<4; i++) {
|
||||
fmap[i] = (((fmap[i] & 0xff) << 24) | ((fmap[i] & 0xff00) << 8) |
|
||||
((fmap[i] & 0xff0000) >> 8) | ((fmap[i] >> 24) & 0xff));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* now seek to end of disk and write the dmap data */
|
||||
/* setup dmap pointed to by track label 0 wd[3] = (cyl-4) * spt + (spt - 1) */
|
||||
@@ -3152,7 +3047,6 @@ int disk_format(UNIT *uptr) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifndef NOT_NEEDED_0128
|
||||
/* write dummy UTX DMAP to faddr */
|
||||
if ((sim_fseek(uptr->fileref, faddr*ssize, SEEK_SET)) != 0) { /* seek DMAP */
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
@@ -3166,7 +3060,6 @@ int disk_format(UNIT *uptr) {
|
||||
faddr, faddr*ssize);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("Disk %s has %x (%d) cyl, %x (%d) hds, %x (%d) sec\r\n",
|
||||
disk_type[type].name, CYL(type), CYL(type), HDS(type), HDS(type),
|
||||
@@ -3176,10 +3069,8 @@ int disk_format(UNIT *uptr) {
|
||||
printf("writing to dmap sec %x (%d) %x (%d) dmap to %x (%d) %x (%d)\r\n",
|
||||
cap-1, cap-1, (cap-1)*ssize, (cap-1)*ssize,
|
||||
daddr, daddr, daddr*ssize, daddr*ssize);
|
||||
#ifndef NOT_NEEDED_0128
|
||||
printf("writing to fmap sec %x (%d) bytes %x (%d)\r\n",
|
||||
faddr, faddr, (faddr)*ssize, (faddr)*ssize);
|
||||
#endif
|
||||
printf("writing to umap sec %x (%d) bytes %x (%d)\r\n",
|
||||
uaddr, uaddr, (uaddr)*ssize, (uaddr)*ssize);
|
||||
|
||||
|
||||
635
SEL32/sel32_ec.c
635
SEL32/sel32_ec.c
File diff suppressed because it is too large
Load Diff
122
SEL32/sel32_mt.c
122
SEL32/sel32_mt.c
@@ -39,7 +39,6 @@
|
||||
#include "sel32_defs.h"
|
||||
#include "sim_tape.h"
|
||||
|
||||
//#define SLOW
|
||||
#if NUM_DEVS_MT > 0
|
||||
|
||||
#define BUFFSIZE (64 * 1024)
|
||||
@@ -310,7 +309,6 @@ DIB mta_dib = {
|
||||
NULL, /* t_stat (*test_io)(UNIT *uptr) */ /* Test I/O */
|
||||
NULL, /* t_stat (*rsctl_io)(UNIT *uptr) */ /* Reset Controller */
|
||||
mt_rschnlio, /* t_stat (*rschnl_io)(UNIT *uptr) */ /* Reset Channel */
|
||||
/// mt_iocl, /* t_stat (*iocl_io)(CHANP *chp, int32 tic_ok)) */ /* Process IOCL */
|
||||
NULL, /* t_stat (*iocl_io)(CHANP *chp, int32 tic_ok)) */ /* Process IOCL */
|
||||
mt_ini, /* void (*dev_ini)(UNIT *, t_bool) */ /* init function */
|
||||
mta_unit, /* UNIT* units */ /* Pointer to units structure */
|
||||
@@ -330,7 +328,6 @@ DEVICE mta_dev = {
|
||||
NULL, NULL, &mt_reset, &mt_boot, &mt_attach, &mt_detach,
|
||||
/* ctxt is the DIB pointer */
|
||||
&mta_dib, DEV_BUF_NUM(0)|DEV_DIS|DEV_DISABLE|DEV_DEBUG|DEV_TAPE, 0, dev_debug,
|
||||
// &mta_dib, DEV_BUF_NUM(0)|DEV_DISABLE|DEV_DEBUG|DEV_TAPE, 0, dev_debug,
|
||||
NULL, NULL, &mt_help, NULL, NULL, &mt_description
|
||||
|
||||
};
|
||||
@@ -359,7 +356,6 @@ DIB mtb_dib = {
|
||||
NULL, /* t_stat (*test_io)(UNIT *uptr) */ /* Test I/O */
|
||||
NULL, /* t_stat (*rsctl_io)(UNIT *uptr) */ /* Reset Controller */
|
||||
mt_rschnlio, /* t_stat (*rschnl_io)(UNIT *uptr) */ /* Reset Channel */
|
||||
/// mt_iocl, /* t_stat (*iocl_io)(CHANP *chp, int32 tic_ok)) */ /* Process IOCL */
|
||||
NULL, /* t_stat (*iocl_io)(CHANP *chp, int32 tic_ok)) */ /* Process IOCL */
|
||||
mt_ini, /* void (*dev_ini)(UNIT *, t_bool) */ /* init function */
|
||||
mtb_unit, /* UNIT* units */ /* Pointer to units structure */
|
||||
@@ -378,7 +374,6 @@ DEVICE mtb_dev = {
|
||||
NUM_UNITS_MT, 8, 15, 1, 8, 8,
|
||||
NULL, NULL, &mt_reset, &mt_boot, &mt_attach, &mt_detach,
|
||||
&mtb_dib, DEV_BUF_NUM(0)|DEV_DIS|DEV_DISABLE|DEV_DEBUG|DEV_TAPE, 0, dev_debug,
|
||||
// &mtb_dib, DEV_BUF_NUM(1)|DEV_DISABLE|DEV_DEBUG|DEV_TAPE, 0, dev_debug
|
||||
NULL, NULL, &mt_help, NULL, NULL, &mt_description
|
||||
};
|
||||
#endif
|
||||
@@ -494,7 +489,6 @@ loop:
|
||||
/* 1st command can not be a TIC */
|
||||
if (chp->ccw_cmd == CMD_TIC) {
|
||||
chp->chan_status |= STATUS_PCHK; /* program check for invalid tic */
|
||||
//??// uptr->SNS |= SNS_CMDREJ; /* cmd rejected status */
|
||||
sim_debug(DEBUG_EXP, dptr,
|
||||
"mt_iocl TIC bad cmd chan_status[%04x] %04x\n",
|
||||
chan, chp->chan_status);
|
||||
@@ -524,7 +518,6 @@ loop:
|
||||
}
|
||||
chp->chan_caw = word1 & MASK24; /* get new IOCD address */
|
||||
chp->chan_status |= STATUS_PCHK; /* program check for invalid tic */
|
||||
//??// uptr->SNS |= SNS_CMDREJ; /* cmd rejected status */
|
||||
sim_debug(DEBUG_EXP, dptr,
|
||||
"mt_iocl TIC ERROR chan_status[%04x] %04x\n", chan, chp->chan_status);
|
||||
return 1; /* error return */
|
||||
@@ -546,7 +539,6 @@ loop:
|
||||
}
|
||||
|
||||
/* Set up for this command */
|
||||
//??//chp->ccw_flags = (word2 >> 16) & 0xf800; /* get flags from bits 0-4 of WD 2 of IOCD */
|
||||
chp->ccw_flags = (word2 >> 16) & 0xfc00; /* get flags from bits 0-4 of WD 2 of IOCD */
|
||||
chp->chan_status = 0; /* clear status for next IOCD */
|
||||
/* make a 24 bit address */
|
||||
@@ -756,7 +748,6 @@ t_stat mt_startcmd(UNIT *uptr, uint16 chan, uint8 cmd)
|
||||
mt_busy[GET_DEV_BUF(dptr->flags)] = 1; /* show we are busy */
|
||||
sim_debug(DEBUG_EXP, dptr, "mt_startcmd sense %08x return OK chan %04x cmd %02x\n",
|
||||
uptr->SNS, chan, cmd);
|
||||
//5 sim_activate(uptr, 100); /* Start unit off */
|
||||
sim_activate(uptr, 20); /* Start unit off */
|
||||
return SCPE_OK; /* good to go */
|
||||
|
||||
@@ -811,7 +802,6 @@ t_stat mt_error(UNIT *uptr, uint16 chsa, t_stat r, DEVICE *dptr)
|
||||
case MTSE_BOT: /* beginning of tape */
|
||||
uptr->SNS |= SNS_LOAD; /* tape at BOT */
|
||||
sim_debug(DEBUG_CMD, dptr, "BOT\n");
|
||||
//77 chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* we are done with command */
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
break;
|
||||
|
||||
@@ -950,8 +940,6 @@ t_stat mt_srv(UNIT *uptr)
|
||||
|
||||
case MT_SETM: /* 0x83 */ /* set mode byte */
|
||||
sim_debug(DEBUG_CMD, dptr, "mt_srv cmd 0x83 SETM unit=%02x\n", unit);
|
||||
/*DYNAMIC DEBUG*/
|
||||
//cpu_dev.dctrl |= DEBUG_INST; /* start instruction trace */
|
||||
/* Grab data until channel has no more */
|
||||
if (chan_read_byte(chsa, &ch)) {
|
||||
if (uptr->POS > 0) { /* Only if data in record */
|
||||
@@ -971,7 +959,6 @@ t_stat mt_srv(UNIT *uptr)
|
||||
sim_debug(DEBUG_CMD, dptr, "Write mode data in unit %02x POS %04x mode %02x\n",
|
||||
unit, uptr->POS, ch);
|
||||
uptr->hwmark = uptr->POS; /* set high water mark */
|
||||
//5 sim_activate(uptr, 40); /* wait time */
|
||||
sim_activate(uptr, 30); /* wait time */
|
||||
}
|
||||
return SCPE_OK;
|
||||
@@ -993,12 +980,7 @@ t_stat mt_srv(UNIT *uptr)
|
||||
|
||||
switch (cmd) {
|
||||
case MT_READ: /* 0x02 */ /* read a record from the device */
|
||||
// sim_debug(DEBUG_DETAIL,
|
||||
// dptr, "mt_srv cmd(2)READ unit %02x bufnum %x hwmark %03x\n",
|
||||
// unit, bufnum, uptr->hwmark);
|
||||
#ifndef SLOW
|
||||
reread:
|
||||
#endif
|
||||
if (uptr->CMD & MT_READDONE) { /* is the read complete */
|
||||
uptr->SNS &= ~(SNS_LOAD|SNS_EOT); /* reset BOT & EOT */
|
||||
if (sim_tape_eot(uptr)) { /* see if at EOM */
|
||||
@@ -1046,14 +1028,6 @@ reread:
|
||||
sim_debug(DEBUG_CMD, dptr, "mt_srv READ mem %s\n", bufp);
|
||||
bufp = dump_mem(m+32, 16);
|
||||
sim_debug(DEBUG_CMD, dptr, "mt_srv READ mem %s\n", bufp);
|
||||
|
||||
/*DYNAMIC DEBUG*/
|
||||
/* J */
|
||||
//if ((chp->ccw_addr == 0x54e00) && (mt_buffer[0][0] == 0x4a))
|
||||
//cpu_dev.dctrl |= DEBUG_INST; /* start instruction trace */
|
||||
|
||||
//if ((chp->ccw_addr == 0x7f96c0) && (mt_buffer[0][0] == 0x80))
|
||||
//cpu_dev.dctrl |= DEBUG_INST; /* start instruction trace */
|
||||
}
|
||||
/* get a char from the buffer */
|
||||
ch = mt_buffer[bufnum][uptr->POS++];
|
||||
@@ -1067,9 +1041,7 @@ reread:
|
||||
/* Send dummy character to force SLI */
|
||||
chan_write_byte(chsa, &ch); /* write the byte */
|
||||
sim_debug(DEBUG_CMD, dptr, "Read unit %02x send dump SLI\n", unit);
|
||||
//5 sim_activate(uptr, (uptr->hwmark-uptr->POS) * 10); /* wait again */
|
||||
sim_activate(uptr, (uptr->hwmark-uptr->POS) * 4); /* wait again */
|
||||
//77 sim_activate(uptr, 50);
|
||||
uptr->CMD |= MT_READDONE; /* read is done */
|
||||
break;
|
||||
}
|
||||
@@ -1095,17 +1067,9 @@ reread:
|
||||
"Read end of data unit %02x cnt %04x ch %02x hwm %04x\n",
|
||||
unit, uptr->POS, ch, uptr->hwmark);
|
||||
uptr->CMD |= MT_READDONE; /* read is done */
|
||||
#ifdef SLOW
|
||||
//5 sim_activate(uptr, 40); /* wait again */
|
||||
sim_activate(uptr, 30); /* wait again */
|
||||
} else
|
||||
//5 sim_activate(uptr, 40); /* wait again */
|
||||
sim_activate(uptr, 30); /* wait again */
|
||||
#else
|
||||
goto reread;
|
||||
} else
|
||||
goto reread;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1120,9 +1084,7 @@ reread:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef SLOW
|
||||
rewrite:
|
||||
#endif
|
||||
/* Grab data until channel has no more */
|
||||
if (chan_read_byte(chsa, &ch)) {
|
||||
if (uptr->POS > 0) { /* Only if data in record */
|
||||
@@ -1139,14 +1101,8 @@ rewrite:
|
||||
sim_debug(DEBUG_DATA, dptr, "Write data unit=%02x %04x %02x\n",
|
||||
unit, uptr->POS, ch);
|
||||
uptr->hwmark = uptr->POS;
|
||||
#ifndef SLOW
|
||||
goto rewrite;
|
||||
#endif
|
||||
}
|
||||
//#ifdef SLOW
|
||||
//5 sim_activate(uptr, 40);
|
||||
// sim_activate(uptr, 30); /* wait again */
|
||||
//#endif
|
||||
break;
|
||||
|
||||
case MT_RDBK: /* 0x0C */ /* Read Backwards */
|
||||
@@ -1182,7 +1138,6 @@ rewrite:
|
||||
unit, uptr->POS);
|
||||
/* If not read whole record, skip till end */
|
||||
if (uptr->POS >= 0) {
|
||||
//5 sim_activate(uptr, (uptr->POS) * 20);
|
||||
sim_activate(uptr, (uptr->POS) * 10);
|
||||
uptr->CMD |= MT_READDONE;
|
||||
return SCPE_OK;
|
||||
@@ -1198,7 +1153,6 @@ rewrite:
|
||||
mt_busy[bufnum] &= ~1;
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
} else
|
||||
//5 sim_activate(uptr, 40);
|
||||
sim_activate(uptr, 30);
|
||||
}
|
||||
break;
|
||||
@@ -1213,7 +1167,6 @@ rewrite:
|
||||
return SCPE_OK;
|
||||
}
|
||||
uptr->POS ++;
|
||||
//5 sim_activate(uptr, 500);
|
||||
sim_activate(uptr, 100);
|
||||
} else {
|
||||
sim_debug(DEBUG_CMD, dptr, "Write Mark unit=%02x\n", unit);
|
||||
@@ -1225,7 +1178,6 @@ rewrite:
|
||||
break;
|
||||
|
||||
case MT_BSR: /* 0x53 */ /* Backspace record */
|
||||
//77 chp->ccw_count = 0; /* zero the count */
|
||||
sim_debug(DEBUG_CMD, dptr, "mt_srv cmd 0x53 BSR unit %02x POS %x SNS %08x\n",
|
||||
unit, uptr->POS, uptr->SNS);
|
||||
switch (uptr->POS ) {
|
||||
@@ -1237,14 +1189,10 @@ rewrite:
|
||||
return SCPE_OK;
|
||||
}
|
||||
uptr->POS++;
|
||||
//5 sim_activate(uptr, 500);
|
||||
sim_activate(uptr, 30);
|
||||
break;
|
||||
case 1:
|
||||
//66 skip = 1; /* skip back 1 record */
|
||||
uptr->POS++;
|
||||
//77 uptr->SNS &= ~(SNS_LOAD|SNS_EOT|SNS_FMRKDT); /* reset BOT, EOT, EOF */
|
||||
//66 r = sim_tape_sprecsr(uptr, skip, &reclen);
|
||||
r = sim_tape_sprecr(uptr, &reclen);
|
||||
sim_debug(DEBUG_CMD, dptr, "Backspace rec unit %02x POS %x r %x\n",
|
||||
unit, uptr->POS, r);
|
||||
@@ -1252,17 +1200,14 @@ rewrite:
|
||||
if (r == MTSE_TMK) { /* test for EOF */
|
||||
uptr->POS++;
|
||||
sim_debug(DEBUG_CMD, dptr, "BSR got EOF MARK\n");
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
/* SEL requires Unit Except & BOT on BOT */
|
||||
} else if (r == MTSE_BOT) {
|
||||
uptr->POS+= 2;
|
||||
sim_debug(DEBUG_CMD, dptr, "BSR got BOT\n");
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else {
|
||||
sim_debug(DEBUG_CMD, dptr, "Backspace reclen %04x SNS %08x\n", reclen, uptr->SNS);
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
}
|
||||
break;
|
||||
@@ -1290,7 +1235,6 @@ rewrite:
|
||||
break;
|
||||
|
||||
case MT_BSF: /* 0x73 */ /* Backspace file */
|
||||
//77 chp->ccw_count = 0; /* zero the count */
|
||||
sim_debug(DEBUG_CMD, dptr, "mt_srv cmd 0x73 BSF unit %02x POS %04x\n",
|
||||
unit, uptr->POS);
|
||||
switch(uptr->POS) {
|
||||
@@ -1302,7 +1246,6 @@ rewrite:
|
||||
break;
|
||||
}
|
||||
uptr->POS++;
|
||||
//5 sim_activate(uptr, 500);
|
||||
sim_activate(uptr, 100);
|
||||
break;
|
||||
case 1:
|
||||
@@ -1313,7 +1256,6 @@ rewrite:
|
||||
uptr->SNS &= ~(SNS_LOAD|SNS_EOT|SNS_FMRKDT); /* reset BOT, EOT, EOF */
|
||||
#ifdef NBSF
|
||||
/* using the backspace file call does not work with MPX */
|
||||
//77?? r = sim_tape_spfiler(uptr, skip, &reclen);
|
||||
r = sim_tape_spfiler(uptr, skip, &reclen);
|
||||
uptr->POS++;
|
||||
#else
|
||||
@@ -1323,12 +1265,10 @@ rewrite:
|
||||
if (r == MTSE_TMK) {
|
||||
uptr->POS++;
|
||||
sim_debug(DEBUG_CMD, dptr, "BSF got EOF MARK\n");
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else if (r == MTSE_BOT) {
|
||||
uptr->POS+= 2;
|
||||
sim_debug(DEBUG_CMD, dptr, "BSF got BOT\n");
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else {
|
||||
/* already there */
|
||||
@@ -1344,8 +1284,6 @@ rewrite:
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr, "Backspace file Completed with NO EOF status\n");
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
//00 chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
//88 chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
break;
|
||||
#endif
|
||||
#ifdef NBSF
|
||||
@@ -1358,8 +1296,6 @@ rewrite:
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr, "Backspace file Completed with EOF status\n");
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
//00 chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
//88 chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
break;
|
||||
#ifdef NBSF
|
||||
case 4: /* BOT */
|
||||
@@ -1370,50 +1306,36 @@ rewrite:
|
||||
mt_busy[bufnum] &= ~1;
|
||||
uptr->SNS |= SNS_LOAD; /* set BOT detected */
|
||||
sim_debug(DEBUG_CMD, dptr, "Backspace file Completed with BOT status\n");
|
||||
#ifdef NBSF
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
//77?? chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
#else
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
//00 chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
//88 chan_end(chsa, SNS_CHNEND|SNS_DEVEND);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case MT_FSR: /* 0x43 */ /* Advance record */
|
||||
//77 chp->ccw_count = 0; /* zero the count */
|
||||
switch(uptr->POS) {
|
||||
case 0:
|
||||
sim_debug(DEBUG_CMD, dptr, "Skip rec entry unit=%02x POS %x\n", unit, uptr->POS);
|
||||
uptr->POS++;
|
||||
//5 sim_activate(uptr, 500);
|
||||
sim_activate(uptr, 30);
|
||||
break;
|
||||
case 1:
|
||||
//66 skip = 1; /* skip 1 record */
|
||||
uptr->POS++;
|
||||
uptr->SNS &= ~(SNS_LOAD|SNS_EOT|SNS_FMRKDT); /* reset BOT, EOT, EOF */
|
||||
//66 r = sim_tape_sprecsf(uptr, skip, &reclen);
|
||||
r = sim_tape_sprecf(uptr, &reclen);
|
||||
sim_debug(DEBUG_CMD, dptr, "Skip rec unit=%02x r %x\n", unit, r);
|
||||
if (r == MTSE_TMK) {
|
||||
uptr->POS = 3;
|
||||
uptr->SNS |= SNS_FMRKDT; /* file mark detected */
|
||||
sim_debug(DEBUG_CMD, dptr, "FSR got EOF MARK\n");
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else if (r == MTSE_EOM) {
|
||||
uptr->POS = 4;
|
||||
uptr->SNS |= SNS_EOT; /* set EOT status */
|
||||
sim_debug(DEBUG_CMD, dptr, "FSR got EOT\n");
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else {
|
||||
sim_debug(DEBUG_CMD, dptr, "FSR skipped %04x byte record\n",
|
||||
reclen);
|
||||
//5 sim_activate(uptr, 10 + (10 * reclen));
|
||||
sim_activate(uptr, 30);
|
||||
}
|
||||
break;
|
||||
@@ -1421,8 +1343,6 @@ rewrite:
|
||||
uptr->CMD &= ~(MT_CMDMSK);
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr, "Skip record Completed\n");
|
||||
/*DYNAMIC DEBUG*/
|
||||
//cpu_dev.dctrl |= DEBUG_INST; /* start instruction trace */
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* we are done dev|chan end */
|
||||
break;
|
||||
case 3:
|
||||
@@ -1430,51 +1350,42 @@ rewrite:
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr, "Skip record now at EOF\n");
|
||||
chan_end(chsa, SNS_DEVEND|SNS_UNITEXP);
|
||||
//77 chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
break;
|
||||
case 4:
|
||||
uptr->CMD &= ~(MT_CMDMSK);
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr, "Skip record now at EOT\n");
|
||||
chan_end(chsa, SNS_DEVEND|SNS_UNITEXP);
|
||||
//77 chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case MT_FSF: /* 0x63 */ /* advance filemark */
|
||||
//77 chp->ccw_count = 0; /* zero the count */
|
||||
switch(uptr->POS) {
|
||||
case 0:
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
"Skip file entry sense %08x unit %02x\n", uptr->SNS, unit);
|
||||
uptr->POS++;
|
||||
//5 sim_activate(uptr, 500);
|
||||
sim_activate(uptr, 30);
|
||||
break;
|
||||
case 1:
|
||||
skip = 1; /* skip forward 1 file */
|
||||
/*EE*/ uptr->POS++;
|
||||
uptr->POS++;
|
||||
uptr->SNS &= ~(SNS_LOAD|SNS_EOT|SNS_FMRKDT); /* reset BOT, EOT, EOF */
|
||||
//EE r = sim_tape_sprecf(uptr, &reclen);
|
||||
/*EE*/ r = sim_tape_spfilef(uptr, skip, &reclen);
|
||||
//77 r = sim_tape_spfilef(uptr, skip, &reclen);
|
||||
r = sim_tape_spfilef(uptr, skip, &reclen);
|
||||
sim_debug(DEBUG_CMD, dptr, "Skip file unit=%02x r %x\n", unit, r);
|
||||
if (r == MTSE_TMK) {
|
||||
uptr->POS++;
|
||||
uptr->SNS |= SNS_FMRKDT; /* file mark detected */
|
||||
sim_debug(DEBUG_CMD, dptr, "FSF EOF MARK sense %08x\n", uptr->SNS);
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else if (r == MTSE_EOM) {
|
||||
uptr->SNS |= SNS_EOT; /* set EOT status */
|
||||
sim_debug(DEBUG_CMD, dptr, "FSF EOT sense %08x\n", uptr->SNS);
|
||||
uptr->POS+= 2;
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
} else {
|
||||
sim_debug(DEBUG_CMD, dptr, "FSF skipped %04x file\n", reclen);
|
||||
//5 sim_activate(uptr, 50);
|
||||
sim_activate(uptr, 30);
|
||||
}
|
||||
break;
|
||||
@@ -1483,27 +1394,21 @@ rewrite:
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
"Skip file done sense %08x unit %02x\n", uptr->SNS, unit);
|
||||
//88 chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* we are done dev|chan end */
|
||||
//00 chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* we are done dev|chan end */
|
||||
//EE chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
/*EE*/ chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* we are done dev|chan end */
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND); /* we are done dev|chan end */
|
||||
break;
|
||||
/*EE*/ case 3:
|
||||
/*EE*/ uptr->CMD &= ~(MT_CMDMSK);
|
||||
/*EE*/ mt_busy[bufnum] &= ~1;
|
||||
/*EE*/ sim_debug(DEBUG_CMD, dptr,
|
||||
/*EE*/ "Skip file got EOF sense %08x unit %02x\n", uptr->SNS, unit);
|
||||
/*EE*/ chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
/*EE*/ break;
|
||||
//EE case 3:
|
||||
/*EE*/ case 4:
|
||||
case 3:
|
||||
uptr->CMD &= ~(MT_CMDMSK);
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
"Skip file got EOF sense %08x unit %02x\n", uptr->SNS, unit);
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
break;
|
||||
case 4:
|
||||
uptr->CMD &= ~(MT_CMDMSK);
|
||||
uptr->SNS |= SNS_EOT; /* set EOT status */
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr,
|
||||
"Skip file got EOT sense %08x unit %02x\n", uptr->SNS, unit);
|
||||
//88 chan_end(chsa, SNS_DEVEND|SNS_UNITEXP);
|
||||
//00 chan_end(chsa, SNS_DEVEND|SNS_UNITEXP);
|
||||
chan_end(chsa, SNS_CHNEND|SNS_DEVEND|SNS_UNITEXP);
|
||||
break;
|
||||
}
|
||||
@@ -1519,14 +1424,12 @@ rewrite:
|
||||
chan_end(chsa, SNS_DEVEND|SNS_UNITEXP);
|
||||
} else {
|
||||
uptr->POS ++;
|
||||
//5 sim_activate(uptr, 500);
|
||||
sim_activate(uptr, 50);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sim_debug(DEBUG_CMD, dptr, "Erase unit=%02x\n", unit);
|
||||
r = sim_tape_wrgap(uptr, 35);
|
||||
//5 sim_activate(uptr, 5000);
|
||||
sim_activate(uptr, 100);
|
||||
uptr->POS++;
|
||||
break;
|
||||
@@ -1544,8 +1447,6 @@ rewrite:
|
||||
uptr->POS++;
|
||||
sim_debug(DEBUG_CMD, dptr, "Start rewind unit %02x\n", unit);
|
||||
sim_activate(uptr, 2500);
|
||||
//5 sim_activate(uptr, 1500);
|
||||
//6 sim_activate(uptr, 150);
|
||||
} else {
|
||||
sim_debug(DEBUG_CMD, dptr, "Rewind complete unit %02x\n", unit);
|
||||
uptr->CMD &= ~(MT_CMDMSK);
|
||||
@@ -1561,7 +1462,6 @@ rewrite:
|
||||
uptr->POS++;
|
||||
mt_busy[bufnum] &= ~1;
|
||||
sim_debug(DEBUG_CMD, dptr, "Start rewind/unload unit %02x\n", unit);
|
||||
//5 sim_activate(uptr, 30000);
|
||||
sim_activate(uptr, 300);
|
||||
} else {
|
||||
sim_debug(DEBUG_CMD, dptr, "Unload unit=%02x\n", unit);
|
||||
|
||||
@@ -28,19 +28,48 @@
|
||||
# OpenBSD 6.7
|
||||
# NetBSD 9.1
|
||||
|
||||
# CHANGE HISTORY
|
||||
# 2021/4/8 avoid setting PATH in scripts for root
|
||||
# 2021/5/31 whereis used without -b in OpenBSD and NetBSD
|
||||
# Corrected: bridge create and fwdelay done twice for NetBSD
|
||||
# FreeBSD: tapX opened by userland program not by ifconfig
|
||||
# 2021/11/17 check for existance of br0 done too lousy. Done better.
|
||||
#
|
||||
|
||||
# uncomment next line if you need more than one tap = run multiple SIMHs...
|
||||
#OPSMODE="expert"
|
||||
# ... by editting the saved params file followed by rerun of this script
|
||||
|
||||
PATH="/bin:/sbin:/etc:/usr/sbin:/usr/bin"
|
||||
export PATH
|
||||
|
||||
OS=`uname -s`
|
||||
case $OS in
|
||||
"FreeBSD" | "OpenBSD" | "NetBSD")
|
||||
# List of Utils
|
||||
LOU="ifconfig brconfig sysctl chown netstat"
|
||||
|
||||
# set $util to path of util for all in $LOU
|
||||
for U in $LOU
|
||||
do
|
||||
# whereis -b in only FreeBSD as in Linux
|
||||
if test $OS = "FreeBSD"
|
||||
then
|
||||
eval ${U}="`whereis -b $U |
|
||||
awk '{ if($2 != "")
|
||||
print $2;
|
||||
else
|
||||
print "void";
|
||||
}'`"
|
||||
else
|
||||
eval ${U}="`whereis $U |
|
||||
awk '{ if($1 != "")
|
||||
print $1;
|
||||
else
|
||||
print "void";
|
||||
}'`"
|
||||
fi
|
||||
done
|
||||
|
||||
# make list of all interfaces ignoring lo
|
||||
AVL_IF=`ifconfig -a |
|
||||
AVL_IF=`$ifconfig -a |
|
||||
grep -v '^[ ]' |
|
||||
awk -F: '{ print $1 }' |
|
||||
grep -v 'lo' |
|
||||
@@ -61,41 +90,50 @@ case $OS in
|
||||
|
||||
;;
|
||||
"Linux")
|
||||
# List of Utils
|
||||
LOU="ip brctl tunctl netstat"
|
||||
|
||||
# set $util to path of util for all in $LOU
|
||||
for U in $LOU
|
||||
do
|
||||
eval ${U}="`whereis -b $U |
|
||||
awk '{ if($2 != "")
|
||||
print $2;
|
||||
else
|
||||
print "void";
|
||||
}'`"
|
||||
done
|
||||
|
||||
ERR=0
|
||||
# check brctl to exist
|
||||
L=`whereis brctl |
|
||||
awk -F: '{ print $2 }' |
|
||||
grep brctl |
|
||||
wc -l`
|
||||
if test $L -eq 0
|
||||
if test $brctl = "void"
|
||||
then
|
||||
echo 'No brctl program -- please install package bridge-utils'
|
||||
ERR=1
|
||||
fi
|
||||
|
||||
# check tunctl to exist
|
||||
LL=`whereis tunctl |
|
||||
awk -F: '{ print $2 }' |
|
||||
grep tunctl |
|
||||
wc -l`
|
||||
if test $LL -eq 0
|
||||
if test $tunctl = "void"
|
||||
then
|
||||
echo 'No tunctl program -- please install package uml-utilities'
|
||||
ERR=1
|
||||
fi
|
||||
|
||||
# quit when either not installed
|
||||
if test $L -eq 0 -o $LL -eq 0
|
||||
if test $ERR -eq 1
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# make list of all interfaces ignoring lo
|
||||
AVL_IF=`ip link show |
|
||||
AVL_IF=`$ip link show |
|
||||
grep '^[0-9]' |
|
||||
awk -F: '{ print $2 }' |
|
||||
grep -v 'lo' |
|
||||
sed '1,$s/^ //'`
|
||||
|
||||
# found br0 in active interfaces?
|
||||
L=`echo $AVL_IF | grep br0 | wc -l`
|
||||
L=`echo $AVL_IF | tr ' ' '\012' | grep '^br0$' | wc -l`
|
||||
if test $L -ne 0
|
||||
then
|
||||
echo "$0: br0 already configured."
|
||||
@@ -116,10 +154,10 @@ do
|
||||
N=`expr $N + 1`
|
||||
case $OS in
|
||||
"FreeBSD" | "OpenBSD" | "NetBSD")
|
||||
IPCMD="ifconfig $I "
|
||||
IPCMD="$ifconfig $I "
|
||||
;;
|
||||
"Linux")
|
||||
IPCMD="ip addr show $I "
|
||||
IPCMD="$ip addr show $I "
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -192,10 +230,10 @@ if test "x$IPNR" = "x"
|
||||
then
|
||||
case $OS in
|
||||
"FreeBSD" | "OpenBSD" | "NetBSD")
|
||||
IPCMD="ifconfig $ACT_IF "
|
||||
IPCMD="$ifconfig $ACT_IF "
|
||||
;;
|
||||
"Linux")
|
||||
IPCMD="ip addr show dev $ACT_IF "
|
||||
IPCMD="$ip addr show dev $ACT_IF "
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -219,11 +257,11 @@ if test "x$IPBRO" = "x"
|
||||
then
|
||||
case $OS in
|
||||
"FreeBSD" | "OpenBSD" | "NetBSD")
|
||||
IPCMD="ifconfig $ACT_IF "
|
||||
IPCMD="$ifconfig $ACT_IF "
|
||||
SEDBRO='1s/^.*broadcast //'
|
||||
;;
|
||||
"Linux")
|
||||
IPCMD="ip addr show dev $ACT_IF "
|
||||
IPCMD="$ip addr show dev $ACT_IF "
|
||||
SEDBRO='1s/^.*brd //'
|
||||
;;
|
||||
esac
|
||||
@@ -240,13 +278,13 @@ if test "x$DEFRT" = "x"
|
||||
then
|
||||
case $OS in
|
||||
"FreeBSD" | "OpenBSD" | "NetBSD")
|
||||
DEFRT=`netstat -rn |
|
||||
DEFRT=`$netstat -rn |
|
||||
grep $ACT_IF |
|
||||
grep 'default' |
|
||||
awk '{ print $2 }'`
|
||||
;;
|
||||
"Linux")
|
||||
DEFRT=`netstat -rn |
|
||||
DEFRT=`$netstat -rn |
|
||||
grep $ACT_IF |
|
||||
grep '^0\.' |
|
||||
uniq |
|
||||
@@ -340,8 +378,6 @@ cat - > $JOBFILE <<\EOF
|
||||
|
||||
# This script should be run under root permission
|
||||
|
||||
PATH="/bin:/sbin:/etc:/usr/sbin:/usr/bin"
|
||||
export PATH
|
||||
EOF
|
||||
|
||||
cat - > $TMPFILE <<\EOF
|
||||
@@ -357,30 +393,30 @@ EOF
|
||||
|
||||
case $OS in
|
||||
"Linux")
|
||||
echo "CMD=\"brctl addbr br0\"" >> $JOBFILE
|
||||
echo "CMD=\"$brctl addbr br0\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
N=0
|
||||
while test $N -lt $NrTaps
|
||||
do
|
||||
echo "CMD=\"tunctl -t tap${N} -u ${SimhUser}\"" >> $JOBFILE
|
||||
echo "CMD=\"$tunctl -t tap${N} -u ${SimhUser}\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
N=`expr $N + 1`
|
||||
done
|
||||
|
||||
echo "CMD=\"brctl addif br0 ${ACT_IF}\"" >> $JOBFILE
|
||||
echo "CMD=\"$brctl addif br0 ${ACT_IF}\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"brctl setfd br0 0\"" >> $JOBFILE
|
||||
echo "CMD=\"$brctl setfd br0 0\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ip link set ${ACT_IF} down\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip link set ${ACT_IF} down\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
if ! test "$IPNR" = "not configured"
|
||||
then
|
||||
echo "CMD=\"ip addr add ${IPNR} dev br0\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip addr add ${IPNR} dev br0\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
fi
|
||||
|
||||
@@ -388,23 +424,23 @@ case $OS in
|
||||
then
|
||||
## if test ! "x$DEFRT" = "x"
|
||||
## then
|
||||
## echo "CMD=\"ip route del default via ${DEFRT} dev ${ACT_IF}\"" >> $JOBFILE
|
||||
## echo "CMD=\"$ip route del default via ${DEFRT} dev ${ACT_IF}\"" >> $JOBFILE
|
||||
## cat $TMPFILE >> $JOBFILE
|
||||
## fi
|
||||
echo "CMD=\"ip addr del ${IPNR} dev ${ACT_IF}\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip addr del ${IPNR} dev ${ACT_IF}\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
fi
|
||||
|
||||
echo "CMD=\"ip link set ${ACT_IF} up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip link set ${ACT_IF} up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ip link set br0 up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip link set br0 up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
|
||||
if test ! "x$DEFRT" = "x"
|
||||
then
|
||||
echo "CMD=\"ip route add default via ${DEFRT} dev br0\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip route add default via ${DEFRT} dev br0\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
fi
|
||||
|
||||
@@ -418,10 +454,10 @@ case $OS in
|
||||
N=0
|
||||
while test $N -lt $NrTaps
|
||||
do
|
||||
echo "CMD=\"brctl addif br0 tap${N}\"" >> $JOBFILE
|
||||
echo "CMD=\"$brctl addif br0 tap${N}\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ip link set tap${N} up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ip link set tap${N} up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
N=`expr $N + 1`
|
||||
@@ -434,33 +470,30 @@ case $OS in
|
||||
N=0
|
||||
while test $N -lt $NrTaps
|
||||
do
|
||||
echo "CMD=\"ifconfig tap${N} create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig tap${N} up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig tap${N} create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
N=`expr $N + 1`
|
||||
done
|
||||
|
||||
echo "CMD=\"sysctl net.link.tap.up_on_open=1\"" >> $JOBFILE
|
||||
echo "CMD=\"$sysctl net.link.tap.up_on_open=1\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 create\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
case $NrTaps in
|
||||
1 )
|
||||
echo "CMD=\"ifconfig bridge0 addm ${ACT_IF} addm tap0\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 addm ${ACT_IF} addm tap0\"" >> $JOBFILE
|
||||
;;
|
||||
2 )
|
||||
echo "CMD=\"ifconfig bridge0 addm ${ACT_IF} addm tap0 addm tap1\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 addm ${ACT_IF} addm tap0 addm tap1\"" >> $JOBFILE
|
||||
;;
|
||||
3 )
|
||||
echo "CMD=\"ifconfig bridge0 addm ${ACT_IF} addm tap0 addm tap1 addm tap2\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 addm ${ACT_IF} addm tap0 addm tap1 addm tap2\"" >> $JOBFILE
|
||||
;;
|
||||
4 )
|
||||
echo "CMD=\"ifconfig bridge0 addm ${ACT_IF} addm tap0 addm tap1 addm tap2 addm tap3\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 addm ${ACT_IF} addm tap0 addm tap1 addm tap2 addm tap3\"" >> $JOBFILE
|
||||
;;
|
||||
* )
|
||||
echo "Sorry too many taps..."
|
||||
@@ -468,7 +501,7 @@ case $OS in
|
||||
esac
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
BRIDGE="bridge0"
|
||||
EXAMPLE="tap:tap0"
|
||||
@@ -477,33 +510,33 @@ case $OS in
|
||||
N=0
|
||||
while test $N -lt $NrTaps
|
||||
do
|
||||
echo "CMD=\"ifconfig tap${N} create\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig tap${N} create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig tap${N} up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig tap${N} up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
N=`expr $N + 1`
|
||||
done
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 create\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 fwddelay 4\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 fwddelay 4\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
case $NrTaps in
|
||||
1 )
|
||||
echo "CMD=\"ifconfig bridge0 add ${ACT_IF} add tap0\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 add ${ACT_IF} add tap0\"" >> $JOBFILE
|
||||
;;
|
||||
2 )
|
||||
echo "CMD=\"ifconfig bridge0 add ${ACT_IF} add tap0 add tap1\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 add ${ACT_IF} add tap0 add tap1\"" >> $JOBFILE
|
||||
;;
|
||||
3 )
|
||||
echo "CMD=\"ifconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2\"" >> $JOBFILE
|
||||
;;
|
||||
4 )
|
||||
echo "CMD=\"ifconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2 add tap3\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2 add tap3\"" >> $JOBFILE
|
||||
;;
|
||||
* )
|
||||
echo "Sorry too many taps..."
|
||||
@@ -511,7 +544,7 @@ case $OS in
|
||||
esac
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
BRIDGE="bridge0"
|
||||
EXAMPLE="tap:tap0"
|
||||
@@ -520,33 +553,33 @@ case $OS in
|
||||
N=0
|
||||
while test $N -lt $NrTaps
|
||||
do
|
||||
echo "CMD=\"ifconfig tap${N} create\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig tap${N} create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig tap${N} up\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig tap${N} up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
N=`expr $N + 1`
|
||||
done
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 create\"" >> $JOBFILE
|
||||
echo "CMD=\"$ifconfig bridge0 create\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"brconfig bridge0 fwddelay 1\"" >> $JOBFILE
|
||||
echo "CMD=\"$brconfig bridge0 fwddelay 1\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
case $NrTaps in
|
||||
1 )
|
||||
echo "CMD=\"brconfig bridge0 add ${ACT_IF} add tap0\"" >> $JOBFILE
|
||||
echo "CMD=\"$brconfig bridge0 add ${ACT_IF} add tap0\"" >> $JOBFILE
|
||||
;;
|
||||
2 )
|
||||
echo "CMD=\"brconfig bridge0 add ${ACT_IF} add tap0 add tap1\"" >> $JOBFILE
|
||||
echo "CMD=\"$brconfig bridge0 add ${ACT_IF} add tap0 add tap1\"" >> $JOBFILE
|
||||
;;
|
||||
3 )
|
||||
echo "CMD=\"brconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2\"" >> $JOBFILE
|
||||
echo "CMD=\"$brconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2\"" >> $JOBFILE
|
||||
;;
|
||||
4 )
|
||||
echo "CMD=\"brconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2 add tap3\"" >> $JOBFILE
|
||||
echo "CMD=\"$brconfig bridge0 add ${ACT_IF} add tap0 add tap1 add tap2 add tap3\"" >> $JOBFILE
|
||||
;;
|
||||
* )
|
||||
echo "Sorry too many taps..."
|
||||
@@ -554,11 +587,7 @@ case $OS in
|
||||
esac
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"brconfig bridge0 up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
echo "CMD=\"ifconfig bridge0 create\"" >> $JOBFILE
|
||||
echo "CMD=\"brconfig bridge0 fwddelay 1\"" >> $JOBFILE
|
||||
echo "CMD=\"$brconfig bridge0 up\"" >> $JOBFILE
|
||||
cat $TMPFILE >> $JOBFILE
|
||||
|
||||
BRIDGE="bridge0"
|
||||
|
||||
Reference in New Issue
Block a user