Author Topic: PMMail and EARLYMEMINIT=TRUE problem?  (Read 1273 times)

Lars

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 43
  • Posts: 421
    • View Profile
Re: PMMail and EARLYMEMINIT=TRUE problem?
« Reply #15 on: October 14, 2019, 03:53:49 pm »
There is an unfortunate twist with EARLYMEMINIT=TRUE.

There is a dynamic memory allocation DevHelper called "VMAlloc" that is to be used by kernel/driver SW. There exists a flag called "VMDHA_USEHIGHMEM" that does exactly what EARLYMEMINIT = TRUE is supposed to do: it allows to allocate memory above the 16 MByte physical address boundary on driver init (and only on driver init). For some reason I don't know, a call to VMAlloc with flag "VMDHA_USEHIGHMEM" will FAIL if "EARLYMEMINIT=TRUE" is specified.
But if you do not specify flag "VMDHA_USEHIGHMEM" along with "EARLYMEMINIT=TRUE" , then the allocation will be successful and will use memory > 16 MB address boundary.
 
The only solution to ensure that (on driver init) you can allocate memory above the 16 MBYTE physical address boundary is to try to allocate with "VMDHA_USEHIGHMEM" flag and if that fails to retry without this flag. That way, you will succeed one way or the other (unless you have too little memory in general).

Therefore, I suspect that all those drivers that fail with "EARLYMEMINIT=TRUE" set in config.sys try to dynamically allocate memory on driver init with "VMDHA_USEHIGHMEM" flag set and would likely work OK if the binary were patched to NOT set the VMDHA_USEHIGHMEM flag.


Lars
« Last Edit: October 14, 2019, 03:56:14 pm by Lars »