swap space

Mark J. Sienkiewicz ignatz at wam.umd.edu
Sat Jun 15 09:19:53 AEST 1991


In article <1991Jun11.030216.6155 at ceilidh.beartrack.com> dnichols at ceilidh.beartrack.com (DoN Nichols) writes:
>In article <1991Jun9.170520.4087 at yenta.alb.nm.us> dt at yenta.alb.nm.us (David B. Thomas) writes:
>>How does the 3b1 know where to find swap space, and can it use the "swap
>>partition" on the second hard disk?
>
>	It looks for the special device file "/dev/swap".  Here, we see that

This is not correct.  It uses partition #1 on hard disk #0.  This just happens
to be named /dev/swap, but the kernel does not look in /dev to find it.  It
just uses the block device with major number 0, minor number 1.

>	You should be able to simply replace "/dev/swap" with a link to the

as described above, this doesn't work.

>other, so you could increase the space to handle emergency conditions, since
>the actual "swap" proceedure is used only under relative emergency
>conditions, with paging used for normal conditions.

The swap area is used both to swap processes and to store DATA pages when
they are paged out.  Read only TEXT pages are never swapped out, but they
are sometimes thrown away and re-read from the a.out file you are executing.

>and general understanding.  If I gave wrong advice, I'm sure I'll hear about
>it :-)

Congrats! I wish more people on the net had this attitude.

There are variables in most unix kernels:
	_swapdev	major/minor # of swap device
	_swplo		first block number on device available for swapping
	_nswap		number of blocks available

Not all unixes have these.  If you are knowledgeable, brave, or foolhardy,
you can use ADB to modify your kernel to change these.  DO NOT DO THIS TO
A RUNNING KERNEL.  cp /unix /unix.hacked; adb /unix.hacked; then boot the
modified kernel.

happy hacking.



More information about the Comp.sys.3b1 mailing list