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: 103376,fe5641bca012dada X-Google-Attributes: gid103376,public From: Markus Kuhn Subject: Re: help about handling interrupts Date: 1998/04/06 Message-ID: <3529047A.44EE08B8@cl.cam.ac.uk>#1/1 X-Deja-AN: 341397280 Content-Transfer-Encoding: 7bit References: <3528B9E0.6F0F@bipa162.bi.ehu.es> Content-Type: text/plain; charset=us-ascii Organization: Cambridge University, Computer Laboratory Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-04-06T00:00:00+00:00 List-Id: Igor Pascual Sagastagoitia wrote: > > I am learning ADA95 and I am searching for an example of attaching a > procedure when an interrupts rises. > I read the RM95 but I dont understand it too well because of my > language. > I am programming under GNAT 3.10 for a Linux platform. Like many of those hardware related questions, this is more a matter of your operating system than a matter of Ada. Therefore you should look into the Linux kernel first how interrupt handling is done there and not into the RM. User processes cannot directly handle interrupts under Linux. If you want to write an interrupt handler yourself, you have to do this in a loadable kernel module. You can write loadable kernel modules in Ada just like you can do this in C. You have to call a kernel function at module load time that registers your Ada procedure as an interrupt handler, and then the Linux kernel will call your Ada procedure whenever this interrupt comes in. Markus -- Markus G. Kuhn, Security Group, Computer Lab, Cambridge University, UK email: mkuhn at acm.org, home page: