diff --git a/PDP11/pdp11_cpu.c b/PDP11/pdp11_cpu.c index e4e853df..ed705e6c 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) @@ -2992,7 +2993,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; @@ -3012,6 +3015,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 54eab84d..c3a36348 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 11-Dec-11 RMS Fixed priority of PIRQ vs IO; added INT_INTERNALn 22-May-10 RMS Added check for 64b definitions @@ -801,6 +802,8 @@ void mba_set_don (uint32 mbus); void mba_set_enbdis (uint32 mb, t_bool dis); t_stat mba_show_num (FILE *st, UNIT *uptr, int32 val, void *desc); +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 8dd06584..c39db716 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) @@ -1612,13 +1613,12 @@ static const uint16 boot_rom[] = { t_stat hk_boot (int32 unitno, DEVICE *dptr) { size_t 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 d14f73f5..a4d101ce 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 explicit void * cast 19-Mar-12 RMS Fixed bug in updating mem addr extension (Peter Schorn) 25-Dec-06 RMS Fixed bug in unit mask (John Dundas) @@ -468,12 +469,11 @@ static const uint16 boot_rom[] = { t_stat rf_boot (int32 unitno, DEVICE *dptr) { size_t 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_rl.c b/PDP11/pdp11_rl.c index 308bfe5b..9b41e0bf 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 @@ -1212,13 +1213,12 @@ t_stat rl_boot (int32 unitno, DEVICE *dptr) { size_t 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 bd726369..542b84ac 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-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 @@ rp RH/RP/RM moving head disks + 23-Oct-13 RMS Revised for new boot setup routine 06-Mar-11 MP Converted to using sim_disk library and refactored for Asynch I/O. Set STIME value to default of 26 which allows VMS V4.x @@ -1469,7 +1470,6 @@ static const uint16 boot_rom[] = { t_stat rp_boot (int32 unitno, DEVICE *dptr) { size_t i; -extern int32 saved_PC; extern uint16 *M; UNIT *uptr = dptr->units + unitno; @@ -1480,7 +1480,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 a8771681..88a54432 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-2010, 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 MSCP disk controller + 23-Oct-13 RMS Revised for new boot setup routine 09-Dec-12 MB Added support for changing controller type. 24-Oct-12 MB Added mapped transfers for VAX 29-Jan-11 HUH Added RC25, RCF25 and RA80 disks @@ -2933,7 +2934,6 @@ static const uint16 boot_rom[] = { t_stat rq_boot (int32 unitno, DEVICE *dptr) { size_t i; -extern int32 saved_PC; extern uint16 *M; DIB *dibp = (DIB *) dptr->ctxt; @@ -2941,7 +2941,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 78658421..eabaab19 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) @@ -686,8 +688,7 @@ static const uint16 boot_rom[] = { t_stat rs_boot (int32 unitno, DEVICE *dptr) { -int32 i; -extern int32 saved_PC; +size_t i; extern uint16 *M; UNIT *uptr = rs_dev.units + unitno; @@ -695,7 +696,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 263ea6fb..7dd35eda 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 @@ -526,13 +527,12 @@ static const uint16 boot_rom[] = { t_stat rx_boot (int32 unitno, DEVICE *dptr) { size_t 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 a046713d..61f0976f 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 @@ -692,7 +693,6 @@ static const uint16 boot_rom[] = { t_stat ry_boot (int32 unitno, DEVICE *dptr) { size_t i; -extern int32 saved_PC; extern uint16 *M; if ((ry_unit[unitno & RX_M_NUMDR].flags & UNIT_DEN) == 0) @@ -701,7 +701,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 17e0e3a6..be09ceb8 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 @@ -660,14 +661,13 @@ static const uint16 boot_rom[] = { t_stat ta_boot (int32 unitno, DEVICE *dptr) { -int32 i; -extern int32 saved_PC; +size_t i; 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; } diff --git a/PDP11/pdp11_tc.c b/PDP11/pdp11_tc.c index 1a568948..110c176d 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 @@ -1188,14 +1189,13 @@ static const uint16 boot_rom[] = { t_stat dt_boot (int32 unitno, DEVICE *dptr) { size_t 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 c8d3bbc9..1fd90502 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 @@ -719,7 +720,6 @@ static const uint16 boot2_rom[] = { t_stat tm_boot (int32 unitno, DEVICE *dptr) { size_t i; -extern int32 saved_PC; sim_tape_rewind (&tm_unit[unitno]); if (sim_switches & SWMASK ('O')) { @@ -732,7 +732,7 @@ 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 91420691..055f8678 100644 --- a/PDP11/pdp11_tq.c +++ b/PDP11/pdp11_tq.c @@ -1,6 +1,6 @@ /* pdp11_tq.c: TMSCP tape controller simulator - Copyright (c) 2002-2011, Robert M Supnik + Copyright (c) 2002-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 @@ tq TQK50 tape controller + 23-Oct-13 RMS Revised for new boot setup routine 23-Jan-12 MP Added missing support for Logical EOT detection while positioning. 17-Aug-11 RMS Added CAPACITY modifier @@ -2208,14 +2209,13 @@ static const uint16 boot_rom[] = { t_stat tq_boot (int32 unitno, DEVICE *dptr) { size_t 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 3fd3f716..164e72b0 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) @@ -1158,7 +1159,6 @@ static const uint16 boot_rom[] = { t_stat ts_boot (int32 unitno, DEVICE *dptr) { size_t i; -extern int32 saved_PC; extern uint16 *M; sim_tape_rewind (&ts_unit); @@ -1166,7 +1166,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 b82ff0bd..1bdc8373 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) @@ -1045,14 +1046,13 @@ static const uint16 boot_rom[] = { t_stat tu_boot (int32 unitno, DEVICE *dptr) { size_t 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; }