The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
To: tuhs@tuhs.org
Cc: jnc@mercury.lcs.mit.edu
Subject: [TUHS] Re: machine code translation,as mental architecture models
Date: Wed, 10 Jul 2024 16:34:22 -0400 (EDT)	[thread overview]
Message-ID: <20240710203422.284BA18C077@mercury.lcs.mit.edu> (raw)

    > From: Dan Cross
 
    > These techniques are rather old, and I think go back much further than
    > we're suggesting. Knuth mentions nested translations in TAOCP ..
    > suggesting the technique was well-known as early as the mid-1960s.

I'm not sure what exactly you're referring to with "[t]hese techniques"; I
gather you are talking about the low-level mechanisms used to implement
'system calls'? If so, please permit me to ramble for a while, and revise
your time-line somewhat.

There are two reasons one needs 'system calls'; low-level 'getting there from
here' (which I'll explain below), and 'switching operating/protection
domains' (roughly, from 'user' to 'kernel').

In a batch OS which only runs in a single mode, one _could_ just use regular
subroutine calls to call the 'operating system', to 'get there from here'.
The low-level reason not to do this is that one would need the addresses of
all the routines in the OS (which could change over time). If one instead
used permanent numbers to identify system calls, and had some sort of 'system
call' mechanism (an instruction - although it could be a subroutine call to a
fixed location in the OS), one wouldn't need the addresses. But this is just
low level mechanistic stuff. (I have yet to research to see if any early OS's
did use subroutine calls as their interface.)

The 'switching operating/protection domains' is more fundamental - and
unavoidable. Obviously, it wouldn't have been needed before there were
machines/OS's that operated in multiple modes. I don't have time to research
which was the _first_ machine/OS to need this, but clearly CTSS was an early
one. I happen to have a CTSS manual (two, actually :-), and in CTSS a system
call was:

	TSX	NAMEI, 4
 	..
	..
NAMEI:	TIA	=HNAME

where 'NAME' "is the BCD name of a legitimate supervisor entry point", and
the 'TIA' instruction may be "usefully (but inexactly) read as Trap Into A
core" (remember that in CTSS, the OS lived in the A core). (Don't ask me what
HNAME is, or what a TSX instruction does! :-)


So that would have been 1963, or a little earlier. By 1965 (see the 1965 Fall
Joint Computer Conference papers:

  https://multicians.org/history.html

for more), MIT had already moved on to the idea of using a subroutine calls
that could cross protection domain boundaries for 'system calls', for
Multics. The advantage of doing that is that if the machine has a standard
way of passing arguments to subroutines, you natively/naturally get arguments
to system calls.

	Noel

             reply	other threads:[~2024-07-10 20:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 20:34 Noel Chiappa [this message]
2024-07-10 20:53 ` Dan Cross
2024-07-10 22:29   ` Al Kossow
2024-07-10 23:00     ` John Levine
2024-07-10 23:14       ` segaloco via TUHS
2024-07-10 21:26 ` John Levine
2024-07-11  1:29   ` Dan Cross
  -- strict thread matches above, loose matches on Subject: below --
2024-07-10  2:20 [TUHS] Re: mental architecture models, Anyone ever heard of teaching a case study of Initial Unix? Douglas McIlroy
2024-07-10  2:36 ` [TUHS] Re: machine code translation,as mental architecture models John Levine
2024-07-10  4:59   ` Lars Brinkhoff
2024-07-10 12:53     ` John R Levine
2024-07-10 11:56   ` Paul Winalski
2024-07-10 14:12   ` Marc Donner
2024-07-10 16:58     ` segaloco via TUHS
2024-07-10 17:15       ` Dan Cross
2024-07-10 19:23       ` Marc Donner
2024-07-10 19:38         ` Clem Cole
2024-07-10 20:04           ` Marc Donner
2024-07-10 21:18         ` Adam Thornton

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=20240710203422.284BA18C077@mercury.lcs.mit.edu \
    --to=jnc@mercury.lcs.mit.edu \
    --cc=tuhs@tuhs.org \
    /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).