From: kvitekp@jvd.msk.su (Pete Kvitek)
Subject: Re: Problem with Phar Lap LITE
Organization: JV Dialogue, Moscow
Date: Fri, 22 Jan 1993 19:33:37 GMT

derijkp@reks.uia.ac.be (Peter De Rijk) writes:
: 
: I am trying to use memory >640K in C. I am trying out the 'LITE' version of 
: DOS extender from Phar Lap. (I do not want to by the full version until I know
: it will work with my program.) While doing some testing I encountered some 
: ennoying problems:
: 
: I can only allocate 13 blocks using farmalloc. Even when I do have enough
: memory left, the 14th farmalloc returns NULL. Is this a limitation of the
: LITE version only (it is not described as such.), or is something else wrong.
: 
: By freeing or reallocating using farmalloc, farrealloc and farfree memory can 
: get 'lost'. e.g. Suppose I want to gradually increase the amount of memory in
: an allocated block (as I said, just testing purposes). When I make a block 
: bigger by reallocating I can get about 1 megabyte. When make it bigger by 
: freeing it, and allocating the larger block, I only get to about halve a meg.
: 
: I see following possible solutions to the problem:
: 
: Since I am definately not a DOS guru, I am doing something terribly wrong with 
: the dos extender. If someone tells me what, I can correct this and get all 
: singing, all dancing memory allocation >640K.
: 
: I allocate one big block of memory in the beginning of the program, and do all
: memory management myself. I'm not really anxious to do this. To do it properly 
: it would require a rather big amount of work and time. So if someone else has
: already done this, and is willing to give it to me, ...
: 
: Someone else has had the same problem, and has found a solution I haven't even 
: thought about.
: 
: The problem is really driving me mad, and if someone has any idea how to solve 
: it, it would be enourmously appreciated.
: 
: Peter
: 
: PS. I've just read a post about someone using MSC 7.00 and a 'virtual memory
: manager'. Does this do what I want: use extended memory, allocate large blocks
: of memory under DOS. If so, maybe I should convert to MSC.


I don't use PL's Dos Extender but probably i can help you another way...

Recenly i wrote a NEWEXE file loader which supports DPMI -- so anyone who has
linker capable to produce NEWEXE files can run large model programs in 
protected mode... MS's LINK, Borland's TLINK and Zortech's BLINK can do.

But if you want to use high level language like C you need a bit more -- 
the runtime libraries which are protected mode clean. Since i'm mostly using
Borland's C++ 2.00 -- i modified its runtime libraries to run in protected
mode... But that's not the end of the story -- standard heap allocation 
routines are absolutely not compatible with protected mode since they
rely on a heap being the consequent block of memory -- which is not possible
in protected mode or is not reasonable at least. So i developed another heap
manager -- it just came through the extensive stress tests and seems to be 
fine. It may be used with any compiler... As for modified BC runtime libs --
soon i upgrade them to 3.xx version of BC.

So now there is alternative for PL's stuff but it requires external DPMI
host -- QD's QDPMI 1.01, MS WIndow Dos box and OS/2 2.0 dos box will do.
Did not check it with 328MAX from Qualitas though... since i dont have 
it. (anyone can help by running test routines under it? you're welcome..)

Tell me if you're interested...   
--

Pete Kvitek <kvitekp@jvd.msk.su>, FidoNet(tm) 2:5020/6 | Phone:+7-095-328-1327
Speaking from but not for JV Dialogue, Moscow, Russia  | Fax:  +7-095-329-4711
-- 

Pete Kvitek <kvitekp@jvd.msk.su>, FidoNet(tm) 2:5020/6 | Phone:+7-095-328-1327
Speaking from but not for JV Dialogue, Moscow, Russia  | Fax:  +7-095-329-4711
Newsgroups: comp.os.msdos.programmer