From 6339af2dc4f1400ddad388fdf85b34a7061e9022 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 27 Oct 2013 04:14:46 -0700 Subject: [PATCH] PDP11: Fix to correctly set PS value on CPU reset to reflect the model specific ways real hardware behaved. (from Bob Supnik) Here's a PDP11 SIMH bug as old as the simulator itself: the reset_cpu routine sets the PS to 340 (interrupts disabled). This causes some versions of Lunar Lander not to work. In fact, the initial state of the PS is not architecturally standardized: 04: cleared (from schematics) 05: cleared (from manual) 20: cleared (from schematics) 34: cleared (from schematics), set to 340 on boot? 40: cleared (from schematics) 44: cleared on init, set to 340 on boot (from schematics, manual) 45: cleared (from schematics) 60: cleared (from schematics) 70: cleared (from schematics) T11: set to 340 (from spec) LSI11, F11: 4 mode behavior (from memory on power recovery, cleared on GO, 340 on boot, mode 3 undefined) J11: 4 mode behavior (from memory on power recovery, cleared on GO, 340 on boot, 340 on jump to custom PROM) The story seems to be this. All non-VLSI PDP11s used TTL chips to implement the PS, either discrete flip-flops, or 4b registers, or both. Starting with the first system, the 11/20, they were wired clear on the processor INIT signal (power-up or front panel START switch), so that all internal state started as 0. This worked fine, because START also reset the Unibus and cleared all interrupt enables. So even though the processor was as IPL = 0, no interrupts were possible. Then along came the LSI11... The LSI11 implemented a line-time clock with NO INTERRUPT DISABLE. Thus, if IPL was left at 0 and a bootstrap routine from a slow device was started (e.g., a floppy drive), the clock would tick, and an interrupt would occur, before the bootstrap routine finished. Because no vectors were set up, the processor would crash. So the LSI11 started the practice, carried over to all later PDP11 VLSI chips, of setting the PS to 340 before jumping to a boot ROM. The T11 did this in all modes of startup, because its only startup behavior was to jump to a "boot" routine. It did not have a console of any kind. Accordingly, it appears that the cpu_reset routine needs to set the PS based on the processor model. Further, all boot routines need to set the PS to 0 or 340 based on the processor model. (It's probably safe for boot routines just to set the PS to 340, but it's not technically accurate.) --- PDP11/pdp11_cpu.c | 14 +++++++++++++- PDP11/pdp11_defs.h | 3 +++ PDP11/pdp11_hk.c | 4 ++-- PDP11/pdp11_rf.c | 4 ++-- PDP11/pdp11_rk.c | 4 ++-- PDP11/pdp11_rl.c | 6 +++--- PDP11/pdp11_rp.c | 6 +++--- PDP11/pdp11_rq.c | 6 +++--- PDP11/pdp11_rs.c | 5 +++-- PDP11/pdp11_rx.c | 4 ++-- PDP11/pdp11_ry.c | 4 ++-- PDP11/pdp11_ta.c | 4 ++-- PDP11/pdp11_tc.c | 6 +++--- PDP11/pdp11_tm.c | 6 +++--- PDP11/pdp11_tq.c | 4 ++-- PDP11/pdp11_ts.c | 6 +++--- PDP11/pdp11_tu.c | 6 +++--- Visual Studio Projects/PDP11.vcproj | 4 ++++ descrip.mms | 3 ++- makefile | 3 ++- sim_rev.h | 16 ++++++++++++++-- 21 files changed, 76 insertions(+), 42 deletions(-) diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index 1c4a9cf3..98c1d561 100644 --- a/PDP11/pdp11_cpu.c +++ b/PDP11/pdp11_cpu.c @@ -25,6 +25,7 @@ cpu PDP-11 CPU + 23-Oct-13 RMS Fixed PS behavior on initialization and boot 10-Apr-13 RMS MMR1 does not track PC changes (Johnny Billquist) 29-Apr-12 RMS Fixed compiler warning (Mark Pizzolato) 19-Mar-12 RMS Fixed declaration of sim_switches (Mark Pizzolato) @@ -2998,7 +2999,9 @@ t_stat cpu_reset (DEVICE *dptr) { PIRQ = 0; STKLIM = 0; -PSW = 000340; +if (CPUT (CPUT_T)) /* T11? */ + PSW = 000340; /* start at IPL 7 */ +else PSW = 0; /* else at IPL 0 */ MMR0 = 0; MMR1 = 0; MMR2 = 0; @@ -3018,6 +3021,15 @@ set_r_display (0, MD_KER); return SCPE_OK; } +/* Boot setup routine */ + +void cpu_set_boot (int32 pc) +{ +saved_PC = pc; +PSW = 000340; +return; +} + /* Memory examine */ t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw) diff --git a/PDP11/pdp11_defs.h b/PDP11/pdp11_defs.h index eefbd577..8bd0b974 100644 --- a/PDP11/pdp11_defs.h +++ b/PDP11/pdp11_defs.h @@ -26,6 +26,7 @@ The author gratefully acknowledges the help of Max Burnet, Megan Gentry, and John Wilson in resolving questions about the PDP-11 + 23-Oct-13 RMS Added cpu_set_boot prototype 02-Sep-13 RMS Added third Massbus adapter and RS drive 12-Dec-12 RMS Fixed base address for RQB, RQC, RQD 11-Dec-11 RMS Fixed priority of PIRQ vs IO; added INT_INTERNALn @@ -865,6 +866,8 @@ t_stat mba_show_num (FILE *st, UNIT *uptr, int32 val, void *desc); int32 clk_cosched (int32 wait); +void cpu_set_boot (int32 pc); + #include "pdp11_io_lib.h" #endif diff --git a/PDP11/pdp11_hk.c b/PDP11/pdp11_hk.c index 79169342..647f18d7 100644 --- a/PDP11/pdp11_hk.c +++ b/PDP11/pdp11_hk.c @@ -25,6 +25,7 @@ hk RK611/RK06/RK07 disk + 23-Oct-13 RMS Revised for new boot setup routine 01-Sep-13 RMS Revised error handling to command-response model Revised interrupt logic to follow the hardware 10-Jun-13 RMS Fixed bug to write through end of sector (Oleg Safiullin) @@ -1366,13 +1367,12 @@ static const uint16 boot_rom[] = { t_stat hk_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & CS2_M_UNIT; M[BOOT_CSR >> 1] = hk_dib.ba & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rf.c b/PDP11/pdp11_rf.c index 4f07ef41..96c093cb 100644 --- a/PDP11/pdp11_rf.c +++ b/PDP11/pdp11_rf.c @@ -25,6 +25,7 @@ rf RF11 fixed head disk + 23-Oct-13 RMS Revised for new boot setup routine 03-Sep-13 RMS Added WC to debug printout 19-Mar-12 RMS Fixed bug in updating mem addr extension (Peter Schorn) 25-Dec-06 RMS Fixed bug in unit mask (John Dundas) @@ -463,12 +464,11 @@ static const uint16 boot_rom[] = { t_stat rf_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_CSR >> 1] = (rf_dib.ba & DMASK) + 012; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rk.c b/PDP11/pdp11_rk.c index f8d66ac4..57140ad3 100644 --- a/PDP11/pdp11_rk.c +++ b/PDP11/pdp11_rk.c @@ -25,6 +25,7 @@ rk RK11/RKV11/RK05 cartridge disk + 23-Oct-13 RMS Revised for new boot setup routine 06-Sep-13 RMS Fixed RKDS content for non-existent disk (Mark Pizzolato) 20-Mar-09 RMS Fixed bug in read header (Walter F Mueller) 16-Aug-05 RMS Fixed C++ declaration and cast problems @@ -751,12 +752,11 @@ static const uint16 boot_rom[] = { t_stat rk_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & RK_M_NUMDR; M[BOOT_CSR >> 1] = (rk_dib.ba & DMASK) + 012; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rl.c b/PDP11/pdp11_rl.c index ef338bf5..75690b6b 100644 --- a/PDP11/pdp11_rl.c +++ b/PDP11/pdp11_rl.c @@ -1,6 +1,6 @@ /* pdp11_rl.c: RL11 (RLV12) cartridge disk simulator - Copyright (c) 1993-2008, Robert M Supnik + Copyright (c) 1993-2013, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ rl RL11(RLV12)/RL01/RL02 cartridge disk + 23-Oct-13 RMS Revised for new boot setup routine 24-Mar-11 JAD Various changes to support diagnostics, including: - distinguish between RLV11 & 12 - more complete drive state @@ -1189,13 +1190,12 @@ t_stat rl_boot (int32 unitno, DEVICE *dptr) { int32 i; extern uint16 *M; -extern int32 saved_PC; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & RLCS_M_DRIVE; M[BOOT_CSR >> 1] = rl_dib.ba & 0177777; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rp.c b/PDP11/pdp11_rp.c index 87d571ac..f18b410a 100644 --- a/PDP11/pdp11_rp.c +++ b/PDP11/pdp11_rp.c @@ -1,6 +1,6 @@ /* pdp11_rp.c - RP04/05/06/07 RM02/03/05/80 Massbus disk controller - Copyright (c) 1993-2012, Robert M Supnik + Copyright (c) 1993-2013, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ rp RH/RP/RM moving head disks + 23-Oct-13 RMS Revised for new boot setup routine 08-Dec-12 RMS UNLOAD shouldn't set ATTN (Mark Pizzolato) 17-May-07 RMS CS1 DVA resides in device, not MBA 21-Nov-05 RMS Enable/disable device also enables/disables Massbus adapter @@ -1086,7 +1087,6 @@ static const uint16 boot_rom[] = { t_stat rp_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; UNIT *uptr = rp_dev.units + unitno; @@ -1097,7 +1097,7 @@ M[BOOT_CSR >> 1] = mba_get_csr (rp_dib.ba) & DMASK; if (drv_tab[GET_DTYPE (uptr->flags)].ctrl == RP_CTRL) M[BOOT_START >> 1] = 042102; /* "BD" */ else M[BOOT_START >> 1] = 042122; /* "RD" */ -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rq.c b/PDP11/pdp11_rq.c index 29ae9103..bab58713 100644 --- a/PDP11/pdp11_rq.c +++ b/PDP11/pdp11_rq.c @@ -1,6 +1,6 @@ /* pdp11_rq.c: MSCP disk controller simulator - Copyright (c) 2002-2016, Robert M Supnik + Copyright (c) 2002-2013, Robert M Supnik Derived from work by Stephen F. Shirron Permission is hereby granted, free of charge, to any person obtaining a @@ -26,6 +26,7 @@ rq RQDX3 disk controller + 23-Oct-13 RMS Revised for new boot setup routine 17-Mar-13 RMS Fixed bug in ABORT link walk loop (Dave Bryan) 14-Jan-09 JH Added support for RD32 disc drive 18-Jun-07 RMS Added UNIT_IDLE flag to timer thread @@ -2497,7 +2498,6 @@ static const uint16 boot_rom[] = { t_stat rq_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; DIB *dibp = (DIB *) dptr->ctxt; @@ -2505,7 +2505,7 @@ for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & 3; M[BOOT_CSR >> 1] = dibp->ba & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rs.c b/PDP11/pdp11_rs.c index 0ff3f523..82093f90 100644 --- a/PDP11/pdp11_rs.c +++ b/PDP11/pdp11_rs.c @@ -24,6 +24,8 @@ in this Software without prior written authorization from Robert M Supnik. rs RS03/RS04 fixed head disks + + 23-Oct-13 RMS Revised for new boot setup routine */ #if defined (VM_PDP10) @@ -685,7 +687,6 @@ static const uint16 boot_rom[] = { t_stat rs_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; UNIT *uptr = rs_dev.units + unitno; @@ -693,7 +694,7 @@ for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & (RS_NUMDR - 1); M[BOOT_CSR >> 1] = mba_get_csr (rs_dib.ba) & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_rx.c b/PDP11/pdp11_rx.c index 511635d8..4bef3e34 100644 --- a/PDP11/pdp11_rx.c +++ b/PDP11/pdp11_rx.c @@ -25,6 +25,7 @@ rx RX11/RX01 floppy disk + 23-Oct-13 RMS Revised for new boot setup routine 03-Sep-13 RMS Added explicit void * cast 07-Jul-05 RMS Removed extraneous externs 12-Oct-02 RMS Added autoconfigure support @@ -524,13 +525,12 @@ static const uint16 boot_rom[] = { t_stat rx_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & RX_M_NUMDR; M[BOOT_CSR >> 1] = rx_dib.ba & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_ry.c b/PDP11/pdp11_ry.c index 2fc9f50b..9acf609b 100644 --- a/PDP11/pdp11_ry.c +++ b/PDP11/pdp11_ry.c @@ -25,6 +25,7 @@ ry RX211/RXV21/RX02 floppy disk + 23-Oct-13 RMS Revised for new boot setup routine 03-Sep-13 RMS Added explicit void * cast 15-May-06 RMS Fixed bug in autosize attach (David Gesswein) 07-Jul-05 RMS Removed extraneous externs @@ -680,7 +681,6 @@ static const uint16 boot_rom[] = { t_stat ry_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; if ((ry_unit[unitno & RX_M_NUMDR].flags & UNIT_DEN) == 0) @@ -689,7 +689,7 @@ for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & RX_M_NUMDR; M[BOOT_CSR >> 1] = ry_dib.ba & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_ta.c b/PDP11/pdp11_ta.c index 225e3249..3c9876d3 100644 --- a/PDP11/pdp11_ta.c +++ b/PDP11/pdp11_ta.c @@ -25,6 +25,7 @@ ta TA11/TU60 cassette tape + 23-Oct-13 RMS Revised for new boot setup routine 06-Jun-13 RMS Reset must set RDY (Ian Hammond) Added CAPS-11 bootstrap (Ian Hammond) 06-Aug-07 RMS Foward op at BOT skips initial file gap @@ -655,12 +656,11 @@ static const uint16 boot_rom[] = { t_stat ta_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_CSR >> 1] = ta_dib.ba & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } \ No newline at end of file diff --git a/PDP11/pdp11_tc.c b/PDP11/pdp11_tc.c index f1451776..7ef02818 100644 --- a/PDP11/pdp11_tc.c +++ b/PDP11/pdp11_tc.c @@ -1,6 +1,6 @@ /* pdp11_tc.c: PDP-11 DECtape simulator - Copyright (c) 1993-2008, Robert M Supnik + Copyright (c) 1993-2013, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ tc TC11/TU56 DECtape + 23-Oct-13 RMS Revised for new boot setup routine 23-Jun-06 RMS Fixed switch conflict in ATTACH 10-Feb-06 RMS READ sets extended data bits in TCST (Alan Frisbie) 16-Aug-05 RMS Fixed C++ declaration and cast problems @@ -1184,14 +1185,13 @@ static const uint16 boot_rom[] = { t_stat dt_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; dt_unit[unitno].pos = DT_EZLIN; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & DT_M_NUMDR; M[BOOT_CSR >> 1] = (dt_dib.ba & DMASK) + 02; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_tm.c b/PDP11/pdp11_tm.c index ee4f2ba6..9bbbaea6 100644 --- a/PDP11/pdp11_tm.c +++ b/PDP11/pdp11_tm.c @@ -1,6 +1,6 @@ /* pdp11_tm.c: PDP-11 magnetic tape simulator - Copyright (c) 1993-2008, Robert M Supnik + Copyright (c) 1993-2013, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ tm TM11/TU10 magtape + 23-Oct-13 RMS Revised for new boot setup routine 16-Feb-06 RMS Added tape capacity checking 31-Oct-05 RMS Fixed address width for large files 16-Aug-05 RMS Fixed C++ declaration and cast problems @@ -712,7 +713,6 @@ static const uint16 boot2_rom[] = { t_stat tm_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern int32 sim_switches; sim_tape_rewind (&tm_unit[unitno]); @@ -726,6 +726,6 @@ else { } M[BOOT_UNIT >> 1] = unitno; M[BOOT_CSR >> 1] = (tm_dib.ba & DMASK) + 06; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_tq.c b/PDP11/pdp11_tq.c index 8e632060..c594129c 100644 --- a/PDP11/pdp11_tq.c +++ b/PDP11/pdp11_tq.c @@ -25,6 +25,7 @@ tq TQK50 tape controller + 23-Oct-13 RMS Revised for new boot setup routine 17-Mar-13 RMS Fixed bug in ABORT link walk loop (Dave Bryan) 17-Aug-11 RMS Added CAPACITY modifier 14-Jan-11 MP Various fixes discovered while exploring Ultrix issue: @@ -2147,14 +2148,13 @@ static const uint16 boot_rom[] = { t_stat tq_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & 3; M[BOOT_CSR >> 1] = tq_dib.ba & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/PDP11/pdp11_ts.c b/PDP11/pdp11_ts.c index 11ab6f11..16aa6b32 100644 --- a/PDP11/pdp11_ts.c +++ b/PDP11/pdp11_ts.c @@ -1,6 +1,6 @@ /* pdp11_ts.c: TS11/TSV05 magnetic tape simulator - Copyright (c) 1993-2012, Robert M Supnik + Copyright (c) 1993-2013, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ ts TS11/TSV05 magtape + 23-Oct-13 RMS Revised for new boot setup routine 19-Mar-12 RMS Fixed declaration of cpu_opt (Mark Pizzolato) 22-May-10 RMS Fixed t_addr printouts for 64b big-endian systems (Mark Pizzolato) @@ -1151,7 +1152,6 @@ static const uint16 boot_rom[] = { t_stat ts_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; sim_tape_rewind (&ts_unit); @@ -1159,7 +1159,7 @@ for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_CSR0 >> 1] = ts_dib.ba & DMASK; M[BOOT_CSR1 >> 1] = (ts_dib.ba & DMASK) + 02; -saved_PC = BOOT_START; +cpu_set_boot (BOOT_START); return SCPE_OK; } diff --git a/PDP11/pdp11_tu.c b/PDP11/pdp11_tu.c index 9175b996..31f43813 100644 --- a/PDP11/pdp11_tu.c +++ b/PDP11/pdp11_tu.c @@ -1,6 +1,6 @@ /* pdp11_tu.c - PDP-11 TM02/TU16 TM03/TU45/TU77 Massbus magnetic tape controller - Copyright (c) 1993-2012, Robert M Supnik + Copyright (c) 1993-2013, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ tu TM02/TM03 magtape + 23-Oct-13 RMS Revised for new boot setup routine 18-Apr-11 MP Fixed t_addr printouts for 64b big-endian systems 17-May-07 RMS CS1 DVA resides in device, not MBA 29-Apr-07 RMS Fixed bug in setting FCE on TMK Naoki Hamada) @@ -1037,14 +1038,13 @@ static const uint16 boot_rom[] = { t_stat tu_boot (int32 unitno, DEVICE *dptr) { int32 i; -extern int32 saved_PC; extern uint16 *M; for (i = 0; i < BOOT_LEN; i++) M[(BOOT_START >> 1) + i] = boot_rom[i]; M[BOOT_UNIT >> 1] = unitno & (TU_NUMDR - 1); M[BOOT_CSR >> 1] = mba_get_csr (tu_dib.ba) & DMASK; -saved_PC = BOOT_ENTRY; +cpu_set_boot (BOOT_ENTRY); return SCPE_OK; } diff --git a/Visual Studio Projects/PDP11.vcproj b/Visual Studio Projects/PDP11.vcproj index 4aefed7a..d3425faf 100644 --- a/Visual Studio Projects/PDP11.vcproj +++ b/Visual Studio Projects/PDP11.vcproj @@ -283,6 +283,10 @@ RelativePath="..\PDP11\pdp11_rq.c" > + + diff --git a/descrip.mms b/descrip.mms index 43aafd57..6909da15 100644 --- a/descrip.mms +++ b/descrip.mms @@ -508,7 +508,8 @@ PDP11_SOURCE1 = $(PDP11_DIR)PDP11_FP.C,$(PDP11_DIR)PDP11_CPU.C,\ $(PDP11_DIR)PDP11_RX.C,$(PDP11_DIR)PDP11_STDDEV.C,\ $(PDP11_DIR)PDP11_SYS.C,$(PDP11_DIR)PDP11_TC.C, \ $(PDP11_DIR)PDP11_CPUMOD.C,$(PDP11_DIR)PDP11_CR.C,\ - $(PDP11_DIR)PDP11_TA.C,$(PDP11_DIR)PDP11_IO_LIB.C + $(PDP11_DIR)PDP11_TA.C,$(PDP11_DIR)PDP11_RS.C,\ + $(PDP11_DIR)PDP11_IO_LIB.C PDP11_LIB2 = $(LIB_DIR)PDP11L2-$(ARCH).OLB PDP11_SOURCE2 = $(PDP11_DIR)PDP11_TM.C,$(PDP11_DIR)PDP11_TS.C,\ $(PDP11_DIR)PDP11_IO.C,$(PDP11_DIR)PDP11_RQ.C,\ diff --git a/makefile b/makefile index 3fad78ad..47d30dab 100644 --- a/makefile +++ b/makefile @@ -421,7 +421,8 @@ PDP11 = ${PDP11D}/pdp11_fp.c ${PDP11D}/pdp11_cpu.c ${PDP11D}/pdp11_dz.c \ ${PDP11D}/pdp11_rh.c ${PDP11D}/pdp11_tu.c ${PDP11D}/pdp11_cpumod.c \ ${PDP11D}/pdp11_cr.c ${PDP11D}/pdp11_rf.c ${PDP11D}/pdp11_dl.c \ ${PDP11D}/pdp11_ta.c ${PDP11D}/pdp11_rc.c ${PDP11D}/pdp11_kg.c \ - ${PDP11D}/pdp11_ke.c ${PDP11D}/pdp11_dc.c ${PDP11D}/pdp11_io_lib.c + ${PDP11D}/pdp11_ke.c ${PDP11D}/pdp11_dc.c ${PDP11D}/pdp11_rs.c \ + ${PDP11D}/pdp11_io_lib.c PDP11_OPT = -DVM_PDP11 -I ${PDP11D} ${NETWORK_OPT} diff --git a/sim_rev.h b/sim_rev.h index 36b91dfb..b525bafd 100644 --- a/sim_rev.h +++ b/sim_rev.h @@ -64,14 +64,16 @@ patch date module(s) and fix(es) pdp11_defs.h: - fixed base address for RQB, RQC, RQD - added address and IPL data for RS03/RS04 + - added cpu_set_boot prototype pdp11_cpu.c: - MMR1 does not track PC changes (Johnny Billquist) + - added cpu_set_boot pdp11_cpumod.c: - fixed model change to set memory size as last step - pdp11_dc.c, pdp11_dl.c" + pdp11_dc.c, pdp11_dl.c: - poll input immediately after attach to pick up connect pdp11_fp.c: @@ -80,21 +82,29 @@ patch date module(s) and fix(es) pdp11_hk.c: - rewrote error handling - rewrote interrupt handling + - revised to use new boot setup routine + + pdp11_rf.c, pdp11_rx.c, pdp11_ry.c, pdp11_tc.c, + pdp11_tm.c, pdp11_ts.c, pdp11_tu.c: + - revised to use new boot setup routine pdp11_rh.c: - added third Massbus adapter, debug printouts pdp11_rk.c: - fixed behavior of RKDS with non-existant drives (Mark Pizzolato) + - revised to use new boot setup routine pdp11_rp.c: - UNLOAD shouldn't set ATTN (Mark Pizzolato) + - revised to use new boot setup routine pdp11_rs.c: - - first release + - revised to use new boot setup routine pdp11_rq.c: - fixed bug in ABORT link walk loop (Dave Bryan) + - revised to use new boot setup routine pdp11_sys.c: - added third Massbus adapter, RS03/RS04 @@ -102,9 +112,11 @@ patch date module(s) and fix(es) pdp11_ta.c: - fixed bug to set RDY on reset (Ian Hammond) - added CAPS-11 bootstrap (Ian Hammond) + - revised to use new boot setup routine pdp11_tq.c: - fixed bug in ABORT link walk loop (Dave Bryan) + - revised to use new boot setup routine pdp15_tt1.c: - poll TTIX immediately after attach to pick up connect