[pups] Swap device in V6?

Ian King iking at microsoft.com
Tue Feb 27 06:29:48 AEST 2001


I was wondering about that, as I've seen that sort of thing in other *nixes,
too.  I tried creating a link to /dev/swap from /dev/rk0, and it didn't help
ps (same error message).  

I'm going to figure out some way to print out ps.c later and trace through
it; I was going through it with ed on the PDP-11 (which was fun, in a
twisted, nostalgic sort of way).  If I can figure out exactly how it's
looking for what it's looking for, perhaps I can figure out why it isn't
finding it.  :-)  

I've found the stuff on coming up in single-user mode, too - with 173030 in
the switch register (I have the programmer's panel on my 11/34a).  FYI.  --
Ian 

-----Original Message-----
From: Robin Birch [mailto:robin at ruffnready.co.uk]
Sent: Monday, February 26, 2001 12:17 PM
To: Ian King
Cc: 'Ken Wellsch'; Roger Ivie; PUPS at minnie.cs.adfa.edu.au
Subject: Re: [pups] Swap device in V6?


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?

Robin

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 IAA54716
	for pups-liszt; Tue, 27 Feb 2001 08:12:35 +1100 (EST)
	(envelope-from owner-pups at minnie.cs.adfa.edu.au)


More information about the TUHS mailing list