Mail Archives: djgpp/2005/11/29/21:30:32
<blk5743 AT yahoo DOT com DOT tw> wrote in message
news:1133314507 DOT 884056 DOT 150990 AT f14g2000cwb DOT googlegroups DOT com...
> Thanks, i will try it.
> I have another question now.
>
> the address of r_buffer as below, right
> r_buffer: PM address = (ULONG)r_buffer
> r_buffer: RM address = (ULONG)r_buffer+__djgpp_conventional_base;
If r_buffer is declared in your program (not DOS, not XMS, not RM memory)
then,
r_buffer: PM address = &r_buffer;
r_buffer: RM address: doesn't exist, there are *NO* RM addresses above
1Mb+64k, your code is above 1Mb+64k
r_buffer: linear/physical address
=(ULONG)r_buffer+__djgpp_conventional_base;
Otherwise, if r_buffer is MS-DOS memory, XMS memory, or below 1Mb, then
r_buffer: PM address = (RM segment <<4)+(RM offset) -
__djgpp_conventional_base;
r_buffer: RM address is RM segment:RM offset
r_buffer: linear/physical address = (RM segment <<4) +(RM offset);
> // only if r_buffer points to data within this program...
> does this mean that i just declare ****BYTE *r_buffer**** or **** BYTE
> r_buffer[0x10000]**** in my program
Maybe. I don't know. What is r_buffer? Your code sample doesn't show me
how or where r_buffer is allocated. If it is declared by the C program, the
addressing is different than if it is allocated through MS-DOS, XMS, etc.
> and if i lock a region in XMS, i should use
> PRD_EDDS.Offset = r.x.dx; // RM offset e.g., Lock XMS r.x.dx
> segment
> PRD_EDDS.Segment = r.x.bx; // RM segment e.g., Lock XMS r.x.bx
> offset
No. If r_buffer is RM memory, then use different addressing.
> if i need data, i use dosmemget/put to the XMS region, right.
Yes. I think. Is this what you are doing?
1) allocate XMS
2) set DMA to XMS
3) read CD
4) move DMA data to program
Here's a rough memory map of your computer. Where is r_buffer? Above or
below 1Mb? In the program or outside the program?
--------4Gb--------- physical 4Gb, no RM address, PM address 0xFFFFFFFF
| | |
| | |
| | |
| | |
| | |
-----r_buffer?------- physical __djgpp_conventional_base+&r_buffer, no RM
address, PM address &r_buffer
| | |
| | |
--------EXE-------- physical __djgpp_conventional_base, no RM address, PM
address 0, start of .EXE
| | |
| | |
--------1Mb-------- physical 1Mb+64k, RM FFFF:F, PM
0xFFFFF-__djgpp_conventional_base
| | |
-----r_buffer?------- physical segment<<4+offset, RM segment:offset, PM
segment<<4+offset -__djgpp_conventional_base
| | |
--------0Mb-------- physical 0Mb, RM 0000:0, PM
0x00000-__djgpp_conventional_base
Rod Pemberton
- Raw text -