Mail Archives: djgpp/2007/09/24/15:09:32
> "Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za> wrote in message
> news:46F7F665 DOT 1773 DOT 20651AE9 AT gerritvn DOT gpvno DOT co DOT za...
> > The DJGPP FAQ (http://www.delorie.com/djgpp/v2faq/faq18_13.html) tells
> > me to use XMS when a large DMA buffer is required, do some mapping
> > tricks and use farptr functions to transfer between DJGPP memory and the
> > DMA memory. My understanding is that paging is to blame for this
> > complexity.
> >
> > My question: If paging is disabled by either configuring CWSDPMI with
> > CWSPARAM or using CWSDPR0, will the physical to logical address
> > mapping be 1:1? Can the physical address to program the DMA unit be
> > simply computed by the data segment and offset?
> > will the physical to logical address mapping be 1:1?
>
> To get non-paging 1:1 physical addressing, you could use PMODEDJ (i.e.,
> PMODETSR.EXE). Run stubedit.exe to change the DPMI host from CWSDPMI.EXE to
> PMODETSR.EXE.
>
> stubedit my_sample.exe dpmi=PMODETSR.EXE
>
> Or, you can change the parameters interactively. Stubedit will ask for
> replacement values. Stubedit will allow you to change the application's
> stack space, RM transfer buffer, base filename, argv[0], and DPMI host.
>
> stubedit my_sample.exe
>
> I've used PMODEDJ to help find DPMI programming mistakes, and for one
> situation where I don't want paging.
>
> Rod Pemberton
>
Thanks, Rod.
Have you actually done DMA programming using DJGPP and PMODEDJ ?
Do you have any more pointers, warnings and/or gotchas if I simply
malloc() a memory buffer and calculate the physical address by adding
base from __dpmi_get_segment_base_address(_my_ds(),&base) to it ?
--
Gerrit van Niekerk
GP van Niekerk Ondernemings BK
Roosstraat 211, Meyerspark, 0184, South Africa
Tel: +27(12)8036501 Fax SA: 0866 413 555
Cell: +27(73)6891370
Fax Int'l: +1(206)2034139
Email: gerritvn AT gpvno DOT co DOT za
Web: http://www.gpvno.co.za
- Raw text -