Keyboard Shortcuts
Likes
- H390-Vm
- Messages
Search
This group is for all folks running the original IBM VM/370 Release 6 operating system (or later (e.g. VMTCE (Community Edition)) on Hercules. Like the other early IBM operating systems this version has always been in the public domain and so can be freely distributed. The base version as supplied by IBM is lacking in many facilities. IBM solved this by providing additional extension products which were licensed and so are not available. There are however many user enhancements available which can be installed. In addition, in order to get users up and running quickly updated "releases" of VM/370 included the most popular updates are available for download, so novices can start to learn VM without having to delve into the system internals. It is intended that this wiki will provide information on the base release and these updates.
The available versions are here :-
?
?
Re: Program Interrupts (signals)
开云体育Adrian, ? I think that would be a challenge and you would either waste lot of time polling the flag, or risk running for a long time before detecting it. I must say CMS is by design, single threaded, pretty much interrupt free, so it uses blocking CP calls for disk IO, for example. The idea was that anything “multi” was handled by CP. Especially at the level we are at there is very clean divide between CP and CMS. CP provides a virtual 370 (VM) to each user. It manages mapping the users virtual world back to the “real” world. Virtual devices back to real devices and stops users from trampling on each other. Handling device sharing… ? … this means CMS is pretty simple about the same as MS DOS 1.1. No directories, no virtual memory, no shared file store, no passwords. All it sees is a console, some disks, and a reader/punch/printer. It knows nothing of any other virtual machine. So for example the MVS file IO simulation is much smaller and lighter than the MVS equivalent, but it does not have to worry about concurrent access… ? Dave ? ? From: [email protected] <[email protected]> On Behalf Of adriansutherland67
Sent: 23 April 2020 12:31 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? On Thu, Apr 23, 2020 at 11:02 AM, Dave Wade wrote:
Thanks Dave |
Re: Program Interrupts (signals)
On Thu, Apr 23, 2020 at 11:02 AM, Dave Wade wrote:
Thanks Dave Great find however. Would this work: Could I use the HX suppression mod to stop HX. But them within GCCLIB poll the HX flag myself (is there a flag?) and if set, exit gracefully. By the way if this works it means I can make HX do what HI does for BREXX if that makes sense. A |
Re: Program Interrupts (signals)
On Thu, Apr 23, 2020 at 10:26 AM, Joe Monk wrote:
I think?you might be slightly confused.I think I am very confused :-) What I will do is - Make sure the GCCLIB internals is worked wrt signals (fake signals if you like) - Do a PoC with SPIE?etc. and see what happens with closing files, memory etc etc. See what (if anything) HX does. That might be a stopgap or the final answer. - Suggest a "pure-CMS" approach that Rob (and others) might want to help on. Obs IBM introduced ABNEXIT to fill this very gap - and maybe that is the spec (but that might be much too hard to do), it can be more rough and ready as its only user will be GCCLIB. And I will do some diagrams to help people understand the dependencies now between the resident nature of GCCLIB, BREXX, and other GCCLIB clients.? It is interesting. And it kind of shows the rough and ready nature of CMS itself - certainly back in the day (I don't? know now). It must have been a culture shock for the OS guys :-) |
Re: Program Interrupts (signals)
开云体育Joe, ? How can CP ABEND? Really CP is a distraction in this case AND CAN BE IGNORED. Saying CP ABENDS is like saying MVS abends when a program interrupts. Certainly, CP will receive control because CMS is running in REAL problem state. But CP will simulate the effect of the divide by zero and pass control to the address specified in the VM’s low storage location, just as if CMS was running on real hardware . ?A program running in a VM always runs in real problem state. If its in virtual supervisor state then CP has to simulate any operations the VM carries out that require real supervisor state, converting between real/virtual addresses as required. In this case CMS is un-aware that CP got involved. All it knows is it plugged an address, as part of a new PSW into the appropriate low store location, a pic 9 has occurred, and execution has transferred to the handler pointed to by the new PSW. The address where the exception occurred will be part of the old psw in the VM’s low store. S/370 hardware is designed so that any operation that could allow the supervisor state to be examined is a privileged instruction. ? ?This is not true for XA onwards which is why you need SIE for VM on these architectures….. ? Adrian, ? Sadly my searches indicate that catching HX needs a CMS mod. ? ? (note that’s SP3 that’s mentioned in there which is much later than R6) ? Dave ? From: [email protected] <[email protected]> On Behalf Of Joe Monk
Sent: 23 April 2020 11:26 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? I think?you might be slightly confused. ? Lets take the example of a divide by zero. ? CMS will not abend that. Rather, CP will because its a hardware abend.?You will get a PIC 9.?CMS will detect it and take action by default, which may be undesirable. Within a C runtime, you can trap a PIC 9 by issuing a SPIE, and specifying?an exit to take. ? SPIE stands for Set Program Interrupt Exit.? ? So, as part of your C runtime prolog, you issue an SPIE for PIC 9 before you give control to main, and set a branch to a location where you have the ability to cleanly close any IO in process and de-allocate?any memory before termination by the C runtime epilog. ? Joe ? On Thu, Apr 23, 2020 at 4:58 AM adriansutherland67 <adrian@...> wrote:
|
Re: Program Interrupts (signals)
I think?you might be slightly confused. Lets take the example of a divide by zero. CMS will not abend that. Rather, CP will because its a hardware abend.?You will get a PIC 9.?CMS will detect it and take action by default, which may be undesirable. Within a C runtime, you can trap a PIC 9 by issuing a SPIE, and specifying?an exit to take. SPIE stands for Set Program Interrupt Exit.? So, as part of your C runtime prolog, you issue an SPIE for PIC 9 before you give control to main, and set a branch to a location where you have the ability to cleanly close any IO in process and de-allocate?any memory before termination by the C runtime epilog. Joe On Thu, Apr 23, 2020 at 4:58 AM adriansutherland67 <adrian@...> wrote: On Thu, Apr 23, 2020 at 09:52 AM, Dave Wade wrote: |
Re: Program Interrupts (signals)
On Thu, Apr 23, 2020 at 09:52 AM, Dave Wade wrote:
Doesn’t SPIE cover all of these. Also STAE is availableYou see - I have no idea really! I can only follow advice. There are two additional concerns, which are specific if GCCLIB. 1/ If a CMS Abent clears freemen (and I think it doesn't?), we have a bit of a problem because multiple programs memory will be trashed so I would seek to stop the CMS ABEND and instead just close the program if that makes sense? 2/ HX ... how can I convert that to a signal? |
Re: Program Interrupts (signals)
开云体育Doesn’t SPIE cover all of these. Also STAE is available ? Dave ? From: [email protected] <[email protected]> On Behalf Of adriansutherland67
Sent: 23 April 2020 09:58 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? This link is a short (short means good for me!) background of what we are trying to achieve |
Re: Program Interrupts (signals)
开云体育Bob, ? Well a few reasons for using “C”. First is we have a decent “C” compiler and when I last used a mainframe the thing that stopped us using “C” was the dreadful SAS “C” compiler. Its better than “B” and any way we don’t have a “B” compiler. Bell Labs had a “C” compiler, but it appears lost. Of course the main reason we use “C” is because we can deliver working code more quickly than we could in assembler, and re-use existing code as was done with BREXX. However given the issues with BREXX perhaps its time for a re-write in assembler… … oh and DIAG works because you are running in real problem state, allowing CP to gain control. Pretty sure DIAG in a VM works regardless of the virtual supervisor state ? Dave ? ? From: [email protected] <[email protected]> On Behalf Of Bob Polmanter
Sent: 22 April 2020 23:57 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? Adrian,
In a virtual machine, CMS runs in supervisor state so you can alter the PSW or any storage area you like.? Of course you need to know what you are doing and which specialized instructions to use.
? |
Re: Program Interrupts (signals)
On Wed, Apr 22, 2020 at 10:57 PM, Bob Polmanter wrote:
You say you just want to be notified that an abend occurred, but how exactly??Thanks for the possibility of assistance. I will pull together details for what I think is needed and why, for discussion, review, refinement, and to see if you think it is feasible and something you would support. In sum however, at the very least I would like to be able to register a callback (exit routine) that will let me know my program is about to be abended. In the Unix world they use the word signals ... trapping signals ... some can be masked (so you can choose to stop the default behaviour) and some can't. Over time, weird conventions have developed, like getting a hangup signal is used to make your program reread it's configuration files rather than exit. We digress! I will provide more structured thoughts! The question we need to debate is what "signal" types exist or are meaningful on CMS. The important one is KILL or TERMinate.? One outstanding question is what does HX do and how can this be trapped because it sounds like this (like HI) is a polled flag? As for the more general question ... I just want to be able to get the existing body of c programs to run on CMS, like brexx, sqllite, etc. BTW all I need for a simple pthreads implementation is a timer interrupt. And plenty of mutexs in front of CMS calls! A |
Re: Program Interrupts (signals)
开云体育CMS runs in supervisor state only, it only uses storage keys to differentiate between nucleus (supervisor) and user storage. This is also why an application program under CMS can issue diagnose instructions (and CP commands via diag 8) without shifting into supervisor state – it’ already there. ? Mark ? ? From: [email protected] <[email protected]> On Behalf Of Dave Wade
Sent: Wednesday, April 22, 2020 3:18 PM To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? Adrian Do you know, I can’t remember if you need you need to be in supervisor state. ?I seem to think not, just have the right storage keys set…. … while looking for info on PSW hooking I found this note.. ? ? to do with memory management, CMS and Fortran… … any way I couldn’t find a PSW hooking program. I would use SPIE otherwise you run the risk of borking CMS by not putting back the old PSW at program end.. ? Dave ? From: [email protected] <[email protected]> On Behalf Of adriansutherland67 ? On Tue, Apr 21, 2020 at 07:44 PM, Bob Polmanter wrote:
After reading a bit more. |
Re: Program Interrupts (signals)
Adrian,
In a virtual machine, CMS runs in supervisor state so you can alter the PSW or any storage area you like.? Of course you need to know what you are doing and which specialized instructions to use.
? |
Re: Program Interrupts (signals)
开云体育Adrian Do you know, I can’t remember if you need you need to be in supervisor state. ?I seem to think not, just have the right storage keys set…. … while looking for info on PSW hooking I found this note.. ? ? to do with memory management, CMS and Fortran… … any way I couldn’t find a PSW hooking program. I would use SPIE otherwise you run the risk of borking CMS by not putting back the old PSW at program end.. ? Dave ? From: [email protected] <[email protected]> On Behalf Of adriansutherland67
Sent: 22 April 2020 22:41 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? On Tue, Apr 21, 2020 at 07:44 PM, Bob Polmanter wrote:
After reading a bit more. |
Re: Program Interrupts (signals)
On Tue, Apr 21, 2020 at 07:44 PM, Bob Polmanter wrote:
More commonly back in the day, it was necessary to write your own program check interruption handler because CMS at the time lacked the necessary structure to provide this kind of capability at the application level.? This would necessarily need to be in assembler too, and involves temporarily stealing CMS's program check new PSW and replacing it with your own that points to your handler, and putting back CMS's PSW before your application exits for goodAfter reading a bit more. Presumably they chained the PSWs so that the injected one only did what it needed to do and "called" the official CMS new PSW for anything it did not understand? Otherwise you have a massive job! Any examples? So under problem mode can you really manipulate the PSW in this way? Or do I have to change mode and is that possible in CMS, etc etc? I am just working out if this is a feasible approach for a hacker like me ... |
Re: memset help
On Tue, Apr 14, 2020 at 06:15 AM, pjfarley3 wrote:
MEMSET16.txt uses 2 more registers than MEMSET.txt but replaces the length=255 MVC instruction with multiple STore operations (loop 16 times storing 4 bytes at a time 4 times for each loop around).? MVC was notoriously slow on some real-iron IBM hardware models.Hi Peter ... I am testing these now and there is a bug in this one. My test harness is using unaligned big (4096) blocks and tests the contents top down. There is a mismatch on the 16th (approx) char from the BEGINNING (i.e. the top 4080 chars are ok). Actually it varies related to alignment. The other 2 work fine. We have 3 assembler and 3 c implementation. 5 pass the functional test. I have not done the performance run, I have no sense at all on which is faster. I will hold off the performance test if you want to try and fix this one? A :-) |
Re: Program Interrupts (signals)
开云体育Adrian ? The problem with OS Macros are that at program end they clean up. So if you use system/svc202 to run an OS, and your program also uses OS macros they don’t always work after the called program ends. as files are closed and storage released. I hope SPIE doesn’t GETMAIN any storage so that should not be a problem. Its not involved in file IO so that’s not an issue either. However I expect any SPIE exits loaded will be cleared when an OS program exits, so if you use SVC202/SYSTEM() to call another program, you will probably need to re-establish the SPIE exits on its return. ? Dave ? ? ? From: [email protected] <[email protected]> On Behalf Of adriansutherland67
Sent: 21 April 2020 22:33 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? On Tue, Apr 21, 2020 at 08:06 PM, Dave Wade wrote:
Not sure what you mean ... how can I use os interrupt handlers without os macros? |
Re: Program Interrupts (signals)
开云体育I guess it issues SPIE as its MVT code and so in its natural environment it can’t snag the program exception new psw. I haven’t looked at the source, but you could trace it with PER … ? Dave ? From: [email protected] <[email protected]> On Behalf Of adriansutherland67
Sent: 21 April 2020 22:27 To: [email protected] Subject: Re: [h390-vm] Program Interrupts (signals) ? On Tue, Apr 21, 2020 at 09:21 PM, Joe Monk wrote:
Exactly. But I need a hint about how to catch it! How does the Fortran runtime do it? |