Mail Archives: djgpp/1998/01/29/07:15:49
Hello , I am relatively new to protected mode programming, and am having
a few memory problems. I am using a VESA 2.0 linear frame buffer
in various resolutions (256 cols only), when setting the mode I use
nearptrs to directly access the frame buffer( I know this disables mem
protection, but its what I want to use) I use code as described in
Charles Sandmanns vbetest.c demo (downloaded from brennans page) to
get the correct address of the buffer
if(__dpmi_physical_address_mapping(&info) == -1) {
printf("Physical mapping of address 0x%x failed!\n",mb->PhysBasePtr);
exit(2);
}
then I add the __djgpp_conventional_base
the problem comes when I malloc some mem the address always is illegal
when I try to access that memory how do I calc the correct address, I
tried afew things and on thing that did work was to add
__djgpp_conventional_base to the malloced address before I used it
that seemed to sort of work but not always??? also what does
sbrk() have to do with things, I know It may change some addresses,
but which ones, what does it affect, what do I need to watch out for
when using nearptrs.
Any help will be greatly appreciated,, thanks in advance
Si....
- Raw text -