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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef5a6044185c922d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-25 13:25:11 PST Message-ID: <3C7AAA8B.6020507@users.sf.net> From: Dave Poirier User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Device driver in Ada95 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 25 Feb 2002 16:20:11 -0500 NNTP-Posting-Host: 65.94.39.101 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1014672010 65.94.39.101 (Mon, 25 Feb 2002 16:20:10 EST) NNTP-Posting-Date: Mon, 25 Feb 2002 16:20:10 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!jfk3-feed1.news.digex.net!dca6-feed2.news.digex.net!intermedia!newsfeed1.cidera.com!Cidera!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:20397 Date: 2002-02-25T16:20:11-05:00 List-Id: 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.