Article View: borland.public.cppbuilder.nativeapi
Article #16375Memory block at specified physical address
From: Roelof Steyn
Date: Tue, 20 May 2003 06:03
Date: Tue, 20 May 2003 06:03
26 lines
1653 bytes
1653 bytes
Hi
I need to assign a block of memory at a specified address in physical memory
(I'm using dual port RAM on an EISA card).
I need to do something like this:
#define BufSize 2048
#define Address 0xB8000
volatile WORD *mem = malloc(BufSize,Address);
Can anybody help?
I'm working on Win2000.
I have tried doing this:
volatile WORD *mem[BufSize];
for(int i=0; i<BufSize; i++)
{
(int*)AA[i] = (int*)(Address + i*2); // Assign address
*(AA[i]) = 0x0000; // Initialize to 0
}
Problems with this:
1. I'm not confident that Win2000 assigned this block to actual, real
physical address B8000.
2. It works OK, until I quit the program, then I get the error "Invalid
pointer operation" - how do I "free" this memory block?
Thanks!
Technical Details
Message-ID:
<3ec9c524@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,b16a167e1c27ccab,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-19 23:06:40 PST From: "Roelof Steyn" <roelof@imaginet.co.za> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Memory block at specified physical address Date: Tue, 20 May 2003 08:03:12 +0200 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 155.239.178.57 Message-ID: <3ec9c524@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1053410596 155.239.178.57 (19 May 2003 23:03:16 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail