Thread View: comp.sys.ibm.pc.programmer
2 messages
2 total messages
Started by Moshe Braner
Tue, 13 Mar 1990 02:04
adding to the heap?
Author: Moshe Braner
Date: Tue, 13 Mar 1990 02:04
Date: Tue, 13 Mar 1990 02:04
29 lines
1944 bytes
1944 bytes
Hello net.people! I had this really hooky idea, that it aught to be possible to take areas of memory that are known to be available, and telling malloc() somehow that they are OK free blocks. I am thinking of the malloc() library function of the C compiler packages, in the large-data models (compact, large), or the farmalloc() function in the small model. The holes I'd like to use include: unused parts of "shadow" RAM above 640K but below 1 meg, an EMS window, and even the first 64K (minus 16 bytes) of extended RAM, which supposedly you can cheat and read from "real" mode (using the segment FFFFH, offsets over 000FH - is that really possible?). Together it should be possible to gain well over 100K, to be used in your program in a completely transparent manner (if you program does a lot of small malloc()s). So, has anybody tried this? Does anybody have code to do this? (You'd have to set up the block with the right stuff before you call free() on it -- unless you compiler's library has a function for adding a new block.) I am looking for such code for Turbo C 2.0, but I am sure other people could use examples for MS C or other languages (Pascal, Modula 2). - Moshe Braner Cornell Theory Center, 265 Olin Hall, Cornell University, Ithaca, NY 14853 USA (607) 255-9401 <braner@tcgould.tn.cornell.edu> (INTERNET) <braner@crnlthry> (BITNET)
Re: adding to the heap?
Author: Steve Resnick
Date: Tue, 13 Mar 1990 19:12
Date: Tue, 13 Mar 1990 19:12
18 lines
1519 bytes
1519 bytes
In article <9898@batcomputer.tn.cornell.edu> braner@tcgould.tn.cornell.edu (Moshe Braner) writes: >and even the first >64K (minus 16 bytes) of extended RAM, which supposedly you can cheat >and read from "real" mode (using the segment FFFFH, offsets over 000FH >- is that really possible?). It is really possible on some machines which have a way to toggle the A20 line on the CPU address bus. Normally this is disabled. The problem with using memory between FFFF:10 and FFFF:FFFF is that other programs may assume this memory is usable, including TSR's and device drivers..Microsoft, Lotus, Intel and AST Research came up with an eXtended Memory Specification (XMS) which MS has drivers free for the asking. Just call 'em up and they will send you a manual and diskette describing the specification and provding a device driver which implements the XMS 2.0 specification (Which is similar in function to EMS) They also include source code for those interested assembler hackers... :) Steve
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads