comp.lang.ada
 help / color / mirror / Atom feed
* Device driver in Ada95
@ 2002-02-25 21:20 Dave Poirier
  2002-02-25 21:47 ` sk
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dave Poirier @ 2002-02-25 21:20 UTC (permalink / raw)


I'm currently trying to write a basic device driver in Ada95.  The 
device is a simple text mode videocard under a x86 PC. I got the boot 
record going as well as a small rtk of my own which allow me to run 
simple programs that return values.

My next step is to start to write device drivers in Ada95 using this 
same setup, so as to have as useable os sooner or later.  As my first 
try, I decided to create a small vga driver for text mode.  This 
requires that I write in memory from 0xB8000 to 0xB8A9F.

Here's what I tried:
--------------------
with System.Address_to_Access_Conversions;

procedure Hello is
   type Screen is array(0 .. 999) of Character;
   type Char_Ptr is access Screen;
   package CharPtrs is new System.Address_To_Access_Conversions(Char_Ptr);
   Vga : CharPtrs.Object_Pointer;
   VgaAddress : System.Address;

begin
   VgaAddress := System.Address(16#B8000#);
   Vga := CharPtrs.To_Pointer(VgaAddress);
   Vga.all(0) := '!';
end Hello;

---------

Ofcourse that doesn't compile, it doesn't like the assignment I'm trying 
to do for VgaAddress :=...

Now, could any of you indicate how I'm supposed to do that as properly 
as possible using only Ada95?

I'm compiling with GNAT to generate a .s which I then compile with my 
own wrappers, so as long as it's valid Ada95 and that it can get to 
generating my .o it should be fine.

Thanks for any help.




^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Device driver in Ada95
@ 2002-02-26 11:09 Gautier Write-only-address
  0 siblings, 0 replies; 9+ messages in thread
From: Gautier Write-only-address @ 2002-02-26 11:09 UTC (permalink / raw)


Hello Dave!

If it can help you there are Ada driver sources for DPMI
in the the Engine_3D pack, for

  Keyboard (multi-key input)
  SVGA (from Jerry)
  Precision timers
  Sound Blaster

See URL below. HTH
______________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/e3d.htm

NB: For a direct answer, address on the Web site!

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.




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

end of thread, other threads:[~2002-02-26 11:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-25 21:20 Device driver in Ada95 Dave Poirier
2002-02-25 21:47 ` sk
2002-02-26  0:02   ` Dave Poirier
2002-02-25 21:53 ` chris.danx
2002-02-25 22:06 ` Jerry van Dijk
2002-02-25 22:54   ` Dave Poirier
2002-02-25 23:21     ` sk
2002-02-26 10:05     ` chris.danx
  -- strict thread matches above, loose matches on Subject: below --
2002-02-26 11:09 Gautier Write-only-address

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