delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2010/04/07/20:30:13

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: RayeR <glaux AT centrum DOT cz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bash bugs (was: djgpp/libreadline bug)
Date: Wed, 7 Apr 2010 17:11:16 -0700 (PDT)
Organization: http://groups.google.com
Lines: 39
Message-ID: <4dda76e4-9d13-4291-9289-87b51670c1ea@5g2000yqj.googlegroups.com>
References: <013d25d6-f34d-4686-9c68-0de775d5bf59 AT t20g2000yqe DOT googlegroups DOT com>
<83fx3j1874 DOT fsf AT gnu DOT org> <81255c92-b71b-4d8b-871c-fe057d72ddb7 AT u22g2000yqf DOT googlegroups DOT com>
<834ojz111c DOT fsf AT gnu DOT org> <9e95b163-ba8a-467d-870e-4f3437dd9a96 AT y17g2000yqd DOT googlegroups DOT com>
<1433b3f4-9d44-455b-9465-e873fd2cb618 AT 33g2000yqj DOT googlegroups DOT com>
<l2i7705c9031003301830hc62e763euf24398f9661b0fcc AT mail DOT gmail DOT com>
<f6c09a3b-9e24-457a-9c5a-d2a2c75181aa AT 30g2000yqi DOT googlegroups DOT com>
<8d449cf5-3dce-48c8-b8e7-e535b037b4a6 AT 8g2000yqz DOT googlegroups DOT com>
<83zl1oxzat DOT fsf AT gnu DOT org> <81hah9Fit3U1 AT mid DOT individual DOT net>
<4BB4C8EC DOT 8050909 AT iki DOT fi> <f237410b-8271-4119-8608-062a3c703d81 AT z7g2000yqb DOT googlegroups DOT com>
<83r5mywcqy DOT fsf AT gnu DOT org> <45780149-957b-4e1a-9c91-fc01b4f040e4 AT y17g2000yqd DOT googlegroups DOT com>
<ed9524fc-91bf-4479-9de7-56e304705f5e AT u22g2000yqf DOT googlegroups DOT com>
NNTP-Posting-Host: 213.220.252.124
Mime-Version: 1.0
X-Trace: posting.google.com 1270685476 29511 127.0.0.1 (8 Apr 2010 00:11:16 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Thu, 8 Apr 2010 00:11:16 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: 5g2000yqj.googlegroups.com; posting-host=213.220.252.124;
posting-account=Q0wMHAoAAADjYrghh94FTf6YnbpTqZgp
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23)
Gecko/20090825 SeaMonkey/1.1.18,gzip(gfe)
Bytes: 3650
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> One (non-GNU) third-party app in particular won't port to DJGPP
> because it needs mmap(), which I think I was told is default in a
> newer POSIX version. Checking the newsgroup archives here shows that
> DPMI 1.0 could maybe support such emulation, but nobody has bothered
> (for the big obvious reason, it's not common)

When I ported nVClock to DOS I made this function to replace mmap
stuff
(it's needed to access MMIO registers of GPU placed in address space
beyond 1st meg)

//***************** call DPMI physical memory mapping and allocate LDT
descriptor for the memory block
void *map_physical_memory(uint32_t phys_base, uint32_t size) //
phys_base must be page aligned
{							     // size will be aligned automatically
  void *p;
  if (size == 0)		       // if zero block size, do nothing
    return(NULL);
  if ((size & 0x0FFF) != 0)	       // if size is not page-aligned
    size = (size + 4096) & (~0x0FFF);  // make it page-aligned
  if ((p = valloc(size)) == NULL)      // allocate page-aligned memory
(__djgpp_map_physical_memory required this)
    {				       // allocation failed
    printf("ERROR: cannot allocate %lu bytes for memory mapped device
\n",size);
    exit(-1);			       // exit program
    }
  if (__djgpp_map_physical_memory(p,size,phys_base))
    {				       // failed to map physmem
    printf("ERROR: failed to map physical memory range: 0x%08lX - 0x
%08lX\nDPMI 1.0 server or support of DPMI function 0508h is needed.
\nIt doesn't work under Windows, use win32 version instead.
\n",phys_base,phys_base+size-1);
    exit(-1);			       // exit program
    }
  return(p);			       // return pointer to memory block aliasing
physical memory area
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019