From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10891a,99a64c15f8d0157e X-Google-Attributes: gid10891a,public X-Google-Thread: 103376,99a64c15f8d0157e X-Google-Attributes: gid103376,public From: jerry@jvdsys.nextjk.stuyts.nl (Jerry van Dijk) Subject: Re: GNAT and interrupts with DJGPP and CWSPR0 Date: 1996/08/15 Message-ID: #1/1 X-Deja-AN: 174499038 references: <32110129.3C6E@ee.ubc.ca> organization: * JerryWare HQ * followup-to: comp.lang.ada,comp.os.msdos.djgpp newsgroups: comp.lang.ada,comp.os.msdos.djgpp Date: 1996-08-15T00:00:00+00:00 List-Id: I'm not sure whether this will go out... Greg Bond (bond@ee.ubc.ca) wrote: : Since I'm using CWSPR0 (a ring 0, no frills DPMI server that disables : virtual memory) This solves the problem of not being able to lock all memory used by the interrupt handler, but still leaves the problem of real mode interrupt defection by DPMI, if you access the first megabyte. > I believe I still might be able to access memory : locations directly (anyone know enough to disagree?). Accessing memory locations directly will work anyway by using the djgpp library. : So my thought was : that I could install a (mostly) Ada interrupt handler in Ada using the : 'for', 'use' keywords to assign an address to the interrupt handler. Yep, in theory this should work, if you tell GNAT that this is a callback function (so its C-style callable). However, you run into problems if you try to use arguments. And don't forget using the right stack :-) : Since I've got to include some assembly language in the handler itself, : I could use the Ada handler as a wrapper to call a C/assembly handler : via Ada's foreign language interface. If that's the case, why not write the whole handler in C ? : The design I have in mind is to have an Ada interrupt task wait on a : guarded entry of a protected object for interrupt events (the : recommended way of handling interrupts in GNAT). Oops, that changes things a bit. I'm not sure how interrupt safe the DOS port of pthreads really is.... : If it won't work, what : are my alternatives? The only alternative I can think of is polling the : hardware directly from the interrupt task This depends on what you are trying to archive. And the interrupt frequency you are looking at. Jerry.