The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] 2.11BSD cross compiler
       [not found] <mailman.2278.1285732537.1039.tuhs@minnie.tuhs.org>
@ 2010-09-29 16:20 ` John Finigan
  0 siblings, 0 replies; 13+ messages in thread
From: John Finigan @ 2010-09-29 16:20 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

> > There is close zero chance I'll ever use this stuff,
> > unless I retire
> > to teaching in which case I'll make people write
> > PDP-11 assembler.
> 
> That seems a tad archaic.  MIPS might be a better
> choice; it's 32-bit
> with 32 registers, and there are excellent simulators for
> it.

At my university there's a grad class that's ostensibly on reverse
engineering,but you can't really disassemble anything if you don't
learn assembler, so you learn it.  The downside, I guess, is that
I've read a decent amount of x86 assembler, but written very little.

I don't think it's a bad way to learn, but of course, Larry was
talking about teaching a nice instruction set, and you
kind of lose that.  But you get Windows DLL function calling 
back as a booby prize.  

John Finigan




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

* [TUHS] 2.11BSD cross compiler
  2010-09-29 20:54             ` Peter Jeremy
@ 2010-09-29 21:34               ` Larry McVoy
  0 siblings, 0 replies; 13+ messages in thread
From: Larry McVoy @ 2010-09-29 21:34 UTC (permalink / raw)


On Thu, Sep 30, 2010 at 06:54:42AM +1000, Peter Jeremy wrote:
> On 2010-Sep-28 20:55:34 -0700, Larry McVoy <lm at bitmover.com> wrote:
> >On Wed, Sep 29, 2010 at 05:17:33AM +0200, Steve Nickolas wrote:
> >> Dunno, the only instruction set I really grok is 65C02, which is by your  
> >> standards probably little more than a toy.
> >
> >Oh, no.  Useful.  There was similar Intel (i think) cpu that was flashable.
> 
> Maybe 8748.  There was a mask version of this in the PC keyboard
> controller (and hence still buried in most if not all southbridges).
> That was followed by the 8051 family (8751 would have been the EPROM
> version) - which I believe was very popular in car ECUs.  It was also

I think it was a variant of the 8051 that had EPROM and 3 UARTs.  Because
I needed 3 - one for the long line to the CS building, and 2 for the 2
terminals.
-- 
---
Larry McVoy                lm at bitmover.com           http://www.bitkeeper.com



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  3:55           ` Larry McVoy
@ 2010-09-29 20:54             ` Peter Jeremy
  2010-09-29 21:34               ` Larry McVoy
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Jeremy @ 2010-09-29 20:54 UTC (permalink / raw)


On 2010-Sep-28 20:55:34 -0700, Larry McVoy <lm at bitmover.com> wrote:
>On Wed, Sep 29, 2010 at 05:17:33AM +0200, Steve Nickolas wrote:
>> Dunno, the only instruction set I really grok is 65C02, which is by your  
>> standards probably little more than a toy.
>
>Oh, no.  Useful.  There was similar Intel (i think) cpu that was flashable.

Maybe 8748.  There was a mask version of this in the PC keyboard
controller (and hence still buried in most if not all southbridges).
That was followed by the 8051 family (8751 would have been the EPROM
version) - which I believe was very popular in car ECUs.  It was also
multi-sourced.  I've used both i8748 and a Philips 8051 clone at $work
many years ago.

>Anyhoo, the 6502 is a fine little processor and knowing how to make it
>sing is a useful skill.

