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=-0.8 required=5.0 tests=BAYES_00,INVALID_MSGID, SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b4f26c164c846938 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: VIDEO MEMORY ACCESS WITH POINTERS Date: 1999/11/27 Message-ID: <81p66o$rkv$1@birch.prod.itd.earthlink.net>#1/1 X-Deja-AN: 553791315 Content-Transfer-Encoding: 7bit References: <81p3sh$h2m$1@news.colba.net> X-Posted-Path-Was: not-for-mail Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-ELN-Date: 27 Nov 1999 17:59:52 GMT X-ELN-Insert-Date: Sat Nov 27 10:05:09 1999 Organization: Ada95 Press, Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-27T00:00:00+00:00 List-Id: ??? wrote in message news:81p3sh$h2m$1@news.colba.net... > Simple problem: I want to able to read and write directly into the video > memory using Ada code. Ex: writting the 16bits value 0x4141 at the address > 0xb8000000. > > I'm a new user of ADA, in Pascal or C, it's very simple. But with the strong > protection of Ada, I'm lost. I know the basics of pointers in ADA (called > access), but I don't know how to directly address the value 0xb800000 to a > pointer. I've tried to assign the address using Unchecked_Conversion and it > works. But when I try to read or write the content in memory, a > constraint_error exception is raisen. > > Does anybody could help me? This is not just an Ada question -- it's also an operating system and perhaps even a compiler question. Please tell us on what platform -- i.e., hardware and operating system you're running, and with which Ada compiler you're attempting to write to Video memory. Then, someone will be able to help you. More importantly, if you tell us what you're trying to accomplish, perhaps there's a better way to do it than writing directly to video memory -- e.g., an operating system service. Access types are for accessing memory within the virtual address space of a process, not for accessing absolute hardware addresses. On some operating systems, a user program is not even allowed to do it directly, but must use an operating system service, or a device driver to do it.