The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: ron@ronnatalie.com (Ronald Natalie)
Subject: [TUHS] single user mode in v5 & v6
Date: Fri, 9 Jan 2015 09:44:19 -0500	[thread overview]
Message-ID: <E070ADE7-C23B-4641-A2BD-4E0FF7567C82@ronnatalie.com> (raw)
In-Reply-To: <CAC20D2NZL5LanOFEFiNa+a4Mb9GAhpwk9jGgVheh4QE90dKnWg@mail.gmail.com>

If I recall, PS read /dev/kmem to get the proc structure which was a table of all the active processes.
The user structure of the currently running process is the only one that is guaranteed to be in memory (the others could be paged out)
and at least on our system was always located at 0140000.    Any processes that were swapped you could read the user structure
so things that were stored there were often unavailable (particularly the command name).   Yeah, so ps had intimate knowledge of the
layout of the kernel user and proc structures.

We moved a short version of the command name into the proc structure for reason.   We added a new TTY special character ^T
(borrowed that from the KA-10 guys) to do a brief listing of the processes controlled by the current terminal from within the kernel. (Mike Muuss did this while he was playing with scheduler hacking).

> 
> 
> Also remember for early UNIX, ps "knew" about some kernel data structures and had to compiled with the same sources that your kernel used if you want all the command field in particular to look reasonable.
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20150109/4fccbb2b/attachment.html>


  reply	other threads:[~2015-01-09 14:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09  6:18 Noel Chiappa
2015-01-09 14:23 ` Ronald Natalie
2015-01-09 14:36   ` Clem Cole
2015-01-09 14:36 ` Clem Cole
2015-01-09 14:44   ` Ronald Natalie [this message]
2015-01-09 16:52     ` Clem cole
  -- strict thread matches above, loose matches on Subject: below --
2015-01-09 18:38 Noel Chiappa
2015-01-09 20:54 ` Clem Cole
2015-01-09 20:57   ` Ronald Natalie
2015-01-09 21:18     ` Clem Cole
2015-01-09 18:06 Noel Chiappa
2015-01-09 18:59 ` Dave Horsfall
2015-01-09  4:59 Mark Longridge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E070ADE7-C23B-4641-A2BD-4E0FF7567C82@ronnatalie.com \
    --to=ron@ronnatalie.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).