TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: J. Eberbach 106147,521 (X)
from: J. Eberbach 106147,521
date: 1996-10-11 08:48:13
subject: #21482-#Fast IRQ

#: 21483 S12/OS9/68000 (OSK)
    11-Oct-96  08:48:13
Sb: #21482-#Fast IRQ
Fm: J. Eberbach 106147,521
To: J. Eberbach 106147,521 (X)

since noone ever replied, and since I also didn'T get any help from Microware
or Dr. Keil, I had to find out for myself.

So here is an example:

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include "/mwos/os9/src/defs/machine/reg.h"

/*make this program system state */
_asm("_sysattr: equ 0xA001");


/**********************************************************************/

int irqsvc_f_t1();
void *get_global_base(void);

int irq_timer1(char *system_globals) {

        /* do your interrupt service */

        return(0);
}

/**********************************************************************/

#define CLEAN_UP \
        /* cleanup paths */ \
        prc->_path[0]=0;    \
        prc->_path[1]=0;    \
        prc->_path[2]=0;

main () {
        error_code err;

        register procid *prc = sysglob(procid*, D_Proc);

        /* fix up standard i/o for a system state process */

        stdin  -> _fd = prc->_path[0];
        stdout -> _fd = prc->_path[1];
        stderr -> _fd = prc->_path[2];

        _from_new(stdin); _from_new(stdout); _from_new(stderr);

        /* install interrupt service routines */
        if (err = _os_firq(VMEVT1, 0, irqsvc_f_t1, get_global_base()))
                exit(_errmsg(error, "Can't install timer1 interrupt service
routine.\n"));
        else{
                printf ("Timer1 Interrupt service routine installed!\n");
        }

        /* Setup hardware to produce interrupts */
        /* enable interrupts */

        /* do your stuff */

        /* disable inhrwhu
atRsO- ema eae0(-2mreoditrprsoeeoteVE2 odbalt ae,M,b omsapctn
tsrbb o ng.
Rad,
JtPs
					
SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.