hercules-390 / hyperion

Hercules 390
Other
246 stars 69 forks source link

Bug in hercules startup #212

Closed joemonk64 closed 7 years ago

joemonk64 commented 7 years ago

When Hercules starts up, it appears the defaults are being taken first and then the config file is being applied, versus starting up in the specified mode.

Example...

Config file:

ARCHLVL S/370 CPUMODEL 3083 MAINSIZE 8

Hercules Startup:

HHC00811I Processor CP00: architecture mode z/Arch
HHC00811I Processor CP00: architecture mode S/370
HHC00100I Thread id 00002708, prio -20, name Timer started
HHC02204I archmode set to S/370 HHC17003I MAIN storage is 8M (mainsize); storage is not locked
HHC02204I cpumodel set to 3083
HHC00100I Thread id 00001bd4, prio 0, name Control panel started

As we can see the ARCHLVL was set to z/Arch even though I specified S/370 in config file. Then the config file was applied and the ARCHLVL, CPUMODEL and MAINSIZE were set.

ivan-w commented 7 years ago

How is this a bug ?

joemonk64 commented 7 years ago

Why is hercules starting up in a mode other than what I specified in its config file?

ivan-w commented 7 years ago

What does it matter ? Once the configuration file is processed, the configuration of the system matches the configuration statements.

joemonk64 commented 7 years ago

Because we're activating features and functionality that shouldn't be turned on in the first place for the mode.

For instance, if I start the CPU in z/Arch, that activates 64-bit support. Yet S/370 doesn't have a clue about 64-bit. So why turn on all the 64-bit code only to have to turn it off? Why not just not activate it to begin with?

ivan-w commented 7 years ago

The system will be in S/370 architecture mode with S/370 features at the end of the processing of the configuration file. Whatever processing occurs and whatever intermediate state the system goes through during Power On/IML is irrelevant.

ivan-w commented 7 years ago

Joe, You also have to realize.. First, setting the architecture mode in the config file basically just sets a few flags in the SYSBLK control block (structure) and emits a message to the console. This affects how the CPU is run (what cpu_run version to dispatch) when the system is eventually IPLed or a SYSTEM RESTART occurs.

Second, the reason it occurs this is way is because configuration statements (besides device statements) are basically console commands. So when hercules starts, the architecture is set to an arbitrary architecture. The architecture that is to be used when Power On Reset is complete (when hercules has completed initialization) is then set by the ARCHLVL command.

Third, an architecture switch may occur 'mid flight' due to a SIGP instruction or an IPL manual control. For example, if you have a z/Arch OS and define ARCHLVL z/Arch, you will see upon IPL the system starting as z/Arch, going to ESA/390 mode (because of IPL), then back to z/Arch mode (because of SIGP).

joemonk64 commented 7 years ago

Alright, I'm going to close this for now.