Disabling the F6 interrupt function - VMS

This is a discussion on Disabling the F6 interrupt function - VMS ; On Oct 23, 8:20*am, koeh...@eisner.nospam.encompasserve.org (Bob Koehler) wrote: > In article , tadamsmar writes: > > > > > My theory is that next F6 key interrupt gets processed be for the AST > > is re-established. * I guess ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 23 of 23

Thread: Disabling the F6 interrupt function

  1. Re: Disabling the F6 interrupt function

    On Oct 23, 8:20*am, koeh...@eisner.nospam.encompasserve.org (Bob
    Koehler) wrote:
    > In article <73922e83-f9f3-4749-8eff-0677e1337...@m36g2000hse.googlegroups..com>, tadamsmar writes:
    >
    >
    >
    > > My theory is that next F6 key interrupt gets processed be for the AST
    > > is re-established. * I guess I am assuming that an AST can be
    > > interrupted by the next F6 Key interrupt. *Is that impossible?

    >
    > * *If the AST re-establishes itself, that prevents any main thread code
    > * *from running before the interrupt is passed on to the program.
    >


    Only main line code at the same or lower access mode is prevented from
    running. An AST at a higher mode can interrupt one at a lower mode.
    Assuming I know what I am talking about.

    But I had bored certified assistance with running the AST at executive
    mode and that did not work. Don't know how to run it at kernel mode.

    > * *But it doesn't prevent the device driver from processing the
    > * *interrupt.
    > Perhaps the AST needs to be set up as an attention AST
    > * *so the driver will know to fire it.


    How do you set up an attention AST?

    >
    > * *I've only dealt with this issue in custom drivers that weren't for
    > * *terminals. *And, of course, I could code those drivers to alwaysdo
    > * *what I wanted.


  2. Re: Disabling the F6 interrupt function

    On Oct 22, 2:03*pm, VAXman- @SendSpamHere.ORG wrote:
    > In article <829f6820-1ba5-4787-86d9-36a149df4...@d45g2000hsc.googlegroups..com>, tadamsmar writes:
    >
    >
    >
    >
    >
    > >On Oct 22, 10:42=A0am, tadamsmar wrote:
    > >> On Oct 22, 9:57=A0am, VAXman- =...@SendSpamHere.ORG wrote:

    >
    > >> > In article
    > >ps.com>, tadamsmar writes:

    >
    > >> > >On Oct 22, 8:28=3DA0am, tadamsmar wrote:
    > >> > >> On Oct 21, 4:58=3DA0pm, koeh...@eisner.nospam.encompasserve.org(Bob

    >
    > >> > >> Koehler) wrote:
    > >> > >> > In article <6e8b50bf-00b8-4085-aaf6-0c1d382b3...@u65g2000hsc.googl=

    > >egrou=3D
    > >> > >ps.com>, tadamsmar writes:

    >
    > >> > >> > > This solution is useful but not 100% reliable. =3DA0Only one AST=

    > > is
    > >> > >> > > established and it has to run to re-establish another. =3DA0If y=

    > >ou jam =3D
    > >> > >the
    > >> > >> > > F6 key down then I find that the F6 key eventually wins the race=

    > > with
    > >> > >> > > the re-establishment of the AST and causes an interrupt.

    >
    > >> > >> > =3DA0 =3DA0Can't the AST re-establish itself before exiting?

    >
    > >> > >> Yep, and mine does.

    >
    > >> > >> But the program would need to re-establish the AST before any other
    > >> > >> code was executed, like the code that delivers the next F6 key
    > >> > >> interrupt.

    >
    > >> > >> My theory is that next F6 key interrupt gets processed be for theAS=

    > >T
    > >> > >> is re-established. =3DA0 I guess I am assuming that an AST can be
    > >> > >> interrupted by the next F6 Key interrupt. =3DA0Is that impossible?

    >
    > >> > >> Perhaps the AST can be run at some kind of higher level to ensureit
    > >> > >> is not interrupted. =3DA0I have not had to deal with this kind of st=

    > >uff in
    > >> > >> a long time, there are cobwebs on what little I know about it.

    >
    > >> > >Higher mode, not higher level. =A0Maybe I need to run the AST at a
    > >> > >higher mode than the default mode?

    >
    > >> > Simple...

    >
    > >> > =A0 =A0 =A0 =A0 .PSECT =A0DATA,WRT,NOEXE,5
    > >> > CTRL_C_AST:
    > >> > =A0 =A0 =A0 =A0 .LONG =A0 3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > > =A0 =A0 =A0 =A0 ; 3 arguments
    > >> > =A0 =A0 =A0 =A0 .ADDRESS your_ctrl_c_ast_routine =A0 =A0=A0 =A0; DCLAS=

    > >T$_ASTADR
    > >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > > =A0 =A0 =A0 =A0 ; DCLAST$_ASTPRM
    > >> > =A0 =A0 =A0 =A0 .LONG =A0 0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=

    > > =A0 =A0 =A0 =A0 ; DCLAST$_ACMODE

    >
    > >> > =A0 =A0 =A0 =A0 .PSECT =A0CODE,NOWRT,EXE,5
    > >> > =A0 =A0 =A0 =A0 .ENTRY =A0some_name,0

    >
    > >> > =A0 =A0 =A0 =A0 $CMEXEC_S =A0 =A0 =A0 ROUTIN=3DSYS$DCLAST,-
    > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ARGLST=3DCTRL_C_AST

    >
    > >> > =A0 =A0 =A0 =A0 RET
    > >> > =A0 =A0 =A0 =A0 .END =A0 =A0

    >
    > >> > This will queue the AST for execution in EXECUTIVE mode. =A0You will
    > >> > need CMEXEC privilege to test this out. =A0If this works, you'll need
    > >> > to implement a user written system service or install your program
    > >> > with the CMEXEC privilege to allow this to function for the average
    > >> > non-privileged user.

    >
    > >> > --
    > >> > VAXman- A Bored Certified VMS Kernel Mode Hacker =A0 =A0 =A0VAXman(at)T=

    > >MESIS(dot)COM

    >
    > >> > ... pejorative statements of opinion are entitled to constitutional pro=

    > >tection
    > >> > no matter how extreme, vituperous, or vigorously expressed they may be.=

    > > (NJSC)

    >
    > >> > Copr. 2008 Brian Schenkenberger. =A0Publication of _this_ usenet articl=

    > >e outside
    > >> > of usenet _must_ include its contents in its entirety including thisco=

    > >pyright
    > >> > notice, disclaimer and quotations.- Hide quoted text -

    >
    > >> > - Show quoted text -

    >
    > >> So, in what context do I execute this function? =A0Looks like it just
    > >> queues the AST. =A0But, I need to specify the AST in the prevously
    > >> referenced SYS$QIO so it will queue when the F6 is pressed.- Hide quoted =

    > >text -

    >
    > >> - Show quoted text -

    >
    > >What is "your_ctrl_c_ast_routine"?

    >
    > >Is it the ast that is suppose to run when ctrl/c is hit? *I don't see
    > >how that would address the issue.

    >
    > >However if I run the routine that executes the QIO in executive mode,
    > >and I specify in the QIO call that the
    > >AST is to be run in executive mode then that should work.

    >
    > >That is, I need to run this (enanulirp) in executive mode:

    >
    > > * * * *integer*4 function enanulirp ()
    > > * * * *implicit none

    >
    > >C * * * ONE-LINE DESCRIPTION

    >
    > >CT * * *Enable null AST for CTRL/C (ENANULIRP)

    >
    > >C * * * FUNCTION (transformation on inputs to outputs)

    >
    > >CF * * * The ENANULIRP procedure disables the interrupt
    > >CF * * *caused by CTRL/C by replacing it with an AST that
    > >CF * * *does nothing except re-establish the AST.

    >
    > >C * * * DESIGN CONSIDERATIONS

    >
    > >CD * * *ENANULIRP is not 100% successful if CTRL/C or the F6 key is
    > >CD * * *held down, since the next interrupt may arrive before the
    > >CD * * *AST is re-established.

    >
    > >CD * * *ENANULIRP disables the CTRL/C that is delivered by the F6 key
    > >CD * * *when line editing is enabled for the terminal.
    > >CD * * *SMG$SET_OUT_OF_BAND_ASTS fails to do this.

    >
    > >CD * * *ENANULIRP does not interfere with SMG$SET_OUT_OF_BAND_ASTS;
    > >any
    > >CD * * *CTRL/C defined by SMG$SET_OUT_OF_BAND_ASTS will still run.

    >
    > >C************************************************* **********************

    >
    > >C * * * INCLUDE FILES

    >
    > > * * * *INCLUDE '($SYSSRVNAM)' * * * * * * * * * * * * *! System
    > >services
    > > * * * *INCLUDE '($IODEF)' * * * * * * * * * * * * * * *! $QIO
    > >function codes
    > > * * * *include '($psldef)' * * * * * * * * * * !PSL symbolic names
    > >C * * * PARAMETER DECLARATIONS

    >
    > >C * * * ARGUMENT DECLARATIONS

    >
    > >C * * * VARIABLE DECLARATIONS

    >
    > > * * * *integer*4 * * * iosb(2) * * * * * * * * !I/O Status block
    > > * * * *integer*2 * * * chn * * * * * * * * * * !Channel
    > > * * * *save chn
    > > * * * *integer*4 * * * sts * * * * * * * * * * !Completion status

    >
    > >C * * * SUBPROGRAM DECLARATIONS

    >
    > >C * * * EXTERNAL DECLARATIONS

    >
    > > * * * *external * * * *nulirpast
    > > * * * *external * * * *ss$_normal

    >
    > >C * * * PROGRAM LOGIC

    >
    > >CL.le; *Initialize the status variable.

    >
    > > * * * *sts =3D %loc(ss$_normal)

    >
    > >CL.le; *Enable AST so that NULIRPAST is called when Ctrl/C is pressed.

    >
    > > * * * *if (chn .eq. 0) then
    > > * * * * sts =3D sys$assign ('tt:', chn,,,)
    > > * * * *end if

    >
    > > * * * *if (sts) then
    > > * * * * sts =3D sys$qiow
    > >(, * * * * * * * * * * * * * * * * * * * * * * *! * * * *(3)
    > > * * * *1 * * * * * * * * * * * %val(chn),
    > > * * * *1 * * * * * * * * * * * %val(IO$_SETMODE .or. IO$M_CTRLCAST),
    > > * * * *1 * * * * * * * * * * * iosb,,,
    > > * * * *1 * * * * * * * * * * * nulirpast,,%val(psl$c_exec),,,)
    > > * * * *end if

    >
    > >CL.le; *Set the return status.

    >
    > > * * * *enanulirp =3D sts

    >
    > > * * * *return
    > > * * * *end

    >
    > >And that will cause nulirpast to be called:

    >
    > > * * * *subroutine nulirpast ()
    > > * * * *implicit none

    >
    > >C * * * INCLUDE FILES

    >
    > >C * * * PARAMETER DECLARATIONS

    >
    > >C * * * ARGUMENT DECLARATIONS

    >
    > >C * * * VARIABLE DECLARATIONS

    >
    > > * * * *integer*4 * * * sts * * * * * * * * * * !Completion status

    >
    > >C * * * SUBPROGRAM DECLARATIONS

    >
    > > * * * *integer*4 enanulirp

    >
    > >C * * * EXTERNAL DECLARATIONS

    >
    > > * * * *external * * * *ss$_normal

    >
    > >C * * * PROGRAM LOGIC

    >
    > >CL.le; *Initialize the status variable.

    >
    > > * * * *sts =3D %loc(ss$_normal)

    >
    > >CL.le; *Re-establish the AST

    >
    > > * * * *sts =3D enanulirp()
    > > * * * *if (.not. sts) then
    > > * * * * *call lib$signal(%val(sts))
    > > * * * *end if

    >
    > > * * * *return
    > > * * * *end

    >
    > OK. *You can't pass PSL$C_EXEC as the AST mode and expect it to fire off
    > in EXECUTIVE mode if you are calling the $QIO from USER mode. *You need
    > to invoke the $QIO from EXECUTIVE mode. *The CTRL-C AST is a one-timer!
    > You need to reenable it in the AST. *You can, since your AST will be in
    > EXECUTIVE mode, invoke the $QIO there to reenable the AST. *I suspected
    > that you ALREADY had this AST routine coded in this fashion and suggest-
    > ed that you use the $DCLAST to invoke the AST the first time out.
    >
    > You also have NOT specified an event flag. *Thus, you get the default of
    > EFN=0. *This can cause all sorts of strange issues for other bits of your
    > code waiting on event flags. *Include ($EFNDEF) and pass EFN$C_ENF in the
    > $QIO (first arg) by %VAL.


    Thank you so much for mentioning the efn issue. It caused serious
    problems for VMS when I tried to start the app from a batch file (but
    no problem for interactive startups during testing.) I would really
    be stumped if you had not mentioned this.


    >
    > I'd answer sooner if I didn't have to read quoted-pukeable Fortran code.
    >
    > --
    > VAXman- A Bored Certified VMS Kernel Mode Hacker * * *VAXman(at)TMESIS(dot)COM
    >
    > ... pejorative statements of opinion are entitled to constitutional protection
    > no matter how extreme, vituperous, or vigorously expressed they may be. (NJSC)
    >
    > Copr. 2008 Brian Schenkenberger. *Publication of _this_ usenet article outside
    > of usenet _must_ include its contents in its entirety including this copyright
    > notice, disclaimer and quotations.- Hide quoted text -
    >
    > - Show quoted text -



  3. Re: Disabling the F6 interrupt function

    In article , tadamsmar writes:
    >
    > But I had bored certified assistance with running the AST at executive
    > mode and that did not work. Don't know how to run it at kernel mode.


    Even a kernel mode AST won't block device driver routines, since they
    are at higher IPL.

    >> =A0 =A0But it doesn't prevent the device driver from processing the
    >> =A0 =A0interrupt.
    >> Perhaps the AST needs to be set up as an attention AST
    >> =A0 =A0so the driver will know to fire it.

    >
    > How do you set up an attention AST?


    I've seen this done in an application, but it's been a long time.
    The terminal driver itself does not allow you to specify an attention
    AST. But you can associate a mailbox with the terminal via the
    $ASSIGN system service and hang the ASTs off the mailbox. I/O User's
    Guide section 5.2.4 goes into this.

    The mailbox will not get user data, it just gets status information,
    like notifying you of unsolicited input.

    IIRC, we had to set the terminal /noescape, which needed to be
    changed if we then wanted to use EDT on the same terminal. But that
    may have been due to the data we were reading.

    IIRC, we disabled ^Y from DCL before bringing up the application.