embedded libraries for PDP-11, was Re: [HECnet] DECUS RSX C compiler

Johnny Billquist bqt at softjar.se
Tue Oct 23 01:19:40 PDT 2012


On 2012-10-23 00:07, Dave McGuire wrote:
On 10/22/2012 05:35 PM, Paul_Koning at Dell.com wrote:
The main barrier to a bare metal binary, or for that matter a not so
bare metal one, is the supporting libraries.   I did a *really* crude
hack job on newlib to give me just enough bare metal support that I
could run the GCC test suite under SIMH.   But that certainly isn't
enough for real bare metal.

A pdp11 port of newlib would be a nice project.
I tried... But it is too big. I think I got a fatty library because I
selected the floating point support... I tried to use sprintf() and it
didn't even fit into the PDP address space :(.

  The printf() family is GIGANTIC.   In newlib there are non-FP-enabled
versions of those functions; iprintf(), siprintf(), etc.   They are much,
much smaller than their floating-point counterparts.   I suggest you try
again with that and see where things land.

  I'm using them on ARM7 with great results.   Granted that's got a much
larger address space, but my resultant binaries and stack utilization
are still pretty small.

The 2.11BSD lib looks
leaner, and I am using it in my pet OS project (I pick the pieces I need
"on the run", I have not done a complete port... yet).

  If the above suggestion doesn't get you anywhere, perhaps avrlibc
could be hacked into a PDP-11 library.   All of the hardware support will
have to be ripped out of course, but there are nice tight
implementations of generic library functions in there.

Nice idea.   Or the libc from DECUS C?

    Hmm yes.   Will there be compiler compatibility issues there? (like
with anything done in assembler, asm/C interface etc?)

You could use the DECUS C libc, but you need to rewrite part of it. I bet the calling convention for gcc isn't the same as for DECUS C. Also, DECUS C does not expect to run on bare metal, so some basic I/O functionality needs to be written as well.

But this is all pretty simple if you know your assembler.

	Johnny

-- 
Johnny Billquist                                   || "I'm on a bus
                                                                  ||   on a psychedelic trip
email: bqt at softjar.se                         ||   Reading murder books
pdp is alive!                                         ||   tryin' to stay hip" - B. Idol



More information about the Hecnet-list mailing list