blob: 1e278ca6815c52512c06f12663894b3586b408af [file] [log] [blame] [raw]
Mark Pizzolatofffad7c2012-03-19 16:05:24 -07001/* vax_syslist.c: VAX device list
Bob Supnikb6393b32004-11-23 15:49:00 -08002
Bob Supnik9c4779c2009-02-08 09:06:00 -08003 Copyright (c) 1998-2008, Robert M Supnik
Bob Supnikb6393b32004-11-23 15:49:00 -08004
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 ROBERT M SUPNIK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
Bob Supnikb7c1eae2005-09-09 18:09:00 -070022 Except as contained in this notice, the name of Robert M Supnik shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
Bob Supnikb6393b32004-11-23 15:49:00 -080024 in this Software without prior written authorization from Robert M Supnik.
25
Bob Supnik53d02f72007-02-03 14:59:00 -080026 17-Oct-06 RMS Re-ordered device list
Mark Pizzolato6e813b82012-03-24 19:46:37 -070027 17-May-06 RMS Added CR11/CD11 support (John Dundas)
Bob Supnikb7c1eae2005-09-09 18:09:00 -070028 01-Oct-2004 RMS Cloned from vax_sys.c
Bob Supnikb6393b32004-11-23 15:49:00 -080029*/
30
31#include "vax_defs.h"
32
33char sim_name[] = "VAX";
34
35extern DEVICE cpu_dev;
36extern DEVICE tlb_dev;
37extern DEVICE rom_dev;
38extern DEVICE nvr_dev;
39extern DEVICE sysd_dev;
40extern DEVICE qba_dev;
41extern DEVICE tti_dev, tto_dev;
Bob Supnikdc871fa2006-05-27 11:34:00 -070042extern DEVICE cr_dev;
Bob Supnikb6393b32004-11-23 15:49:00 -080043extern DEVICE lpt_dev;
44extern DEVICE clk_dev;
45extern DEVICE rq_dev, rqb_dev, rqc_dev, rqd_dev;
46extern DEVICE rl_dev;
47extern DEVICE ry_dev;
48extern DEVICE ts_dev;
49extern DEVICE tq_dev;
50extern DEVICE dz_dev;
51extern DEVICE csi_dev, cso_dev;
52extern DEVICE xq_dev, xqb_dev;
53extern DEVICE vh_dev;
Mark Pizzolatoecbbcc72012-11-07 14:50:32 -080054extern DEVICE dmc_dev[];
55extern DEVICE dmp_dev[];
Bob Supnikb6393b32004-11-23 15:49:00 -080056
57extern int32 sim_switches;
Bob Supnik1e704bf2005-10-15 15:38:00 -070058extern void WriteB (uint32 pa, int32 val);
Bob Supnikb6393b32004-11-23 15:49:00 -080059extern void rom_wr_B (int32 pa, int32 val);
60extern UNIT cpu_unit;
61
62DEVICE *sim_devices[] = {
Bob Supnikb7c1eae2005-09-09 18:09:00 -070063 &cpu_dev,
64 &tlb_dev,
65 &rom_dev,
66 &nvr_dev,
67 &sysd_dev,
68 &qba_dev,
Bob Supnik53d02f72007-02-03 14:59:00 -080069 &clk_dev,
Bob Supnikb7c1eae2005-09-09 18:09:00 -070070 &tti_dev,
71 &tto_dev,
72 &csi_dev,
73 &cso_dev,
Bob Supnikb7c1eae2005-09-09 18:09:00 -070074 &dz_dev,
75 &vh_dev,
Bob Supnikdc871fa2006-05-27 11:34:00 -070076 &cr_dev,
Bob Supnikb7c1eae2005-09-09 18:09:00 -070077 &lpt_dev,
78 &rl_dev,
79 &rq_dev,
80 &rqb_dev,
81 &rqc_dev,
82 &rqd_dev,
83 &ry_dev,
84 &ts_dev,
85 &tq_dev,
86 &xq_dev,
87 &xqb_dev,
Mark Pizzolatoecbbcc72012-11-07 14:50:32 -080088 &dmc_dev[0],
89 &dmc_dev[1],
90 &dmc_dev[2],
91 &dmc_dev[3],
92 &dmp_dev[0],
Bob Supnikb7c1eae2005-09-09 18:09:00 -070093 NULL
94 };
95
Bob Supnikb6393b32004-11-23 15:49:00 -080096/* Binary loader
97
98 The binary loader handles absolute system images, that is, system
99 images linked /SYSTEM. These are simply a byte stream, with no
100 origin or relocation information.
101
Bob Supnikb7c1eae2005-09-09 18:09:00 -0700102 -r load ROM
103 -n load NVR
104 -o for memory, specify origin
Bob Supnikb6393b32004-11-23 15:49:00 -0800105*/
106
107t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
108{
109t_stat r;
110int32 i;
111uint32 origin, limit;
112extern int32 ssc_cnf;
Bob Supnikb7c1eae2005-09-09 18:09:00 -0700113#define SSCCNF_BLO 0x80000000
Bob Supnikb6393b32004-11-23 15:49:00 -0800114
Bob Supnik9c4779c2009-02-08 09:06:00 -0800115if (flag) /* dump? */
116 return SCPE_ARG;
Bob Supnikb7c1eae2005-09-09 18:09:00 -0700117if (sim_switches & SWMASK ('R')) { /* ROM? */
118 origin = ROMBASE;
119 limit = ROMBASE + ROMSIZE;
120 }
121else if (sim_switches & SWMASK ('N')) { /* NVR? */
122 origin = NVRBASE;
123 limit = NVRBASE + NVRSIZE;
124 ssc_cnf = ssc_cnf & ~SSCCNF_BLO;
125 }
126else {
127 origin = 0; /* memory */
128 limit = (uint32) cpu_unit.capac;
129 if (sim_switches & SWMASK ('O')) { /* origin? */
130 origin = (int32) get_uint (cptr, 16, 0xFFFFFFFF, &r);
Bob Supnik9c4779c2009-02-08 09:06:00 -0800131 if (r != SCPE_OK)
132 return SCPE_ARG;
Bob Supnikb7c1eae2005-09-09 18:09:00 -0700133 }
134 }
135while ((i = getc (fileref)) != EOF) { /* read byte stream */
Bob Supnik9c4779c2009-02-08 09:06:00 -0800136 if (origin >= limit) /* NXM? */
137 return SCPE_NXM;
Bob Supnikb7c1eae2005-09-09 18:09:00 -0700138 if (sim_switches & SWMASK ('R')) /* ROM? */
139 rom_wr_B (origin, i); /* not writeable */
140 else WriteB (origin, i); /* store byte */
141 origin = origin + 1;
142 }
Bob Supnikb6393b32004-11-23 15:49:00 -0800143return SCPE_OK;
144}
145