* Hardware Interrupts [not found] <20040221110026.E93C54C40C5@lovelace.ada-france.org> @ 2004-02-21 20:39 ` Carroll-Tech 2004-02-21 21:32 ` system calls, was " tmoran [not found] ` <000501c3f8bb$189b2760$0201a8c0@win> 1 sibling, 1 reply; 3+ messages in thread From: Carroll-Tech @ 2004-02-21 20:39 UTC (permalink / raw) To: comp.lang.ada 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). ^ permalink raw reply [flat|nested] 3+ messages in thread
* system calls, was Re: Hardware Interrupts 2004-02-21 20:39 ` Hardware Interrupts Carroll-Tech @ 2004-02-21 21:32 ` tmoran 0 siblings, 0 replies; 3+ messages in thread From: tmoran @ 2004-02-21 21:32 UTC (permalink / raw) > task Interrupt_handler is > ... > I want to call the BIOS interrupt (INT11h) to get the equipment list The task stuff is about *handling* interrupts, but you want to *call* something via a software interrupt. Compiler vendors normally supply packages to do such system dependent things - presumably your copy of Gnat does too. If not, you will need to find such a package (or find one in C and interface to it) or else you'll have to use "machine code insertions" and code in assembly to set up the calling sequence, issue the interrupt, and retrieve the results. BTW, what machine has a BIOS INT11h call? ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <000501c3f8bb$189b2760$0201a8c0@win>]
* Re: Hardware Interrupts [not found] ` <000501c3f8bb$189b2760$0201a8c0@win> @ 2004-02-21 22:32 ` sk 0 siblings, 0 replies; 3+ messages in thread From: sk @ 2004-02-21 22:32 UTC (permalink / raw) Cc: comp.lang.ada andrew@carroll-tech.net: > 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 I don't know any answers to your questions. What I do remember about any assembly calls to BIOS interrupts is that you have to set up the registers with parameters etc. You are using GNAT from your examples. Which version and platform ? If it is an Intel compiler running in "protected" mode, that is 32-bit address space etc, the physical address "16#11# does not corespond to the interrupt 11. Once 32-bit protected mode is entered, the Interrupts are gated and are typically not at the booting 0 .. 255 address space of an Intel 386 processor boot prior to entering protected mode. Another thing to note is that, I believe, the BIOS is not accessible as regular memory once Intel 32-bit protected mode is established (I could be wrong on this :-) If you are still determined to go into never-never land, you need to look at Ada's machine code insertions. The code you posted looks potentially fatal to your machine. So, beyond Gnat telling you the code is non-portable, I would say it is also, at the least, not what you are looking for, at worst calling "format disk" which is a BIOS routine of almost 20 years ago before the current IDE standards were established. Sorry, not much help, but I am hoping that you don't trash your system by being determined to call a possible inaccessible BIOS. Simon :-) -- ------------------------------------------------- -- Merge vertically for real address -- -- s n p @ t . o -- k i e k c c m ------------------------------------------------- ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-21 22:32 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20040221110026.E93C54C40C5@lovelace.ada-france.org> 2004-02-21 20:39 ` Hardware Interrupts Carroll-Tech 2004-02-21 21:32 ` system calls, was " tmoran [not found] ` <000501c3f8bb$189b2760$0201a8c0@win> 2004-02-21 22:32 ` sk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox