[comp.windows.ms] himem.sys woes - fix???

mcdonald@aries.scs.uiuc.edu (Doug McDonald) (07/31/90)

I have posted several articles flaming the Win 3.0 himem.sys program.
It refuses to let me run my 32-bit 386 programs that use the Phar Lap
extender. I have a kludge around the problem which I am going to be
rash enough to post. Please folks: this is for running programs with said
Phar Lap extender. (There are commercial programs that use it.)
It has not been tested for anything else. Caveat emptor. I have tested it
extensively for two days for my work, including writing a program that
zeroed all the extended memory it could malloc up.

Here is how it works (on you 386 or 486): You can't use the Smartdrive that
comes with Win 3.0. I am using the last Win 386 one. You put it and
himem.sys from Win 3.0 in your config.sys. And no other .sys files that
use exTended memory. About exPanded memory drivers I have no idea at all.
Then AFTER you run and exit Windows, you run the following program
(compiled with Microsoft C 5.1):

#include <dos.h>
#include <stdio.h>
union REGS rg;
main()
{
  unsigned long i;
  unsigned long far * ptr;  

  ptr = *(unsigned long far * far *)(0x54l);
 

  i = *ptr;
  if(i != 0x7588fc80l) exit(1);
  i = ptr[1];
  if(i != 0xcfc03303) exit(1);

  *ptr &= 0xff00ffffl;

}

You only have to do this once. After using Windows again it is not
necessary.

This redirects the bios interrupt for extended memory to where it
was before himem.sys so ungraciously stole it. IF himem.sys permanently
uses memory at the top of your extended memory (below Smartdrive)
and you use that again by this method, something awful, hopefully just
a crash, will occur.

Again, caveat emptor.

Doug McDonald

jimmat@microsoft.UUCP (Jim MATHEWS) (08/01/90)

In article <1990Jul31.010650.2060@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes:
>I have posted several articles flaming the Win 3.0 himem.sys program.
>It refuses to let me run my 32-bit 386 programs that use the Phar Lap
>extender. I have a kludge around the problem which I am going to be
>rash enough to post. Please folks: this is for running programs with said
>Phar Lap extender. (There are commercial programs that use it.)
>It has not been tested for anything else. Caveat emptor. I have tested it
>extensively for two days for my work, including writing a program that
>zeroed all the extended memory it could malloc up.
>
   ...

>Again, caveat emptor.
>
>Doug McDonald


This is a very dangerous thing to do!  Hacking up himem.sys this way can 
cause your system's extended memory to be allocated to several programs
at the same time.  This would be extremely bad if you were using the
smartdrv.sys or emm386.sys drivers that come with Windows 3.0.  This
patch could easily cause someone to lose their hard disk.  smartdrv.sys 
is not the only disk cache that uses XMS memory allocation.  I strongly 
recommend that people do not apply this patch--it's too easy to forget
that it's been applied and do something very very bad to your system.

Jim Mathews

I seldom speak for myself, much less my employer.