The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: random832@fastmail.us (random832@fastmail.us)
Subject: [TUHS] pdp11 UNIX memory allocation.
Date: Tue, 06 Jan 2015 17:36:31 -0500	[thread overview]
Message-ID: <1420583791.864424.210436089.64BFA544@webmail.messagingengine.com> (raw)
In-Reply-To: <1420583703.863814.210431037.61D6C6EC@webmail.messagingengine.com>

Apparently the message I was replying to was off-list, but it seems like
a waste to have typed all this out (including answering my own question)
and have it not go to the list.

On Tue, Jan 6, 2015, at 17:35, random832 at fastmail.us wrote:
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/factor.s
> wrchar:
> 	mov     r0,ch
> 	mov     $1,r0
> 	sys     write; ch; 1
> 	rts     r5
> 
> Though it looks like the C wrappers use the "indirect" system call which
> reads a "fake" trap instruction from the data segment. Looking at the
> implementation of that, my question is answered:
> 
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/sys/trap.c
> 		if (callp == sysent) { /* indirect */
> 			a = (int *)fuiword((caddr_t)(a));
> 			pc++;
> 			i = fuword((caddr_t)a);
> 			a++;
> 			if ((i & ~077) != SYS)
> 				i = 077;        /* illegal */
> 			callp = &sysent[i&077];
> 			fetch = fuword;
> 		} else {
> 			pc += callp->sy_narg - callp->sy_nrarg;
> 			fetch = fuiword;
> 		}
> 
> http://minnie.tuhs.org/TUHS/Archive/PDP-11/Trees/V7/usr/man/man2/indir.2
> The main purpose of indir is to allow a program to
> store arguments in system calls and execute them
> out of line in the data segment.
> This preserves the purity of the text segment.
> 
> Note also the difference between V2 and V5 libc - clearly support for
> split I/D machines was added some time in this interval.
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=V2/lib/write.s
> http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s4/write.s



  parent reply	other threads:[~2015-01-06 22:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.147.1420574271.3354.tuhs@minnie.tuhs.org>
2015-01-06 20:20 ` Johnny Billquist
2015-01-06 20:33   ` random832
2015-01-06 21:57     ` Ronald Natalie
2015-01-06 22:00       ` Clem Cole
2015-01-06 22:04         ` Ronald Natalie
2015-01-07  1:46       ` Dave Horsfall
2015-01-07  2:00         ` Ronald Natalie
2015-01-07  6:29           ` Dave Horsfall
2015-01-07  6:39             ` Warren Toomey
2015-01-07 10:06               ` Brantley Coile
2015-01-07 13:29             ` Jacob Ritorto
     [not found]     ` <CAC20D2PP1hGyYsep1yNtj9KO55a-V02+QHS+S7bX-4joJy222g@mail.gmail.com>
     [not found]       ` <1420583703.863814.210431037.61D6C6EC@webmail.messagingengine.com>
2015-01-06 22:36         ` random832 [this message]
     [not found] <mailman.149.1420581544.3354.tuhs@minnie.tuhs.org>
2015-01-06 22:20 ` Johnny Billquist
2015-01-06 22:36   ` Ronald Natalie
2015-01-06 23:14     ` Johnny Billquist
2015-01-07  2:39   ` John Cowan
2015-01-07  2:59     ` Johnny Billquist
2015-01-06 22:45 Noel Chiappa
2015-01-06 22:55 ` Clem Cole
     [not found] <mailman.151.1420584979.3354.tuhs@minnie.tuhs.org>
2015-01-06 23:34 ` Johnny Billquist
2015-01-06 23:52   ` scj
2015-01-07 16:14   ` Clem Cole
2015-01-07 17:27     ` Dave Horsfall
2015-01-07  2:18 Noel Chiappa
2015-01-07 16:17 ` Clem Cole

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=1420583791.864424.210436089.64BFA544@webmail.messagingengine.com \
    --to=random832@fastmail.us \
    /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).