For various reasons, I never learnt 6502.  I preferred the Motorola CPUs
(though $work was very Intel based).

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20100930/ea6ae489/attachment.sig>


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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  3:17         ` Steve Nickolas
@ 2010-09-29  3:55           ` Larry McVoy
  2010-09-29 20:54             ` Peter Jeremy
  0 siblings, 1 reply; 13+ messages in thread
From: Larry McVoy @ 2010-09-29  3:55 UTC (permalink / raw)


On Wed, Sep 29, 2010 at 05:17:33AM +0200, Steve Nickolas wrote:
> On Tue, 28 Sep 2010, Larry McVoy wrote:
>
>> Color me old school.  I like MIPS, I worked at SGI (got married to
>> an old school MIPS gal) but PDP-11 is so frigging intuitive.  How
>> can you not understand that instruction set?  If you can't, well,
>> sorry, not so much in my book.  It's like a stripped down C.
>>
>> Come on - has anyone ever seen a better instruction set?  More
>> complicated, yeah, holy moly, yeah.  But cleaner?  We owe DEC
>> for that one.
>
> Dunno, the only instruction set I really grok is 65C02, which is by your  
> standards probably little more than a toy.

Oh, no.  Useful.  There was similar Intel (i think) cpu that was flashable.
I wrote code for it that muxed two lines over one serial line.  I'm sorta
proud of this, this was back in the BLIT days (loved that terminal, holy
crap, loved it).  I was a grad student at Wisconsin and we had one long
serial port line to our office, no ethernet (this was back when 10Mbit
was really weird).  Shared an office with another guy and we had one
blit.  I talked the department out of another one, and did a wire wrapped
board with that CPU on it and all it did was use the 8th bit to mux.
Bit set, his blit, not set, my blit.

Worked fantastic until the blits melted.  Still miss those, they were the
X terminal ahead of their time. 

Anyhoo, the 6502 is a fine little processor and knowing how to make it
sing is a useful skill.

It's not the toy-ness so much, it's what you do with it.  You can do a
lot with that CPU, ask any car company.
-- 
---
Larry McVoy                lm at bitmover.com           http://www.bitkeeper.com



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  2:59         ` John Cowan
@ 2010-09-29  3:44           ` Larry McVoy
  0 siblings, 0 replies; 13+ messages in thread
From: Larry McVoy @ 2010-09-29  3:44 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2533 bytes --]

On all this old school stuff - just in case you think it doesn't matter,
it does.  One of the best guys I have here is a guy who did printer 
firmware.  I had to teach him what a cache was, he had never seen one.
But holy moly does he hold the whole picture in his head.  And has 
forgotten more about SCM than I'll ever know (we do that stuff, 
BitKeeper, etc).

People who understand the hardware are useful.  I cringe at what we 
call a CS degree these days.

And BTW, if you are one of those old school guys and want a job, hit 
me up.  We're very picky, we have a ~8 year retention rate, but that's
because we make sure that you will be happy and we will be happy.  If
we have one good hire a year I'm ecstatic.  Gotta be Bay Area for the
first year though (you can live in my guest house in the redwoods :)

--lm

On Tue, Sep 28, 2010 at 10:59:22PM -0400, John Cowan wrote:
> On Tue, Sep 28, 2010 at 10:38 PM, Larry McVoy <lm at bitmover.com> wrote:
> 
> > Color me old school.  I like MIPS, I worked at SGI (got married to
> > an old school MIPS gal) but PDP-11 is so frigging intuitive.  How
> > can you not understand that instruction set?  If you can't, well,
> > sorry, not so much in my book.  It's like a stripped down C.
> 
> Yeah.  I used it on and off, but my serious assembler programming was
> on the PDP-8.  Now *that* was seriously small, but you had to know the
> tricks, like how to find out the absolute address of the 128-word
> memory page following the one you are on when writing PIC code for
> OS/8 device drivers, or how to microprogram the operate instructions
> get interesting constants into the AC.
> 
> > Come on - has anyone ever seen a better instruction set?  More
> > complicated, yeah, holy moly, yeah.  But cleaner?  We owe DEC
> > for that one.
> 
> I remember how appalled I was when I saw the VAX instruction set.
> Luckily, it didn't matter: I never did assembler again.  Still, trying
> to make people think in octal at this late date seems unnecessary.
> 
> > Personally, I like anyone who can do any assembler.  One of my interview
> > questions is "have you written swtch?"
> 
> /me chuckles.
> 
> >  If you don't get the question you are not an OS person,
> > if you are, of course you get it.
> 
> Well, I know what it is but I've never written it.  There was a bug in
> the V6 kernel version anyhow.
> 
> > Ken Witte - wonder where he is now.
> 
> Too many others out there, alas.

-- 
---
Larry McVoy                lm at bitmover.com           http://www.bitkeeper.com



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  2:38       ` Larry McVoy
  2010-09-29  2:59         ` John Cowan
  2010-09-29  3:14         ` M. Warner Losh
