The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] ed.c on Unix v5
@ 2015-12-19 13:56 Noel Chiappa
  0 siblings, 0 replies; 14+ messages in thread
From: Noel Chiappa @ 2015-12-19 13:56 UTC (permalink / raw)


    > From: Mark Longridge

    > Not too sure about reversing getpid.o, but maybe possible with db?

Well, me, I'd just use 'od' - but then again, I have ucode for disassembling
PDP-11 octal! :-) (OK, OK, so a lot of the less common instructions I have
to look up! :-)

But, seriously, yeah, 'db' is probably the way to go.

FWIW, it's possible to get 'adb' running under V6 without much (any?) work,
too. Although maybe it needs the 'phototypesetter' C compiler? I'd have to
check...

There's also a 'cdb' running around (I found a copy on the 'Shoppa disks'),
which is basically 'db' but augmented with a few useful commands - maybe stack
backtrace, I don't recall the details, the documentation in on my V6, and I
don't feel like spinning it up just to look for that.

	Noel



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [TUHS] ed.c on Unix v5
@ 2015-12-19 15:47 Noel Chiappa
  0 siblings, 0 replies; 14+ messages in thread
From: Noel Chiappa @ 2015-12-19 15:47 UTC (permalink / raw)


    > From: Random832

    > Not quite. On a stock V6 kernel, system call 30 (smdate/utime) maps to
    > nullsys rather than nosys.

Oh, right. (Hadn't checked the number, assumed they used a new one for utime.)

	Noel



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [TUHS] ed.c on Unix v5
@ 2015-12-19 15:10 Noel Chiappa
  2015-12-19 15:22 ` Random832
  0 siblings, 1 reply; 14+ messages in thread
From: Noel Chiappa @ 2015-12-19 15:10 UTC (permalink / raw)


    > From: Random832

    > Non-existent syscalls map to nosys, which sets u_error to 100 ... which
    > causes the process to be sent a signal SIGSYS.

Oh, right, I'd forgotten that.

So, getting back to v6tar, I'll bet that if you try and use it to _read_ a TAR
file file under V6 (i.e. write files into the V6 filesystem), it will bomb out
(because of the call to utime).

     Noel



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [TUHS] ed.c on Unix v5
@ 2015-12-19 12:12 Noel Chiappa
  2015-12-19 12:40 ` Mark Longridge
  0 siblings, 1 reply; 14+ messages in thread
From: Noel Chiappa @ 2015-12-19 12:12 UTC (permalink / raw)


    > From: Mark Longridge <cubexyz at gmail.com>

    > if one looks at /lib/libc.a via 'ar t getpid.o' you can see the object
    > file getpid.o

Library, schlibrary! The important question is 'is it in the kernel source'?
(Although now that I think about it, if the library routine tries to use a
non-existent system call, it should return an error. It would be interested
to disassemble the library routine, and see what it thinks it is doing.)

   Noel



^ permalink raw reply	[flat|nested] 14+ messages in thread
* [TUHS] ed.c on Unix v5
@ 2015-12-17 15:13 Mark Longridge
  2015-12-19  2:27 ` Dave Horsfall
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Longridge @ 2015-12-17 15:13 UTC (permalink / raw)


Ok, not sure if anyone will want to do this but I've just compiled
ed.c from Unix v6 on Unix v5.

It's not much bigger than the assembled ed, with 1314 lines of C code
the compiled executable is only 6518 bytes vs 4292 for the original. I
was looking at the source code and didn't see anything that the v5 cc
couldn't handle. I trimmed the source a bit, there's a function at the
end called getpid()  which is commented out.

The comment says:

/* Get process ID routine if system call is unavailable. */

but my version of v5 does have that system call so it's all good.

It's been run a few times and it seems to work just fine. It may even
have a few more features than the v5 ed, I'm not sure yet :)

Mark



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-12-19 20:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-19 13:56 [TUHS] ed.c on Unix v5 Noel Chiappa
  -- strict thread matches above, loose matches on Subject: below --
2015-12-19 15:47 Noel Chiappa
2015-12-19 15:10 Noel Chiappa
2015-12-19 15:22 ` Random832
2015-12-19 12:12 Noel Chiappa
2015-12-19 12:40 ` Mark Longridge
2015-12-17 15:13 Mark Longridge
2015-12-19  2:27 ` Dave Horsfall
2015-12-19  8:34   ` Mark Longridge
2015-12-19 14:57     ` Random832
2015-12-19 16:18     ` John Cowan
2015-12-19 17:02       ` Craig Lennox
2015-12-19 20:05         ` Random832
2015-12-19 18:36       ` Marc Rochkind

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).