1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-13 23:35:30 +00:00

KA10: Updated ITS Quantum timer, cleanup compile errors.

This commit is contained in:
Richard Cornwell 2019-07-03 18:32:18 -04:00
parent 585e37288c
commit 12b503575a
7 changed files with 99 additions and 54 deletions

17
PDP10/diag_errors.txt Normal file
View File

@ -0,0 +1,17 @@
List of known errors in diagnostics:
DDTMB:
31456 - Unsure why this is failing. Bits 11-14 of MTS not clearing.
32506 - Not setting parity error on WTM.
32602 - need to fix density settings.
33766 - timing does not match.
33770 - " " "
34151 - Not setting bad tape flag.
36204 -
36216 -
36235 -
36312 -
36373 -
36400 -
36726 - not clearing data
37311 - Long EOR Not supported.

View File

@ -309,7 +309,7 @@ struct pmp_t
struct disk_t
{
char *name; /* Type Name */
const char *name; /* Type Name */
int cyl; /* Number of cylinders */
int heads; /* Number of heads/cylinder */
int bpt; /* Max bytes per track */
@ -327,7 +327,7 @@ disk_type[] =
{"2314", 203, 20, 7294, 6, 0x14}, /* 29.17 M */
{"3330", 411, 19, 13165, 24, 0x30}, /* 100.00 M */
{"3330-2",815, 19, 13165, 24, 0x30},
{NULL, 0}
{0},
};
@ -2251,7 +2251,7 @@ pmp_attach(UNIT * uptr, CONST char *file)
return r;
if (sim_fread(&hdr, 1, sizeof(struct pmp_header), uptr->fileref) !=
sizeof(struct pmp_header) || strncmp(&hdr.devid[0], "CKD_P370", 8) != 0 || flag) {
sizeof(struct pmp_header) || strncmp((CONST char *)&hdr.devid[0], "CKD_P370", 8) != 0 || flag) {
if (pmp_format(uptr, flag)) {
detach_unit(uptr);
return SCPE_FMT;

View File

@ -805,6 +805,52 @@ int opflags[] = {
#define QWAITS 0
#endif
#if ITS
/*
* Set quantum clock to qua_time.
*/
void
set_quantum()
{
sim_cancel(&cpu_unit[1]);
if ((qua_time & RSIGN) == 0) {
double us;
us = (double)(RSIGN - qua_time);
(void)sim_activate_after(&cpu_unit[1], us);
}
}
/*
* Update the qua_time variable.
*/
void
load_quantum()
{
if (sim_is_active(&cpu_unit[1])) {
double us;
us = sim_activate_time_usecs (&cpu_unit[1]);
qua_time = RSIGN - (uint32)us;
sim_cancel(&cpu_unit[1]);
}
}
/*
* Get the current quantum time.
*/
uint32
get_quantum()
{
uint32 t = 0;
if (sim_is_active(&cpu_unit[1])) {
double us;
us = sim_activate_time_usecs (&cpu_unit[1]);
t = RSIGN - (uint32)us;
}
return t;
}
#endif
/*
* Set device to interrupt on a given level 1-7
* Level 0 means that device interrupt is not enabled
@ -2577,8 +2623,7 @@ if ((reason = build_dev_tab ()) != SCPE_OK) /* build, chk dib_tab */
#if ITS
if (QITS) {
one_p_arm = 0;
sim_activate(&cpu_unit[1], 10000);
qua_time = 0;
set_quantum();
}
#endif
watch_stop = 0;
@ -2588,7 +2633,7 @@ if ((reason = build_dev_tab ()) != SCPE_OK) /* build, chk dib_tab */
if ((reason = sim_process_event()) != SCPE_OK) {/* error? stop sim */
#if ITS
if (QITS)
sim_cancel(&cpu_unit[1]);
load_quantum();
#endif
return reason;
}
@ -2733,15 +2778,7 @@ st_pi:
/* Check if possible idle loop */
if (sim_idle_enab && (FLAGS & USER) != 0 && PC < 020 && AB < 020 &&
(IR & 0760) == 0340) {
#if ITS
if (QITS)
sim_cancel(&cpu_unit[1]);
#endif
sim_idle (TMR_RTC, FALSE);
#if ITS
if (QITS)
sim_activate(&cpu_unit[1], 10000);
#endif
}
/* Update history */
@ -2989,7 +3026,7 @@ dpnorm:
/* Check if we need to round */
if (!nrf && ((MQ & SMASK) != 0) && (((AR & FPSBIT) == 0) ||
((AR & FPSBIT) != 0) && (MQ & 0377700000000LL) != 0)) {
(((AR & FPSBIT) != 0) && ((MQ & 0377700000000LL) != 0)))) {
AR++;
nrf = 1;
/* Clean things up if we overflowed */
@ -3328,7 +3365,7 @@ dpnorm:
AR = MQ = 0;
} else {
MQ = (AR << (36 - SC)) & FMASK /*- flag1*/ ;
AR = (AR >> SC) | FMASK & (((AR & SMASK)? FMASK << (27 - SC): 0));
AR = (AR >> SC) | (FMASK & (((AR & SMASK)? FMASK << (27 - SC): 0)));
}
if (((IR & 04) != 0 && (MQ & SMASK) != 0) ||
((IR & 04) == 0 && (AR & SMASK) != 0 &&
@ -3402,7 +3439,7 @@ dpnorm:
MB = (mar & 00777607777777LL) | ((uint64)pag_reload) << 21;
M[AB] = MB;
AB = (AB + 1) & RMASK;
MB = ((uint64)qua_time) | ((uint64)fault_data) << 18;
MB = ((uint64)get_quantum()) | ((uint64)fault_data) << 18;
M[AB] = MB;
AB = (AB + 1) & RMASK;
MB = ((uint64)fault_addr & 00760000) << 13 |
@ -3439,6 +3476,7 @@ dpnorm:
MB = M[AB]; /* WD 3 */
/* Store Quantum */
qua_time = MB & RMASK;
set_quantum();
fault_data = (MB >> 18) & RMASK;
mem_prot = 0;
if ((fault_data & 0777772) != 0)
@ -5901,7 +5939,7 @@ last:
if (!pi_cycle && instr_count != 0 && --instr_count == 0) {
#if ITS
if (QITS)
sim_cancel(&cpu_unit[1]);
load_quantum();
#endif
return SCPE_STEP;
}
@ -5909,7 +5947,7 @@ last:
/* Should never get here */
#if ITS
if (QITS)
sim_cancel(&cpu_unit[1]);
load_quantum();
#endif
return reason;
@ -5935,15 +5973,11 @@ t_stat
qua_srv(UNIT * uptr)
{
int32 t;
t = sim_rtcn_calb (qua_tps, TMR_QUA);
sim_activate_after(uptr, 1000000/qua_tps);
if ((fault_data & 1) == 0 && pi_enable && !pi_pending && (FLAGS & USER) != 0) {
qua_time += 8;
if ((qua_time & 01000000LL) != 0) {
mem_prot = 1;
fault_data |= 1;
}
mem_prot = 1;
fault_data |= 1;
}
qua_time = RSIGN;
return SCPE_OK;
}
#endif
@ -5985,11 +6019,6 @@ sim_brk_types = SWMASK('E') | SWMASK('W') | SWMASK('R');
sim_brk_dflt = SWMASK ('E');
sim_rtcn_init_unit (&cpu_unit[0], cpu_unit[0].wait, TMR_RTC);
sim_activate(&cpu_unit[0], 10000);
#if ITS
if (QITS) {
sim_rtcn_init_unit (&cpu_unit[1], cpu_unit[1].wait, TMR_RTC);
}
#endif
#if MPX_DEV
mpx_enable = 0;
#endif

View File

@ -265,14 +265,13 @@ MTAB dp_mod[] = {
{UNIT_WLK, 0, "write enabled", "WRITEENABLED", NULL},
{UNIT_WLK, UNIT_WLK, "write locked", "LOCKED", NULL},
{MTAB_XTD|MTAB_VDV, 0, NULL, "NOHEADERS",
&dp_set_hdr, &dp_show_hdr, "No Headers", "Disable header writing"},
&dp_set_hdr, &dp_show_hdr, NULL, "Disable header writing"},
{MTAB_XTD|MTAB_VDV, DEV_WHDR, "write header", "HEADERS",
&dp_set_hdr, &dp_show_hdr, "Headers", "Enable header writing"},
&dp_set_hdr, &dp_show_hdr, NULL, "Enable header writing"},
{UNIT_DTYPE, (RP03_DTYPE << UNIT_V_DTYPE), "RP03", "RP03", &dp_set_type },
{UNIT_DTYPE, (RP02_DTYPE << UNIT_V_DTYPE), "RP02", "RP02", &dp_set_type },
{UNIT_DTYPE, (RP01_DTYPE << UNIT_V_DTYPE), "RP01", "RP01", &dp_set_type },
{0}
{0},
};
REG dpa_reg[] = {

View File

@ -458,7 +458,7 @@ void imp_send_rfmn(struct imp_device *imp);
void imp_packet_in(struct imp_device *imp);
void imp_send_packet (struct imp_device *imp_data, int len);
void imp_free_packet(struct imp_device *imp, struct imp_packet *p);
struct imp_packet * imp_get_packet();
struct imp_packet * imp_get_packet(struct imp_device *imp);
void imp_arp_update(in_addr_t *ipaddr, ETH_MAC *ethaddr);
void imp_arp_arpin(struct imp_device *imp, ETH_PACK *packet);
void imp_packet_out(struct imp_device *imp, ETH_PACK *packet);
@ -765,7 +765,7 @@ checksumadjust(uint8 *chksum, uint8 *optr,
- even number of octets updated.
*/
{
int32 sum, old, new;
int32 sum, old, new_sum;
sum=(chksum[0]<<8)+chksum[1];
sum=(~sum & 0xffff);
while (olen > 1) {
@ -781,15 +781,15 @@ checksumadjust(uint8 *chksum, uint8 *optr,
if (sum<=0) { sum--; sum&=0xffff; }
}
while (nlen > 1) {
new=(nptr[0]<<8)+nptr[1];
new_sum=(nptr[0]<<8)+nptr[1];
nptr+=2;
sum+=new & 0xffff;
sum+=new_sum & 0xffff;
if (sum & 0x10000) { sum++; sum&=0xffff; }
nlen-=2;
}
if (nlen > 0) {
new=(nptr[0]<<8);
sum+=new & 0xffff;
new_sum=(nptr[0]<<8);
sum+=new_sum & 0xffff;
if (sum & 0x10000) { sum++; sum&=0xffff; }
}
sum=(~sum & 0xffff);
@ -988,13 +988,13 @@ imp_packet_in(struct imp_device *imp)
}
}
/* Check if recieving to FTP */
if (sport == 21 && strncmp(&tcp_payload[0], "PORT ", 5) == 0) {
if (sport == 21 && strncmp((CONST char *)&tcp_payload[0], "PORT ", 5) == 0) {
/* We need to translate the IP address to new port number. */
int l = ntohs(ip_hdr->ip_len) - thl - hl;
uint32 nip = ntohl(imp->hostip);
int nlen;
int i;
uint8 port_buffer[100];
char port_buffer[100];
struct udp_hdr udp_hdr;
/* Count out 4 commas */
for (i = nlen = 0; i < l && nlen < 4; i++) {
@ -1003,7 +1003,7 @@ imp_packet_in(struct imp_device *imp)
}
nlen = sprintf(port_buffer, "PORT %d,%d,%d,%d,",
(nip >> 24) & 0xFF, (nip >> 16) & 0xFF,
(nip >> 8) & 0xFF, nip&0xff);
(nip >> 8) & 0xFF, nip & 0xff);
/* Copy over rest of string */
while(i < l) {
port_buffer[nlen++] = tcp_payload[i++];
@ -1095,6 +1095,8 @@ imp_send_packet (struct imp_device *imp, int len)
int lk;
int mt;
lk = 0;
n = len;
switch (imp->sbuffer[0] & 0xF) {
default:
/* Send back invalid leader message */
@ -1113,9 +1115,9 @@ imp_send_packet (struct imp_device *imp, int len)
st = imp->sbuffer[9] & 0xf;
lk = imp->sbuffer[8];
mt = imp->sbuffer[3];
n = (imp->sbuffer[10] << 8) + (imp->sbuffer[11]);
break;
}
n = (imp->sbuffer[10] << 8) + (imp->sbuffer[11]);
sim_debug(DEBUG_DETAIL, &imp_dev,
"IMP packet Type=%d ht=%d dh=%d imp=%d lk=%d %d st=%d Len=%d\n",
imp->sbuffer[3], imp->sbuffer[4], imp->sbuffer[5],
@ -1220,12 +1222,12 @@ imp_packet_out(struct imp_device *imp, ETH_PACK *packet) {
}
}
/* Check if sending to FTP */
if (dport == 21 && strncmp(&tcp_payload[0], "PORT ", 5) == 0) {
if (dport == 21 && strncmp((CONST char *)&tcp_payload[0], "PORT ", 5) == 0) {
/* We need to translate the IP address to new port number. */
int l = ntohs(pkt->iphdr.ip_len) - thl - hl;
uint32 nip = ntohl(imp->ip);
int nlen;
uint8 port_buffer[100];
char port_buffer[100];
struct udp_hdr udp_hdr;
/* Count out 4 commas */
for (i = nlen = 0; i < l && nlen < 4; i++) {

View File

@ -1099,13 +1099,13 @@ t_stat rp_svc (UNIT *uptr)
uptr->DATAPTR = 0;
/* On read headers, transfer 2 words to start */
if (GET_FNC(uptr->CMD) == FNC_READH) {
df->buf == (((uint64)cyl) << 18) |
df->buf = (((uint64)cyl) << 18) |
((uint64)((GET_SF(uptr->DA) << 8) | GET_SF(uptr->DA)));
sim_debug(DEBUG_DATA, dptr, "RP%o read word h1 %012llo %09o %06o\n",
unit, df->buf, df->cda, df->wcr);
if (df10_write(df) == 0)
goto rd_end;
df->buf == ((uint64)((020 * ctlr) + (unit + 1)) << 18) | (uint64)(unit);
df->buf = ((uint64)((020 * ctlr) + (unit + 1)) << 18) | (uint64)(unit);
sim_debug(DEBUG_DATA, dptr, "RP%o read word h2 %012llo %09o %06o\n",
unit, df->buf, df->cda, df->wcr);
if (df10_write(df) == 0)

View File

@ -1140,11 +1140,9 @@ tu_detach(UNIT * uptr)
t_stat tu_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
{
fprintf (st, "TU04/05/06/07 Disk Pack Drives (TU)\n\n");
fprintf (st, "The TU controller implements the Massbus family of large disk drives. TU\n");
fprintf (st, "options include the ability to set units write enabled or write locked, to\n");
fprintf (st, "set the drive type to one of six disk types or autosize, and to write a DEC\n");
fprintf (st, "standard 044 compliant bad block table on the last track.\n\n");
fprintf (st, "TU Tape Drives with TM03 formatter. (TU)\n\n");
fprintf (st, "The TU controller implements the Massbus tape formatter the TM03. TU\n");
fprintf (st, "options include the ability to set units write enabled or write locked\n\n");
fprint_set_help (st, dptr);
fprint_show_help (st, dptr);
fprintf (st, "\nThe type options can be used only when a unit is not attached to a file.\n");