From 0b69e4e4d955b58a3c357fc0542b6bc06aa01b56 Mon Sep 17 00:00:00 2001 From: Mark Emmer Date: Mon, 17 Mar 2014 16:36:28 -0600 Subject: [PATCH] SDS: Allow console bootstrap from RAD if connected to W channel Normally the RAD is connected to the E channel and there is no bootstrap capability (because of hardwired WIM instruction). However, for completeness, add code to allow booting from the RAD if it is connected to the W channel. Add RAD_CHAN definition to define which controller the RAD is connected to. Improve parentheses in bootstrap code that allows an optional word count (while also permitting the canonical bootstrap sequence). --- SDS/sds_rad.c | 30 +++++++++++++++++++++++++++++- SDS/sds_sys.c | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/SDS/sds_rad.c b/SDS/sds_rad.c index d1475230..1cbb1dd1 100644 --- a/SDS/sds_rad.c +++ b/SDS/sds_rad.c @@ -36,6 +36,7 @@ /* Constants */ +#define RAD_CHAN CHAN_E /* Connected I/O controller */ #define RAD_NUMWD 64 /* words/sector */ #define RAD_NUMSC 64 /* sectors/track */ #define RAD_NUMTR 64 /* tracks/log unit */ @@ -69,6 +70,9 @@ DSPT rad_tplt[] = { /* template */ DEVICE rad_dev; t_stat rad_svc (UNIT *uptr); t_stat rad_reset (DEVICE *dptr); +#if RAD_CHAN == CHAN_W +t_stat rad_boot (int32 unitno, DEVICE *dptr); +#endif t_stat rad_fill (int32 sba); void rad_end_op (int32 fl); int32 rad_adjda (int32 sba, int32 inc); @@ -76,12 +80,13 @@ t_stat rad (uint32 fnc, uint32 inst, uint32 *dat); /* RAD data structures + rad_dib device information block rad_dev device descriptor rad_unit unit descriptor rad_reg register list */ -DIB rad_dib = { CHAN_E, DEV_RAD, XFR_RAD, rad_tplt, &rad }; +DIB rad_dib = { RAD_CHAN, DEV_RAD, XFR_RAD, rad_tplt, &rad }; UNIT rad_unit = { UDATA (&rad_svc, UNIT_FIX+UNIT_ATTABLE+UNIT_BUFABLE+UNIT_MUSTBUF, @@ -111,7 +116,11 @@ DEVICE rad_dev = { "RAD", &rad_unit, rad_reg, rad_mod, 1, 8, 21, 1, 8, 24, NULL, NULL, &rad_reset, +#if RAD_CHAN == CHAN_W + &rad_boot, NULL, NULL, +#else NULL, NULL, NULL, +#endif &rad_dib, DEV_DISABLE }; @@ -319,3 +328,22 @@ xfr_req = xfr_req & ~XFR_RAD; /* clr xfr req */ sim_cancel (&rad_unit); /* deactivate */ return SCPE_OK; } + +#if RAD_CHAN == CHAN_W +/* Boot routine - simulate FILL console command */ + +t_stat rad_boot (int32 unitno, DEVICE *dptr) +{ +extern uint32 P, M[]; + +if (unitno) /* only unit 0 */ + return SCPE_ARG; +M[0] = 077777771; /* -7B */ +M[1] = 007100000; /* LDX 0 */ +M[2] = 000203226; /* EOM 3226B */ +M[3] = 003200002; /* WIM 2 */ +M[4] = 000100002; /* BRU 2 */ +P = 1; /* start at 1 */ +return SCPE_OK; +} +#endif diff --git a/SDS/sds_sys.c b/SDS/sds_sys.c index 7711382a..e697d2a6 100644 --- a/SDS/sds_sys.c +++ b/SDS/sds_sys.c @@ -234,7 +234,7 @@ for (i = 0; i < 8; i++) { /* read boot */ if ((buf[0] != 023200012) || /* 2 = WIM 12,2 */ (buf[1] != 004100002) || /* 3 = BRX 2 */ (buf[2] != 007100011) || /* 4 = LDX 11 */ - (buf[3] & ~VA_MASK != 023200000) || /* 5 = WIM xxxxx,2 */ + ((buf[3] & ~VA_MASK) != 023200000) || /* 5 = WIM xxxxx,2 */ (buf[4] != 004021000) || /* 6 = SKS 21000 */ (buf[5] != 004100005)) /* 7 = BRX 5 */ return SCPE_FMT;