X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "James" Newsgroups: comp.os.msdos.djgpp Subject: Re: Accessing absolute address above 1MB Date: 9 Nov 2006 07:06:24 -0800 Organization: http://groups.google.com Lines: 64 Message-ID: <1163084784.426796.228050@h48g2000cwc.googlegroups.com> References: <1162915098 DOT 476438 DOT 52420 AT k70g2000cwa DOT googlegroups DOT com> <4550adea DOT sandmann AT clio DOT rice DOT edu> <1162922909 DOT 133028 DOT 98340 AT f16g2000cwb DOT googlegroups DOT com> NNTP-Posting-Host: 15.235.153.106 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1163084788 11538 127.0.0.1 (9 Nov 2006 15:06:28 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Thu, 9 Nov 2006 15:06:28 +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 HOUWEBPROXY03 Complaints-To: groups-abuse AT google DOT com Injection-Info: h48g2000cwc.googlegroups.com; posting-host=15.235.153.106; 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 was able to get it working. Thanks for your help. James Rod Pemberton wrote: > "James" wrote in message > news:1162922909 DOT 133028 DOT 98340 AT f16g2000cwb DOT googlegroups DOT com... > > Charles Sandmann wrote: > > > > I am trying to access the memory address 0x3FFF0000 in DOS using dpmi. > > > .. > > > > buffer[0] = _farpeekb(selector, mi.address); > > > > > > mi.address should be 0 here, since the offset is built into the selector > > > you just set up > > > > I tried that and still receive the same error message. > > > > That's really strange, because that's the only error I could find. The > offset, where you have mi.address, should be between 0 to 0xfff (segment > limit-1). > > buffer[0] = _farpeekb(selector, 0); > > Perhaps, you're using a RM address currently and tripping the same line in > the RM section? > > Your PM code should work for address below 1Mb as long as you don't call > __dpmi_physical_address_mapping (shouldn't be used below 1Mb per DPMI > specs.). I commented out the RM section, the > __dpmi_physical_address_mapping, and then used mi.address = 0xB8000 > (screen), and added a _farpokeb(selector, 0, 0x66) which output to the > screen. I also added the physical address mapping back w/0x3FFF0000 and no > longer received the SIGSEGV. > > What OS are you running the code under? RM DOS, FreeDOS, Win3.1/95/98/2k > console, WinNT/2k/XP console, Linux/DOSEMU? Are you running the code under > an emulator (Bochs, QEMU, etc.)? > > Also, do you want 1Gb-1 (0x3FFF0000) or 256Kb-16 (3FFF:0000h, i.e., > 0x0003FFF0) ? Most memory mapped devices are usually mapped below 1Mb. > > From this (first post): > > fs: sel=01cf base=3fff0000 limit=00000fff > > The fs selector is set to what you coded, but it doesn't show the access > rights... > > If you're still having problems, I'd recommend adding a call to > __dpmi_set_descriptor_access_rights and moving the > __dpmi_physical_address_mapping call after the > __dpmi_allocate_ldt_descriptors call. > > __dpmi_set_descriptor_access_rights(selector,0xC0F3) /* need to check value > for your segment */ > > I'd recommend reading the last two paragraphs of the first post of mine, and > all of the second. > http://groups.google.com/group/comp.os.msdos.djgpp/msg/fa3f19efbcba7754?hl=en > http://groups.google.com/group/comp.os.msdos.djgpp/msg/3b2927a76908742a?hl=en > > > Rod Pemberton