@ 2010-09-29  3:17         ` Steve Nickolas
  2010-09-29  3:55           ` Larry McVoy
  2 siblings, 1 reply; 13+ messages in thread
From: Steve Nickolas @ 2010-09-29  3:17 UTC (permalink / raw)


On Tue, 28 Sep 2010, Larry McVoy wrote:

> Color me old school.  I like MIPS, I worked at SGI (got married to
> an old school MIPS gal) but PDP-11 is so frigging intuitive.  How
> can you not understand that instruction set?  If you can't, well,
> sorry, not so much in my book.  It's like a stripped down C.
>
> Come on - has anyone ever seen a better instruction set?  More
> complicated, yeah, holy moly, yeah.  But cleaner?  We owe DEC
> for that one.

Dunno, the only instruction set I really grok is 65C02, which is by your 
standards probably little more than a toy.

-uso.



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  2:38       ` Larry McVoy
  2010-09-29  2:59         ` John Cowan
@ 2010-09-29  3:14         ` M. Warner Losh
  2010-09-29  3:17         ` Steve Nickolas
  2 siblings, 0 replies; 13+ messages in thread
From: M. Warner Losh @ 2010-09-29  3:14 UTC (permalink / raw)


In message: <20100929023819.GA12919 at bitmover.com>
            Larry McVoy <lm at bitmover.com> writes:
: Had a TA who could read octal dumps just like they
: were C.  Ken Witte - wonder where he is now.  I used to bribe him with
: a six pack to come over and help me and he'd have a beer in his hand
: and the line printer output in the other and be laughing at me for some
: retarded thing I had done that he figured out from the octal.

I used to impress the first year C students by typing 'more core' and
then pointing to a random spot on the screen and saying "Oh, you
passed NULL to strcmp here."  The sad thing was, I had about a 75% hit
rate...  Not really a 'skill' but rather just knowing the common
errors for the current assignment and being a lucky guesser :)

Warner



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  2:38       ` Larry McVoy
@ 2010-09-29  2:59         ` John Cowan
  2010-09-29  3:44           ` Larry McVoy
  2010-09-29  3:14         ` M. Warner Losh
  2010-09-29  3:17         ` Steve Nickolas
  2 siblings, 1 reply; 13+ messages in thread
From: John Cowan @ 2010-09-29  2:59 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On Tue, Sep 28, 2010 at 10:38 PM, Larry McVoy <lm at bitmover.com> wrote:

> Color me old school.  I like MIPS, I worked at SGI (got married to
> an old school MIPS gal) but PDP-11 is so frigging intuitive.  How
> can you not understand that instruction set?  If you can't, well,
> sorry, not so much in my book.  It's like a stripped down C.

Yeah.  I used it on and off, but my serious assembler programming was
on the PDP-8.  Now *that* was seriously small, but you had to know the
tricks, like how to find out the absolute address of the 128-word
memory page following the one you are on when writing PIC code for
OS/8 device drivers, or how to microprogram the operate instructions
get interesting constants into the AC.

> Come on - has anyone ever seen a better instruction set?  More
> complicated, yeah, holy moly, yeah.  But cleaner?  We owe DEC
> for that one.

I remember how appalled I was when I saw the VAX instruction set.
Luckily, it didn't matter: I never did assembler again.  Still, trying
to make people think in octal at this late date seems unnecessary.

> Personally, I like anyone who can do any assembler.  One of my interview
> questions is "have you written swtch?"

/me chuckles.

>  If you don't get the question you are not an OS person,
> if you are, of course you get it.

Well, I know what it is but I've never written it.  There was a bug in
the V6 kernel version anyhow.

> Ken Witte - wonder where he is now.

Too many others out there, alas.



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  2:14     ` John Cowan
@ 2010-09-29  2:38       ` Larry McVoy
  2010-09-29  2:59         ` John Cowan
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Larry McVoy @ 2010-09-29  2:38 UTC (permalink / raw)


