From 923d5411f58e469b03ef088f0cb88a3508df18bd Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 15 Jan 2013 10:18:49 -0800 Subject: [PATCH] Added HELP CPU to all VAX simulators --- VAX/vax610_sysdev.c | 18 +++++++++-- VAX/vax630_sysdev.c | 14 +++++++-- VAX/vax730_defs.h | 5 ++- VAX/vax730_sys.c | 30 ++++++++++++++---- VAX/vax750_cmi.c | 30 ++++++++++++++---- VAX/vax780_sbi.c | 21 +++++++++++-- VAX/vax860_abus.c | 22 +++++++++++-- VAX/vax_cpu.c | 75 ++++++++++++++++++++++++++++++++++++++++++++- VAX/vax_defs.h | 3 ++ VAX/vax_sysdev.c | 34 ++++++++++++++++++-- 10 files changed, 225 insertions(+), 27 deletions(-) diff --git a/VAX/vax610_sysdev.c b/VAX/vax610_sysdev.c index ed3d947b..92f7df5f 100644 --- a/VAX/vax610_sysdev.c +++ b/VAX/vax610_sysdev.c @@ -487,8 +487,22 @@ t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc) return SCPE_NOFNC; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) +t_stat cpu_print_model (FILE *st) { -fprintf (st, "model=MicroVAX I"); +fprintf (st, "MicroVAX I"); +return SCPE_OK; +} + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Initial memory size is 4MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BO{OT} {/R5:flags}\n\n"); +fprintf (st, "where is one of:\n\n"); +fprintf (st, " RQn to boot from rqn\n"); +fprintf (st, " DUn to boot from rqn\n"); +fprintf (st, " DUAn to boot from rqn\n"); +fprintf (st, " XQ to boot from xq\n"); +fprintf (st, " XQA to boot from xq\n\n"); return SCPE_OK; } diff --git a/VAX/vax630_sysdev.c b/VAX/vax630_sysdev.c index e5692ac6..4b45cb7c 100644 --- a/VAX/vax630_sysdev.c +++ b/VAX/vax630_sysdev.c @@ -883,12 +883,20 @@ rom_diag_full = 0; return SCPE_OK; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) +t_stat cpu_print_model (FILE *st) { #if defined(VAX_620) -fprintf (st, "model=rtVAX 1000"); +fprintf (st, "rtVAX 1000"); #else -fprintf (st, "model=MicroVAX II"); +fprintf (st, "MicroVAX II"); #endif return SCPE_OK; } + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Initial memory size is 16MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BOOT\n\n"); +return SCPE_OK; +} diff --git a/VAX/vax730_defs.h b/VAX/vax730_defs.h index 8d0c6a16..8f1303fa 100644 --- a/VAX/vax730_defs.h +++ b/VAX/vax730_defs.h @@ -323,9 +323,8 @@ typedef struct { /* Boot definitions */ -#define BOOT_MB 0 /* device codes */ -#define BOOT_HK 1 /* for VMB */ -#define BOOT_RL 2 +#define BOOT_HK 1 /* device codes */ +#define BOOT_RL 2 /* for VMB */ #define BOOT_RB 3 #define BOOT_UDA 17 #define BOOT_TK 18 diff --git a/VAX/vax730_sys.c b/VAX/vax730_sys.c index 672b55a7..b95de462 100644 --- a/VAX/vax730_sys.c +++ b/VAX/vax730_sys.c @@ -564,12 +564,6 @@ SP = PC = 512; return SCPE_OK; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) -{ -fprintf (st, "model=VAX 11/730"); -return SCPE_OK; -} - /* SYSB reset */ t_stat sysb_reset (DEVICE *dptr) @@ -660,3 +654,27 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */ } /* end for */ return SCPE_OK; } + +t_stat cpu_print_model (FILE *st) +{ +fprintf (st, "VAX 11/730"); +return SCPE_OK; +} + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Initial memory size is 2MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BO{OT} {/R5:flags}\n\n"); +fprintf (st, "where is one of:\n\n"); +fprintf (st, " HKn to boot from hkn\n"); +fprintf (st, " RLn to boot from rln\n"); +fprintf (st, " RQn to boot from rqn\n"); +fprintf (st, " RQBn to boot from rqbn\n"); +fprintf (st, " RQCn to boot from rqcn\n"); +fprintf (st, " RQDn to boot from rqdn\n"); +fprintf (st, " TQn to boot from tqn\n"); +fprintf (st, " TDn to boot from tdn (TU58)\n"); +fprintf (st, " RBn to boot from rbn\n\n"); +return SCPE_OK; +} diff --git a/VAX/vax750_cmi.c b/VAX/vax750_cmi.c index f23cffcf..b710b393 100644 --- a/VAX/vax750_cmi.c +++ b/VAX/vax750_cmi.c @@ -649,12 +649,6 @@ SP = PC = 512; return SCPE_OK; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) -{ -fprintf (st, "model=VAX 11/750"); -return SCPE_OK; -} - /* CMI reset */ t_stat cmi_reset (DEVICE *dptr) @@ -752,3 +746,27 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */ } /* end for */ return SCPE_OK; } + +t_stat cpu_print_model (FILE *st) +{ +fprintf (st, "VAX 11/750"); +return SCPE_OK; +} + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Initial memory size is 2MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BO{OT} {/R5:flags}\n\n"); +fprintf (st, "where is one of:\n\n"); +fprintf (st, " RPn to boot from rpn\n"); +fprintf (st, " HKn to boot from hkn\n"); +fprintf (st, " RLn to boot from rln\n"); +fprintf (st, " RQn to boot from rqn\n"); +fprintf (st, " RQBn to boot from rqbn\n"); +fprintf (st, " RQCn to boot from rqcn\n"); +fprintf (st, " RQDn to boot from rqdn\n"); +fprintf (st, " TQn to boot from tqn\n"); +fprintf (st, " TDn to boot from tdn (TU58)\n\n"); +return SCPE_OK; +} diff --git a/VAX/vax780_sbi.c b/VAX/vax780_sbi.c index 68b0c3a7..3eb588ae 100644 --- a/VAX/vax780_sbi.c +++ b/VAX/vax780_sbi.c @@ -827,8 +827,25 @@ else return SCPE_OK; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) +t_stat cpu_print_model (FILE *st) { -fprintf (st, "model=VAX 11/%s", (sys_model ? "785" : "780")); +fprintf (st, "VAX 11/%s", (sys_model ? "785" : "780")); +return SCPE_OK; +} + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Initial memory size is 8MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BO{OT} {/R5:flags}\n\n"); +fprintf (st, "where is one of:\n\n"); +fprintf (st, " RPn to boot from rpn\n"); +fprintf (st, " HKn to boot from hkn\n"); +fprintf (st, " RLn to boot from rln\n"); +fprintf (st, " RQn to boot from rqn\n"); +fprintf (st, " RQBn to boot from rqbn\n"); +fprintf (st, " RQCn to boot from rqcn\n"); +fprintf (st, " RQDn to boot from rqdn\n"); +fprintf (st, " TQn to boot from tqn\n\n"); return SCPE_OK; } diff --git a/VAX/vax860_abus.c b/VAX/vax860_abus.c index 0d79de7b..1210966d 100644 --- a/VAX/vax860_abus.c +++ b/VAX/vax860_abus.c @@ -726,8 +726,26 @@ else return SCPE_OK; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) +t_stat cpu_print_model (FILE *st) { -fprintf (st, "model=VAX %s", (sys_model ? "8650" : "8600")); +fprintf (st, "VAX %s", (sys_model ? "8650" : "8600")); +return SCPE_OK; +} + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Initial memory size is 32MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BO{OT} {/R5:flags}\n\n"); +fprintf (st, "where is one of:\n\n"); +fprintf (st, " RPn to boot from rpn\n"); +fprintf (st, " HKn to boot from hkn\n"); +fprintf (st, " RLn to boot from rln\n"); +fprintf (st, " RQn to boot from rqn\n"); +fprintf (st, " RQBn to boot from rqbn\n"); +fprintf (st, " RQCn to boot from rqcn\n"); +fprintf (st, " RQDn to boot from rqdn\n"); +fprintf (st, " TQn to boot from tqn\n"); +fprintf (st, " CS to boot from console RL\n\n"); return SCPE_OK; } diff --git a/VAX/vax_cpu.c b/VAX/vax_cpu.c index 38e555ca..9da3ad71 100644 --- a/VAX/vax_cpu.c +++ b/VAX/vax_cpu.c @@ -491,9 +491,15 @@ DEVICE cpu_dev = { &cpu_ex, &cpu_dep, &cpu_reset, &cpu_boot, NULL, NULL, NULL, DEV_DYNM | DEV_DEBUG, 0, - cpu_deb, &cpu_set_size, NULL + cpu_deb, &cpu_set_size, NULL, &cpu_help, NULL, NULL }; +t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) +{ +fprintf (st, "model="); +return cpu_print_model (st); +} + t_stat sim_instr (void) { volatile int32 opc, cc; /* used by setjmp */ @@ -3492,3 +3498,70 @@ if (r != SCPE_OK) { } return SCPE_OK; } + +t_stat cpu_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "The ");cpu_print_model (st);fprintf (st, " CPU help\n\n"); +fprintf (st, "CPU options include the size of main memory.\n\n"); +if (dptr->modifiers) { + MTAB *mptr; + extern t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc); + + for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) + if (mptr->valid == &cpu_set_size) + fprintf (st, " sim> SET CPU %4s set memory size = %sB\n", mptr->mstring, mptr->mstring); + fprintf (st, "\n"); + } +cpu_model_help (st, dptr, uptr, flag, cptr); +fprintf (st, "CPU options include the treatment of the HALT instruction.\n\n"); +fprintf (st, " sim> SET CPU SIMHALT kernel HALT returns to simulator\n"); +fprintf (st, " sim> SET CPU CONHALT kernel HALT returns to boot ROM console\n\n"); +fprintf (st, "The CPU also implements a command to display a virtual to physical address\n"); +fprintf (st, "translation:\n\n"); +fprintf (st, " sim> SHOW {-kesu} CPU VIRTUAL=n show translation for address n\n"); +fprintf (st, " in kernel/exec/supervisor/user mode\n\n"); +fprintf (st, "Memory can be loaded with a binary byte stream using the LOAD command. The\n"); +fprintf (st, "LOAD command recognizes three switches:\n\n"); +fprintf (st, " -o origin argument follows file name\n"); +fprintf (st, " -r load the boot ROM\n"); +fprintf (st, " -n load the non-volatile RAM\n\n"); +fprintf (st, "The CPU supports the BOOT command and is the only VAX device to do so. Note\n"); +fprintf (st, "that the behavior of the bootstrap depends on the capabilities of the console\n"); +fprintf (st, "terminal emulator. If the terminal window supports full VT100 emulation\n"); +fprintf (st, "(including Multilanguage Character Set support), the bootstrap will ask the\n"); +fprintf (st, "user to specify the language; otherwise, it will default to English.\n\n"); +fprintf (st, "These switches are recognized when examining or depositing in CPU memory:\n\n"); +fprintf (st, " -b examine/deposit bytes\n"); +fprintf (st, " -w examine/deposit words\n"); +fprintf (st, " -l examine/deposit longwords\n"); +fprintf (st, " -d data radix is decimal\n"); +fprintf (st, " -o data radix is octal\n"); +fprintf (st, " -h data radix is hexadecimal\n"); +fprintf (st, " -m examine (only) VAX instructions\n"); +fprintf (st, " -p examine/deposit PDP-11 (compatibility mode) instructions\n"); +fprintf (st, " -r examine (only) RADIX50 encoded data\n"); +fprintf (st, " -v interpret address as virtual, current mode\n"); +fprintf (st, " -k interpret address as virtual, kernel mode\n"); +fprintf (st, " -e interpret address as virtual, executive mode\n"); +fprintf (st, " -s interpret address as virtual, supervisor mode\n"); +fprintf (st, " -u interpret address as virtual, user mode\n\n"); +fprintf (st, "The CPU attempts to detect when the simulator is idle. When idle, the\n"); +fprintf (st, "simulator does not use any resources on the host system. Idle detection is\n"); +fprintf (st, "controlled by the SET IDLE and SET NOIDLE commands:\n\n"); +fprintf (st, " sim> SET CPU IDLE{=VMS|ULTRIX|NETBSD|FREEBSD|32V|ALL}\n"); +fprintf (st, " enable idle detection\n"); +fprintf (st, " sim> SET CPU NOIDLE disable idle detection\n\n"); +fprintf (st, "Idle detection is disabled by default. Unless ALL is specified, idle\n"); +fprintf (st, "detection is operating system specific. If idle detection is enabled with\n"); +fprintf (st, "an incorrect operating system setting, simulator performance could be\n"); +fprintf (st, "impacted. The default operating system setting is VMS.\n\n"); +fprintf (st, "The CPU can maintain a history of the most recently executed instructions.\n"); +fprintf (st, "This is controlled by the SET CPU HISTORY and SHOW CPU HISTORY commands:\n\n"); +fprintf (st, " sim> SET CPU HISTORY clear history buffer\n"); +fprintf (st, " sim> SET CPU HISTORY=0 disable history\n"); +fprintf (st, " sim> SET CPU HISTORY=n enable history, length = n\n"); +fprintf (st, " sim> SHOW CPU HISTORY print CPU history\n"); +fprintf (st, " sim> SHOW CPU HISTORY=n print first n entries of CPU history\n\n"); +fprintf (st, "The maximum length for the history is 65536 entries.\n\n"); +return SCPE_OK; +} diff --git a/VAX/vax_defs.h b/VAX/vax_defs.h index 16b09848..8a957646 100644 --- a/VAX/vax_defs.h +++ b/VAX/vax_defs.h @@ -753,8 +753,11 @@ void cpu_idle (void); #endif extern t_stat cpu_load_bootcode (const char *filename, const unsigned char *builtin_code, size_t size, t_bool rom, t_addr offset); +extern t_stat cpu_print_model (FILE *st); extern t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc); +extern t_stat cpu_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr); +extern t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr); extern int32 clk_cosched (int32 wait); #endif /* _VAX_DEFS_H */ diff --git a/VAX/vax_sysdev.c b/VAX/vax_sysdev.c index 15789b35..809dfccf 100644 --- a/VAX/vax_sysdev.c +++ b/VAX/vax_sysdev.c @@ -1591,9 +1591,9 @@ sysd_powerup (); return SCPE_OK; } -t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) +t_stat cpu_print_model (FILE *st) { -fprintf (st, "model=VAX 3900"); +fprintf (st, "VAX 3900"); return SCPE_OK; } @@ -1640,3 +1640,33 @@ ssc_bto = 0; ssc_otp = 0; return SCPE_OK; } + + +t_stat cpu_model_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) +{ +fprintf (st, "Notes on memory size:\n\n"); +fprintf (st, "- The real KA655 CPU only supported 16MB to 64MB of memory. The simulator\n"); +fprintf (st, " implements a KA655\"X\", which increases supported memory to 512MB.\n"); +fprintf (st, "- The firmware (ka655x.bin) contains code to determine the size of extended\n"); +fprintf (st, " memory and set up the PFN bit map accordingly. Other than setting up the\n"); +fprintf (st, " PFN bit map, the firmware does not recognize extended memory and will\n"); +fprintf (st, " behave as though memory size was 64MB.\n"); +fprintf (st, "- If memory size is being reduced, and the memory being truncated contains\n"); +fprintf (st, " non-zero data, the simulator asks for confirmation. Data in the truncated\n"); +fprintf (st, " portion of memory is lost.\n"); +fprintf (st, "- If the simulator is running VMS, the operating system may have a SYSGEN\n"); +fprintf (st, " parameter set called PHYSICAL PAGES (viewable with\n"); +fprintf (st, " \"MCR SYSGEN SHOW PHYSICALPAGES\"). PHYSICALPAGES limits the maximum\n"); +fprintf (st, " number of physical pages of memory the OS will recognize. If it is set\n"); +fprintf (st, " to a lower value than the new memory size of the machine, then only the\n"); +fprintf (st, " first PHYSICALPAGES of memory will be recognized, otherwise the actual size\n"); +fprintf (st, " of the extended memory will be realized by VMS upon each boot. Some users\n"); +fprintf (st, " and/or sites may specify the PHYSICALPAGES parameter in the input file to\n"); +fprintf (st, " AUTOGEN (SYS$SYSTEM:MODPARAMS.DAT). If PHYSICALPAGES is specified there,\n"); +fprintf (st, " it will have to be adjusted before running AUTOGEN to recognize more memory.\n"); +fprintf (st, " The default value for PHYSICALPAGES is 1048576, which describes 512MB of RAM.\n\n"); +fprintf (st, "Initial memory size is 16MB.\n\n"); +fprintf (st, "The simulator is booted with the BOOT command:\n\n"); +fprintf (st, " sim> BOOT\n\n"); +return SCPE_OK; +}