comp.lang.ada
 help / color / mirror / Atom feed
From: "Carroll-Tech" <andrew@carroll-tech.net>
To: <comp.lang.ada@ada-france.org>
Subject: Hardware Interrupts
Date: Sat, 21 Feb 2004 13:39:40 -0700
Date: 2004-02-21T13:39:40-07:00	[thread overview]
Message-ID: <mailman.4.1077394968.327.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: 20040221110026.E93C54C40C5@lovelace.ada-france.org

Has anyone here read "Ada Concurrent Programming" by Narain Gehani?
In the book, Narain talks about address clauses.  For example:

task Interrupt_handler is
    entry DONE;
    for DONE use at 16#40#;
end Interrupt_handler;

Can an address clause be done with a procedure or function instead of a
task entry?
What about arguments?
How can I capture a return value, if there is one?

I want to call the BIOS interrupt (INT11h) to get the equipment list
word.  In my Assembly book it says that INT11h "returns" a word
containing the equipment list.  I'm assuming that a '1' at a given bit
within the word means the equipment is in the computer and '0' is not.

Here is my code so far
-------------------------------------------------------
with ada.text_io; use ada.text_io;
with system.interrupts; use system.interrupts;

procedure getequipment is
 type equiplist is array(0..15) of boolean;
 package boolean_io is new enumeration_io(boolean);
 procedure getlist(list: out equiplist);
 for getlist use at reference(16#11#);
 mylist: equiplist;

begin
 getlist(mylist);

-- for I in 0..15 loop
--  boolean_io.put(mylist(i));
-- end loop;
end getequipment;
------------------------------------------------------

When I compile this code the compiler says several things
that I do not know how to fix.

getequipment.adb:2:12: warning: "system.interrupts" is an internal GNAT unit
getequipment.adb:2:12: warning: use of this unit is non-portable and
version-dependent
getequipment.adb:7:09: missing body for "getlist"
getequipment.adb:8:13: address clause can only be given for imported
subprogram

Any ideas?

Maybe there is an easier way to call INT11h from Ada?
I looked into System.Machine_Code and the ASM procedure but that seems
pretty
complex (per GNAT reference manual explanation).






       reply	other threads:[~2004-02-21 20:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040221110026.E93C54C40C5@lovelace.ada-france.org>
2004-02-21 20:39 ` Carroll-Tech [this message]
2004-02-21 21:32   ` system calls, was Re: Hardware Interrupts tmoran
     [not found] ` <000501c3f8bb$189b2760$0201a8c0@win>
2004-02-21 22:32   ` sk
     [not found] <20040222005514.BF2284C40CF@lovelace.ada-france.org>
2004-02-22  3:01 ` Carroll-Tech
2004-02-22  6:39   ` tmoran
     [not found] ` <003901c3f8f0$1cfd2ee0$0201a8c0@win>
2004-02-22 21:20   ` sk
     [not found] <20040222110018.15E3A4C40CF@lovelace.ada-france.org>
2004-02-23  9:56 ` Carroll-Tech
2004-02-23 19:00   ` tmoran
2004-02-23 20:39     ` Brian Catlin
2004-02-23 21:06       ` David C. Hoos
2004-02-23 21:56         ` Brian Catlin
     [not found] ` <001501c3f9f3$533ece60$0201a8c0@win>
2004-02-23 19:49   ` sk
     [not found] <20040224021013.DE8C84C40D0@lovelace.ada-france.org>
2004-02-24 11:04 ` Carroll-Tech
2004-02-24 12:58   ` Preben Randhol
     [not found] <m24qtgxgpg.fsf@jvdsys.demon.nl>
2004-02-24 23:05 ` tmoran
2004-02-25  1:43   ` Chad R. Meiners
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox