Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: BlissComm , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: pc memory access Date: Sun, 26 Apr 1998 20:23:01 -0700 Message-ID: <19980427032245.AAF5484@ppp100.cartsys.com> Precedence: bulk At 06:24 4/26/1998 EDT, BlissComm wrote: > >Can anybody solve my confusion? Was the Intel cpu designed by >Rube Goldberg? Quite possibly. :)) >Here's my problem. I want to write a driver for an i/o board >(DTI-1120 mil-std-1553) that has the usual registers and also >32k or 64k of dual-access ram. The ram can be set to appear >anywhere from 9000:0000 to d000:0000 depending on where the >video ram is. > >How do I access this memory? I can access something here with the >dpmi functions, but it seems to me it's virtual not real memory. >For instance b8000 is where the video text screen image is. But it >is different memory when accessed from different dos windows. >(I'm using windows 3.11). In fact all such "dos" memory is different >when I access it from a different window. Windows virtualizes conventional memory, but I'm not sure if it will also do so for areas where a device is mapped. I think there might be a SYSTEM.INI option to disable it for some range, consult a Windows guru. Once you get that dealt with, or if you run from plain DOS, you can use `farpoke*' with a selector of `_dos_ds' and an address of `0xd0000+ofs', or whatever >What's the difference between outportx() and _farpokex(). I know >I use outport and inport to access i/o registers, but why can't I >use _farpoke and _farpeek? Can it be that Intel i/o registers aren't >in data space, or is "dos memory" not real memory, or what? The CPU's I/O ports are totally different from the data memory. The `in' and `out' instructions, and their corresponding C wrappers, work on a set of I/O ports that are separate lines on the bus. Memory-mapped devices are just things that the motherboard fools the CPU into thinking is memory. DOS memory also is not necessarily "real memory", due to the 386's segmentation and protection features. Consult a 386 manual for more information. >Are outportb() and outp() the same thing? Yes. The duplication is for compatibility. >Can I get two programs running in two dos windows to have >access to the same memory? I see functions in dpmi.h for this but >they are for DPMI version 1.0 and don't seem to work on my computer. I don't know. Nate Eldredge nate AT cartsys DOT com