[pups] Swap device in V6?

John Holden johnh at psych.usyd.edu.au
Tue Feb 27 07:44:23 AEST 2001


The root device, swap device, swap size and offset are hard coded into the
kernel configuration file c.c. This is build by 'myconf', although a lot
of people would directly edit l.s and c.c (in /usr/sys/conf). There are no
magic /dev/swap entries. Edition 7 does the same thing.

For a RK05 disk, the filesystem would typically occupy 4000 blocks, with the
last 872 being allocated for swap. If you built a new root disk, you had to
be careful that the disk size you gave to 'mkfs', didn't overlap the
hard configured swap disk. No disk partitions.

You can find out the current values by using one of the debuggers (db or cdb)
to find the values of swap (_swapdev), swap size (_nswap), swap offset (_swplo)
and root device (_rootdev). You can also use 'nm' to get the symbol table,
and 'od' the kernel file /unix. The RK05 was usually the first entry in
the device switch tables, so the major/minor numbers are usually 0.

The 'ps' command looks up the symbol table of the unix kernel, and gets
the device entry for swap (_swapdev), and the process table (_proc)
It would open /dev as file, and read the directory entries to find a matching
device entry, so it then had the name of a device to open (you cannot open
a device based only in the major and minor device entries from a user process).
It also uses /dev to decode tty entries into names.

For 'ps' to work correctly, /unix had to be linked to the real kernel, say
rkunix.



Received: (from major at localhost)
	by minnie.cs.adfa.edu.au (8.9.3/8.9.3) id JAA55090
	for pups-liszt; Tue, 27 Feb 2001 09:32:10 +1100 (EST)
	(envelope-from owner-pups at minnie.cs.adfa.edu.au)


More information about the TUHS mailing list