delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/05/20:15:09

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "hskim" <hskim AT future DOT co DOT kr>
Newsgroups: comp.os.msdos.djgpp
Subject: PCI Memory mapping?
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Message-ID: <_q%78.2592$4o2.105655@news.bora.net>
Date: Wed, 06 Feb 2002 01:13:30 GMT
NNTP-Posting-Host: 203.248.159.180
X-Trace: news.bora.net 1012958010 203.248.159.180 (Wed, 06 Feb 2002 10:13:30 KST)
NNTP-Posting-Date: Wed, 06 Feb 2002 10:13:30 KST
Organization: Dacom
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I am making the program which access some PCI board.

I want to map memory of PCI board to my program.

I read PCI configuration first, and got 6 Base Address value.

( 0xf7000000 - 0xf6800000 - 0xf6000000 - 0xf5800000 - 00000000 - 00000000)

Then, I tried to map base address 3 (0xf5800000) to my program as followed.

                unsigned char *p;
                __dpmi_meminfo meminfo;
                int            nRet;

                meminfo.handle = 0xf5800000;
                meminfo.size = 0x200000;
                meminfo.address = 0;

                nRet = __dpmi_physical_address_mapping(&meminfo);

                printf("Result = %d, %08x,%08x,%08x\n",
                               nRet,
                               meminfo.handle,
                               meminfo.size,
                               meminfo.address);
                if (nRet)
                   return;

                p = meminfo.address;

                p[0] = 0;  // program is crashed!

__dpmi_physical_address_mapping() is returned with success, I got

p == 0xd81a0000. But if I access p[x], program is terminated with

General Protection Fault. How to map memory of PCI board?

Thanks for reading, have a nice day!





- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019