Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Dec 1999 00:28:15 -0500
From:      Bob Johnson <bjohnson@cmave.usda.ufl.edu>
To:        freebsd-small@freebsd.org
Subject:   Re: your builds
Message-ID:  <3849F7EF.FFCFC66F@cmave.usda.ufl.edu>
References:  <c=US%a=_%p=USDA%l=USDANT2991204213565921FD3@gainesville.usda.ufl.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

Mike Smith wrote:
> 
> > > You can do it, but performance sucks.  I'm led to believe that later
> > > versions of windows also grow and shrink the swapfile, so it's not so
> > > straightforward anymore.
> >
[> Mark Murray <mark@grondar.za> wrote:]
> > Don't ask me for details, as I don't have them anymore; years ago
> > someone posted a recipe which showed how he made a separate partition
> > for his Windoze swap file, then frobbed his disklabel to fit the
> > FreeBSD swap partition completely inside the Windoze swap file.
> >
> > It was quite messy but doable, and it worked.
> 
> Only for very old versions of Windows where the swapfile can't be
> fragmented.  I wrote a disk-like device driver that exported a disk
> device that mapped exactly onto your Windows swapfile, but that was just
> as W95 was taking off, and the swapfile stopped being so useful.
> 

You CAN set up a Win95 swap file that won't be fragmented.  Whether 
that allows you to then use the old technique I'll leave for someone 
else to investigate:

Create a new partition large enough for the maximum swapfile size you 
   will need under Win95 or BSD. You can also do this on an existing, 
   freshly defragmented partition, as long is it doesn't contain the 
   existing Windows swapfile, but to overlay it with a BSD swapfile I 
   gather it needs to be in its own partition. The partition needs to 
   be formatted for Windows (i.e. DOS).

Open Control Panel/System.

Select the Performance tab, then the Virtual Memory button.

Select "Let me specify my own virtual memory settings."

Set the "Hard disk" entry to point to the partition where you 
   want the swap file to exist.

Set the "Minimum" and "Maximum" values to both be the size of 
   the partition, so the swap file is fixed size and occupies 
   the entire partition.  The next time Win95 reboots, it will 
   create the pre-allocated swapfile.  If the file isn't there 
   when Windows boots, it will be created, so it shouldn't 
   hurt to have FreeBSD scribbling on the partition, as long 
   as it leaves it in DOS format (that's the part I don't 
   understand how to do, but I don't need to do it...).  

   NOTE: you seem to  have to set the swapfile size to 
   be slightly smaller than the space Windows claims is 
   available in the partition, or your settings will 
   be ignored and changed back to the defaults.

You don't have to make the swap file fill the entire partition 
unless you want to have a partition dedicated solely to the 
swap file, just make it big enough to handle your worst-case 
needs.

I do this on all of my Win95 system (usually not in a dedicated 
partition, though), because as the swapfile becomes fragmented, 
it drastically slows down Windows.  Your old copy of Windows 
doesn't just SEEM slower than when it was new, it IS slower!

A few other notes to clarify some things:

Once Windows creates the new swapfile to your minimum-size 
specification, it won't ever free those sectors again.
You should be able to track them down and scribble on them 
from BSD to your heart's content, as long as it leaves 
everything looking legal to Windows.  If someone boots DOS 
and deletes your Windows swapfile, THEN things will change.

Windows can't defragment its own swapfile, so you need to move 
the swapfile to a new or freshly defragmented partition in order 
to defragment the existing swapfile. 

Some third party defrag programs that run under DOS can defrag 
the Windows swapfile (or for that matter, under DOS you can just 
delete the swapfile and then defrag the partition).  This would 
give you a way to defrag the swapfile without a second partition.

If you have enough ram, you should be able to boot Windows and 
defrag the partition with a zero-size swapfile.  That might be 
another way to defrag the swapfile, but I wouldn't bet on it.  



-- Bob
   bjohnson@cmave.usda.ufl.edu
   bjohnson@gainesville.usda.ufl.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-small" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3849F7EF.FFCFC66F>