[pups] Swap device in V6?

Robin Birch robin at ruffnready.co.uk
Tue Feb 27 06:17:18 AEST 2001

In later unixes, 2.11 for instance, /dev/swap is a link to the swap
device.  Is ps attempting to open /dev/swap and finding that it either
isn't there or it is mknoded to an incorrect device?


In message <8D25F244B8274141B5D313CA4823F39C0235D1C9 at red-msg-06.redmond.
corp.microsoft.com>, Ian King <iking at microsoft.com> writes
>I, too, have /dev/rk0 mknod'ed as 0,0.  Relaetd to this, ps does something
>odd (at least to my experience) with the open() system call - it calls 'open
>("/dev")', without a second argument for mode; that seems like a no-no in C,
>but for C of this era I'm not sure.  That call seems to succeed; it's a few
>statements later where it fails with the "no swap device" console message.  
>But where cc seems to be failing (in /lib/c0), it is doing a fork(),
>execve() and wait(), and if the system needs to swap to do that, not being
>able to find swap space would sure bugger things up.  
>I'll examine my /dev/rk0 structure next....  -- Ian 
>-----Original Message-----
>From: Ken Wellsch [mailto:kwellsch at tampabay.rr.com]
>Sent: Monday, February 26, 2001 9:52 AM
>To: Roger Ivie
>Cc: PUPS at minnie.cs.adfa.edu.au
>Subject: Re: [pups] Swap device in V6?
>Roger Ivie wrote:
>> Ian King said:
>> > I've combed the docs and the code, and I can't find ANYthing about how =
>> > swap space is assigned or designated.  Does anyone have any hints?  =
>> > Thanks -- Ian=20
>> Yeah, I figured this out a while ago. Unfortunately, I'm in the middle
>> of changing employers so everything's in boxes at the moment.
>> Basically, the swap space is hard-coded into the device drivers. If you
>> take a look at, for example, the RK05 driver you'll see that one of the
>> drives is smaller than the others. That extra space is the swap space.
>> I forget how the rest of the system is informed of the swap space, but
>> it's done in the disk driver sources IIRC.
>I took a quick look at this this morning and as Roger says, the kernel
>is built with a wired in swap.  In the case of the kernel 'rkunix,' in
>looking at usr/sys/run or something like that, I see they are wiring
>the swap to be device major=0 and minor=0 which is the root RK05 drive.
>Looking at the code it seems the first 4000 blocks are file system and
>a following 782 (or something like that) are for swap.
>The "ps" command source appears to be poking around /dev looking for a
>block device that matches the kernel value for swapdev (or something like
>that) and confirming it is a block device.
>Yet I see I have /dev/rk0 mknod'ed 0/0 and it is a block device but "ps"
>still gripes about "no swap device."
>So I'm missing something I guess.
>-- Ken

Robin Birch     robin at ruffnready.co.uk

M1ASU/2E0ARJ/M5ABD     Old computers and radios always welcome

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

More information about the TUHS mailing list