¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

DOS/VS and supervisor state


 

Hi,

I'm curious to know if anyone in this forum knows how to obtain supervisor state in an assembler program running on DOS/VS - ideally using a kind of standard interface?

I certainly know how to do this in MVS and z/OS, but DOS/VS lacks facilities like AC(1) and the concept of authorised libraries.
I searched the manuals to see if some of the IBM-defined standard SVCs could do this, but so far without luck.
I seem to recall that some 3rd party vendors installed a SVC of their own to do the trick.

Any help would be greatly appreciated.

Best regards,

Steen


 

Hi

Sorry - I don't know answer to your question, but I'm wondering why do you want set into supervisor state in assembler program. As I know, DOS/VS (not modern VSE) is strictly batch environment and moving into privilleged state may destroy system structures

Aftter short search I found, that In current z/VSE exists concept of SUBsystems. There is also macro SUBSID with option NOTIFY, which lets mark caller as some kind of? subsystem and lets it call other supervisor macros. I'm not sure that such mechanizm exixts in DOS/VS.

Piotr


 

The answer is in the name, supervisor state is for code in the supervisor. Does your code have a legitimate need for supervisor state?
Where there is a need for such code, that is not required to be a permanent part of the supervisor in DOS(/VS,/VSE,etc), it can be in a ??B transient routine,
which is the technique DOS uses for things like file open logic, but it has a high overhead per use.
I believe programs like DITTO use this approach by adding an additional ??B transient for legitimate required extra function.
Alternatively you could add an extra SVC to the supervisor if you wish it to have a gaping integrity hole for any rogue or faulty user code.
Regards
Eddy Balem


 

Hi Piotr,

The reason that I need to switch to Supervisor state is that I'm working on a program that traverses the supervisor and the various control blocks. During this traversal I need to execute priviliged instructions.

While thinking about this problem I got the idea that a B-transient might do the trick for me in combination with SVC 2 and 11.
I will try down that path.

For your information; DOS/VS was not strictly a batch system. I started my career as system programmer in 1983 using DOS/VS and CICS. For licensing reasons CICS is unfortunately not available on DOS/VS.
You are absolutely right about the risk of destroying system structures when entering supervisor state, but that's a risk I'm willing to take :-)

BR,

Steen


 

Hi Eddy,

Thanks for your reply.

I just came across it while replying to another message in this thread.
It seems that we both saw an opportunity in using a B-transient. To me this seems a bit easier to implement than an extra SVC, which as you point out introduces a great security risk.

BR,

Steen


 

Steen Hansen wrote:

I'm curious to know if anyone in this forum knows how to
obtain supervisor state in an assembler program running
on DOS/VS - ideally using a kind of standard interface?
Standard interface? No. There was no such thing in DOS/VS.

There *is* however a non-standard technique. ;-)

Write yourself a very simple $$B transient (e.g. "$$BSUPK0") that either gives, or takes away, Supervisor State and Key 0 from the caller (and by caller I mean a regular program running within a partition).

At the very beginning of every partition is a save area used by the operating system to save your PSW and registers. Your $$B logical transient then simply sets or clears the appropriate bits in the partition's saved PSW field in the partition save area, and then exits. The operating system then re-loads the partition's registers (and PSW too obviously!) from the partition save area and re-dispatches your partition. VOILA! Instant Supervisor State and Key 0!

It's a sneaky/cheap (fast/easy) way to obtain or relinquish Supervisor State and Key 0 whenever you program needs it. We used this technique quite a bit at the shop I used to work at years and years (and YEARS!) ago.

Details: (forgive the sloppy formatting)


LA R0,... <--- request code
LA R1,=CL8"$$BSUPK0"
SVC 2


$$BSUPK0:

USING COMREG,R1 PARTITION COMMUNICATIONS REGION
USING PIBADR,R2 PARTITION INFORMATION BLOCK
USING SVEARA,R3 PARTITION SAVE AREA

L R1,20 R1 --> COMREG
LH R2,PIBPT R2 --> PIB table
L R3,PIBSAV2-1 R3 --> PART save area

NI SVEPSW+1,X'FE' Set Supervisor State
OI SVEPSW+1,X'01' Set Problem State
NI SVEPSW+1,X'0F' Set Protect Key-0
MVZ WORK,PID+1 Build partition key
MVZ SVEPSW+1(1),WORK Set partition key

SVC 11

WORK DC X'00'

MAPCOMR ,
MAPPIB ,

SVEARA DSECT LTA AND PP SAVE AREA
DS 2F FORMERLY USED FOR NAME
SVEPSW DS F FIRST HALF OF PSW
SVEPSW2 DS F SECOND HALF OF PSW
... (snip) ...


Hope that helps!

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


 

Very interesting ...

So, how does one go about designing and coding a "$$B" transient?? ?

And, then, how does one invoke such a "transient" at runtime?

(My background is more VM/CMS and MVS, and not much DOS, so ... bear that in mind when answering.)

Thanks.


 

Mark Waterbury wrote:

Very interesting ...

So, how does one go about designing and coding a "$$B" transient?

And, then, how does one invoke such a "transient" at runtime?

(My background is more VM/CMS and MVS, and not much DOS, so ...
bear that in mind when answering.)
Who the heck are you replying to?!

Providing some CONTEXT(*) would be nice!


(*) Providing context involves "quoting" (**), in your reply, what the other person said that your reply is responding to, so that other people reading your reply can then follow the conversation.

(**) Including in your reply what the other person said, preceding it with the appropriate number of '>' characters.

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


 

Fish wrote:

[...]
Who the heck are you replying to?!

Providing some CONTEXT(*) would be nice!
FYI:

Groups.IO Help Center:

"Quoting messages you are replying to"

/helpcenter/membersmanual/1/working-with-group-messages/quoting-messages-you-are-replying-to

--
"Fish" (David B. Trout)
Software Development Laboratories

mail: fish@...


 

Hi David,

This is a most elegant solution to my problem. I hadn't thought of just flipping bits of the PSW of the partition save area.
Thanks a lot - this was most helpful.

BR,

Steen