X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: countingtoten AT gmail DOT com Newsgroups: comp.os.msdos.djgpp Subject: Accessing absolute address above 1MB Date: 7 Nov 2006 07:58:18 -0800 Organization: http://groups.google.com Lines: 56 Message-ID: <1162915098.476438.52420@k70g2000cwa.googlegroups.com> NNTP-Posting-Host: 15.235.153.107 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1162915103 20506 127.0.0.1 (7 Nov 2006 15:58:23 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Tue, 7 Nov 2006 15:58:23 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 HOUWEBPROXY04 Complaints-To: groups-abuse AT google DOT com Injection-Info: k70g2000cwa.googlegroups.com; posting-host=15.235.153.107; posting-account=PoF8Lw0AAAA6yuVJYIwrYqlg3Xy96bZO To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I am trying to access the memory address 0x3FFF0000 in DOS using dpmi. When executed, I receive the following seg fault: Exiting due to signal SIGSEGV General Protection Fault at eip=00003af6 eax=000001cf ebx=00000299 ecx=00000000 edx=3fff0000 esi=00000054 edi=0000ff70 ebp=0008ff08 esp=0008ff08 program=C:\DOCUME~1\WEINERT\DESKTOP\TEST\DPMITEST.EXE cs: sel=01a7 base=02990000 limit=0009ffff ds: sel=01af base=02990000 limit=0009ffff es: sel=01af base=02990000 limit=0009ffff fs: sel=01cf base=3fff0000 limit=00000fff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=02990000 limit=0009ffff App stack: [0008ff70..0000ff70] Exceptn stack: [0000fed0..0000df90] Call frame traceback EIPs: 0x00003af6 0x00001e8a 0x000036c8 from this code: #include #include #include #include int selector; int main(int argc, char** argv) { __dpmi_meminfo mi; int selector; char buffer[4]; /* Map the physical device address to linear memory. */ mi.address = 0x3FFF0000; mi.size = 0x1000; if(mi.address < 0x100000) { buffer[0] = _farpeekb(_dos_ds, mi.address); } else { __dpmi_physical_address_mapping (&mi); selector = __dpmi_allocate_ldt_descriptors (1); __dpmi_set_segment_base_address (selector, mi.address); __dpmi_set_segment_limit (selector, mi.size - 1); buffer[0] = _farpeekb(selector, mi.address); } }