| delorie.com/archives/browse.cgi | search |
| From: | yurick AT oblik DOT dp DOT ua |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | __djgpp_map_physical_memory - some questions |
| Date: | Wed, 30 May 2001 21:29:47 +0300 |
| Organization: | Apex NCC Public InterNet News Server |
| Lines: | 24 |
| Message-ID: | <r6e3f9.tu3.ln@nix-if1> |
| NNTP-Posting-Host: | dialup194.apex.dp.ua |
| X-Trace: | main.apex.dp.ua 991263938 24295 195.24.139.194 (30 May 2001 23:05:38 GMT) |
| X-Complaints-To: | abuse AT apex DOT dp DOT ua |
| NNTP-Posting-Date: | 30 May 2001 23:05:38 GMT |
| User-Agent: | tin/1.5.8-20010221 ("Blue Water") (UNIX) (Linux/2.2.19 (i686)) |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hi!
I have some questions about __djgpp_map_physical_memory() function.
1. Info says that all three arguments of this function must be page-aligned.
So must I align all this arguments manually? Is this code correct (see below)?
------------------------------------------------------------------
#define PAGE_SIZE 0x1000
// already aligned
#define MEM_SIZE 0x4000
#define MEM_ADDR 0xeb000000
char *buf=(char*)malloc(MEM_SIZE+PAGE_SIZE);
size_t aligned=(size_t)buf;
aligned=(1+(dptr-1)/PAGE_SIZE)*PAGE_SIZE; // align to PAGE_SIZE
int res=__djgpp_map_physical_memory((char*)aligned, MEM_SIZE, MEM_ADDR);
printf("result: %d\n", res);
------------------------------------------------------------------
2. I've tried this with djgpp 2.03 under Win95OSR2. Is it supports
this call (DPMI 0508)?
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |