comp.lang.ada
 help / color / mirror / Atom feed
* Re: low-level
  1998-04-13  0:00 low-level Carlos Piqueres Ayela
@ 1998-04-13  0:00 ` Tom Moran
  1998-04-13  0:00 ` low-level Jerry van Dijk
  1998-04-13  0:00 ` low-level Stephen Leake
  2 siblings, 0 replies; 5+ messages in thread
From: Tom Moran @ 1998-04-13  0:00 UTC (permalink / raw)



Just as in C you can use vendor supplied library routines like int86,
you can do the same in Ada.  Look at your compiler vendor's
documentation to find out what appropriate library routines they
supply.  
  In Ada you can use a "representation clause" (see RM chapter 13)  to
force certain things to be at certain addresses.  Note that many
modern OS's "virtualize" things so the address you get may not be the
same as the address the hardware sees, and you may have to find the OS
functions that will let you get at particular *hardware* or physical
addresses.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: low-level
  1998-04-13  0:00 low-level Carlos Piqueres Ayela
  1998-04-13  0:00 ` low-level Tom Moran
  1998-04-13  0:00 ` low-level Jerry van Dijk
@ 1998-04-13  0:00 ` Stephen Leake
  1998-04-14  0:00   ` low-level Albert K. Lee
  2 siblings, 1 reply; 5+ messages in thread
From: Stephen Leake @ 1998-04-13  0:00 UTC (permalink / raw)



Carlos Piqueres Ayela wrote:
> 
> I'm using GNAT 3.10 and Windows 95.
> I'm using the Jerry Van Dijk 's  great Adagraph package to do simple
> graphics.
> 
> But what I want to know is how you can access directly to the hardware (for
> example the SVGA hardware, BIOS interrupts...) for writing your own routins
> (graphics, hardware drivers...).
> 
> Not doing it in C and interfacing with ADA programs, just doing it in ADA.
> I know that you can do such things in C with far pointers, library
> functions  (int86()...) and things like that.
> Is there any equivalent to that in ADA ??

Just call the same library from Ada that you would from C. You'll have
to write the equivalent Ada declaration, and add pragma Import instead
of the body.

Note that this is exactly equivalent to how you call a library function
from C; you need the equivalent C declaration, and you tell the linker
to include the library.

The fact that you first learned about the library functions in a C
context, and that the documentation provided with the library provides C
declarations, doesn't mean calling it from Ada is somehow non-Ada!

As for far pointers, all current Ada environments for the PC are 32bit,
so there is only addresses, not near and far addresses.

> 
> Carlos.

-- 
- Stephe




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: low-level
  1998-04-13  0:00 low-level Carlos Piqueres Ayela
  1998-04-13  0:00 ` low-level Tom Moran
@ 1998-04-13  0:00 ` Jerry van Dijk
  1998-04-13  0:00 ` low-level Stephen Leake
  2 siblings, 0 replies; 5+ messages in thread
From: Jerry van Dijk @ 1998-04-13  0:00 UTC (permalink / raw)



Carlos Piqueres Ayela (piqueres@mundivia.es) wrote:

: I'm using GNAT 3.10 and Windows 95.
: I'm using the Jerry Van Dijk 's  great Adagraph package to do simple
: graphics.

How could I resist...

: But what I want to know is how you can access directly to the hardware (for
: example the SVGA hardware, BIOS interrupts...) for writing your own routins
: (graphics, hardware drivers...).

Well, the trouble is that all those things are DOS related, and do not
exist as such in the Wonderful world of Windows.

As for graphics, alternatives are using DirectX or OpenGL under Windows.

Otherwise, use the DOS compiler. My VGA and SVGA programs contain a number
of packages showing you how to do this sort of thing. Note that the DOS
compiler runs happily in a windows dos box, and so do its programs.

As I do not have the web space to put it up, I'll mail you the latest
version of my SVGA (vbe 1.2/2.0) graphics package for DOS.

Jerry.

-- 
-- Jerry van Dijk  | email: jdijk@acm.org
-- Leiden, Holland | member Team-Ada




^ permalink raw reply	[flat|nested] 5+ messages in thread

* low-level
@ 1998-04-13  0:00 Carlos Piqueres Ayela
  1998-04-13  0:00 ` low-level Tom Moran
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Carlos Piqueres Ayela @ 1998-04-13  0:00 UTC (permalink / raw)



I'm using GNAT 3.10 and Windows 95.
I'm using the Jerry Van Dijk 's  great Adagraph package to do simple
graphics.

But what I want to know is how you can access directly to the hardware (for
example the SVGA hardware, BIOS interrupts...) for writing your own routins
(graphics, hardware drivers...).

Not doing it in C and interfacing with ADA programs, just doing it in ADA. 
I know that you can do such things in C with far pointers, library
functions  (int86()...) and things like that.
Is there any equivalent to that in ADA ??

Carlos.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: low-level
  1998-04-13  0:00 ` low-level Stephen Leake
@ 1998-04-14  0:00   ` Albert K. Lee
  0 siblings, 0 replies; 5+ messages in thread
From: Albert K. Lee @ 1998-04-14  0:00 UTC (permalink / raw)



On Mon, 13 Apr 1998 13:48:14 -0400, Stephen Leake <Stephen.Leake@gsfc.nasa.gov> wrote:
>Carlos Piqueres Ayela wrote:
>> 
>> I'm using GNAT 3.10 and Windows 95.
>> I'm using the Jerry Van Dijk 's  great Adagraph package to do simple
>> graphics.
>> 
>> But what I want to know is how you can access directly to the hardware (for
>> example the SVGA hardware, BIOS interrupts...) for writing your own routins
>> (graphics, hardware drivers...).
>> 
>> Not doing it in C and interfacing with ADA programs, just doing it in ADA.
>> I know that you can do such things in C with far pointers, library
>> functions  (int86()...) and things like that.
>> Is there any equivalent to that in ADA ??
>
>Just call the same library from Ada that you would from C. You'll have
>to write the equivalent Ada declaration, and add pragma Import instead
>of the body.

Actually he asked how to interface with the low-level hardware, using
some low-level programming.  He did use the magic words 'driver',
'hardware', and 'interrupt'.  The 'library function' he referred to
deals with calling x86 hardware/OS interrupts using specific register
values, not with any Windows graphics display routines.

He wants to program some Intel x86 hardware directly, probably using
some combination of assembly language and Ada.  In addition it sounds
like he's coming from a 16-bit DOS world ("BIOS?"), which is probably
hard to fiddle with using 32-bit-only GNAT.  Having never tried this,
I don't have an answer, but at I can at least clarify the question ...

-Albert




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-04-14  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-13  0:00 low-level Carlos Piqueres Ayela
1998-04-13  0:00 ` low-level Tom Moran
1998-04-13  0:00 ` low-level Jerry van Dijk
1998-04-13  0:00 ` low-level Stephen Leake
1998-04-14  0:00   ` low-level Albert K. Lee

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