On Tue, Sep 28, 2010 at 10:14:09PM -0400, John Cowan wrote:
> On Tue, Sep 28, 2010 at 8:51 PM, Larry McVoy <lm at bitmover.com> wrote:
> 
> > There is close zero chance I'll ever use this stuff, unless I retire
> > to teaching in which case I'll make people write PDP-11 assembler.
> 
> That seems a tad archaic.  MIPS might be a better choice; it's 32-bit
> with 32 registers, and there are excellent simulators for it.

Color me old school.  I like MIPS, I worked at SGI (got married to
an old school MIPS gal) but PDP-11 is so frigging intuitive.  How
can you not understand that instruction set?  If you can't, well,
sorry, not so much in my book.  It's like a stripped down C.

Come on - has anyone ever seen a better instruction set?  More 
complicated, yeah, holy moly, yeah.  But cleaner?  We owe DEC
for that one.

That said, John is, as always, (probably) right.  He's certainly right
if we are talking about skills that go to today's market, PDP-11 is not
so much.  I said "probably" because I suspect there are some people for
whom the light will go on if they do PDP-11 assembler but not so much
on MIPS.

Personally, I like anyone who can do any assembler.  One of my interview
questions is "have you written swtch?"  If you don't get the question
you are not an OS person, if you are, of course you get it.  In any
assembler (I wrote it in VAX, M68K, NS32032 though that last one was
wishful thinking - I still wish that one hadn't been so buggy).

All this late night rambling aside, +1 on the efforts of Nick, +1 on
anyone who groks PDP-11 assembly.  Those are soon to be lost skills
and I admire them.  Had a TA who could read octal dumps just like they
were C.  Ken Witte - wonder where he is now.  I used to bribe him with
a six pack to come over and help me and he'd have a beer in his hand
and the line printer output in the other and be laughing at me for some
retarded thing I had done that he figured out from the octal.
-- 
---
Larry McVoy                lm at bitmover.com           http://www.bitkeeper.com



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  0:51   ` Larry McVoy
@ 2010-09-29  2:14     ` John Cowan
  2010-09-29  2:38       ` Larry McVoy
  0 siblings, 1 reply; 13+ messages in thread
From: John Cowan @ 2010-09-29  2:14 UTC (permalink / raw)


On Tue, Sep 28, 2010 at 8:51 PM, Larry McVoy <lm at bitmover.com> wrote:

> There is close zero chance I'll ever use this stuff, unless I retire
> to teaching in which case I'll make people write PDP-11 assembler.

That seems a tad archaic.  MIPS might be a better choice; it's 32-bit
with 32 registers, and there are excellent simulators for it.



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

* [TUHS] 2.11BSD cross compiler
  2010-09-29  0:24 ` Tim Newsham
@ 2010-09-29  0:51   ` Larry McVoy
  2010-09-29  2:14     ` John Cowan
  0 siblings, 1 reply; 13+ messages in thread
From: Larry McVoy @ 2010-09-29  0:51 UTC (permalink / raw)


There is close zero chance I'll ever use this stuff, unless I retire
to teaching in which case I'll make people write PDP-11 assembler.

But I had to come say thanks for doing this.  The PDP-11 was such
an amazingly pleasant machine to program.  I can easily imagine that
translating stuff from assembler to C is pretty straightforward.

RIP DEC, you brought us some good stuff.

On Tue, Sep 28, 2010 at 02:24:45PM -1000, Tim Newsham wrote:
>> 7. Fortran stuff had to be disabled as the Fortran compiler is written
>> in assembly language (IIRC) and would probably be difficult to convert
>> into C (but I don't think this is a big deal).
>
> have you considered running Warren's emulator that can
> run individual binaries (rather than emulating the entire
> system)?  This could let you use a few (or many, if you chose)
> native tools in the build process without giving up portability.
>
> http://ftp.math.utah.edu/pub///mirrors/minnie.tuhs.org/PDP-11/Emulators/Apout/
> http://puszcza.gnu.org.ua/software/apout/
>
>> cheers, Nick
>
> Tim Newsham | www.thenewsh.com/~newsham | thenewsh.blogspot.com
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs

-- 
---
Larry McVoy                lm at bitmover.com           http://www.bitkeeper.com



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

* [TUHS] 2.11BSD cross compiler
  2010-09-28  5:54 Nick Downing
@ 2010-09-29  0:24 ` Tim Newsham
  2010-09-29  0:51   ` Larry McVoy
  0 siblings, 1 reply; 13+ messages in thread
From: Tim Newsham @ 2010-09-29  0:24 UTC (permalink / raw)


> 7. Fortran stuff had to be disabled as the Fortran compiler is written
> in assembly language (IIRC) and would probably be difficult to convert
> into C (but I don't think this is a big deal).

have you considered running Warren's emulator that can
run individual binaries (rather than emulating the entire
system)?  This could let you use a few (or many, if you chose)
native tools in the build process without giving up portability.

http://ftp.math.utah.edu/pub///mirrors/minnie.tuhs.org/PDP-11/Emulators/Apout/
http://puszcza.gnu.org.ua/software/apout/

> cheers, Nick

Tim Newsham | www.thenewsh.com/~newsham | thenewsh.blogspot.com



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

* [TUHS] 2.11BSD cross compiler
@ 2010-09-28  5:54 Nick Downing
  2010-09-29  0:24 ` Tim Newsham
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Downing @ 2010-09-28  5:54 UTC (permalink / raw)


hi everyone,

Just to let you all know that a few years ago I adapted the 2.11BSD
source so that it could be built on a modern system and transferred
across to the PDP-11.  The changes are:

1. The PDP-11 assembler was written in assembler so made a
line-by-line translation into C code.
2. The C compiler required access to PDP-11 math e.g. for constant
folding, so I inserted some code from Bob Supnik's emulator in those
places.
3. Basically everything that runs from a makefile (e.g. "sh", "make",
"yacc", etc) has been upgraded to a more modern coding style with non
portable code fixed up, independence on type sizes, prototypes added,
etc, and the build system now generates two versions where
appropriate, one for running locally (compiled with gcc or whatever
your local compiler is) and one for inclusion in the distribution
(compiled with the PDP-11 cross toolchain).
4. I also fixed a number of "just plain bugs" that obviously had
remained undiscovered under PDP-11 conditions.

I used conditional compilation and macros where appropriate so as not
to break the PDP-11's ability to run the toolchain locally.  I used a
binary comparison between the locally compiled build and the cross
compiled build to weed out bugs, and it did seem to be pretty robust
as I left it.  The only reason I didn't make this work available
generally (apart from laziness), was that there's quite a few
experimental changes in addition to points 1-4, for example:

5. A reworking of the (existing) system that extracts strings and puts
them in the code segment (necessary to get the PDP-11 to run large
executables such as nethack).  I can't really remember why I did this,
probably just to clean things up, but I don't think it's all that
essential so perhaps could be removed for the sake of minimal change.
6. Some changes to how "make" works, and to the Makefiles, intended to
clean things up, which in retrospect weren't essential and should be
removed (except for those changes necessary for point 3 above, need to
untangle it somehow).  I didn't get around to converting all Makefiles
so there's probably a bit of inconsistency there.  I might have broken
some things like "make tags" and "make depend", not sure.
7. Fortran stuff had to be disabled as the Fortran compiler is written
in assembly language (IIRC) and would probably be difficult to convert
into C (but I don't think this is a big deal).

If anybody volunteers to sift through the changes and sort out the
good from the dross then I will happily send the whole thing.

cheers, Nick



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

end of thread, other threads:[~2010-09-29 21:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.2278.1285732537.1039.tuhs@minnie.tuhs.org>
2010-09-29 16:20 ` [TUHS] 2.11BSD cross compiler John Finigan
2010-09-28  5:54 Nick Downing
2010-09-29  0:24 ` Tim Newsham
2010-09-29  0:51   ` Larry McVoy
2010-09-29  2:14     ` John Cowan
2010-09-29  2:38       ` Larry McVoy
2010-09-29  2:59         ` John Cowan
2010-09-29  3:44           ` Larry McVoy
2010-09-29  3:14         ` M. Warner Losh
2010-09-29  3:17         ` Steve Nickolas
2010-09-29  3:55           ` Larry McVoy
2010-09-29 20:54             ` Peter Jeremy
2010-09-29 21:34               ` Larry McVoy

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