Thread View: comp.os.msdos.programmer
2 messages
2 total messages
Started by Peter De Rijk
Thu, 21 Jan 1993 17:15
Problem with Phar Lap LITE
Author: Peter De Rijk
Date: Thu, 21 Jan 1993 17:15
Date: Thu, 21 Jan 1993 17:15
38 lines
2221 bytes
2221 bytes
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.
Re: Problem with Phar Lap LITE
Author: Pete Kvitek
Date: Fri, 22 Jan 1993 19:33
Date: Fri, 22 Jan 1993 19:33
72 lines
4085 bytes
4085 bytes
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
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