The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] 2.11 BSD question... (exe sizes)
@ 2010-08-10 22:23 Jason Stevens
  2010-08-11  3:49 ` John Cowan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jason Stevens @ 2010-08-10 22:23 UTC (permalink / raw)


I managed to get 2.11 installed on SIMH, and hacked the de driver to work
(pretty much the same thing I did for 4.2 BSD on the 11/780) and now I've
gotten it networking.

I'll admit I'm not all that swift on the pdp-11, but I get the impression
that the maximum exe size is 128kb with 64kb of instructions, and 64kb of
data?  Isn't there something that can be done with overlays or some other
linker thing to act like an 8086/80286 with the large memory model (ie
multiple segments...?)

I've been trying to build ircII-4.4 and I can't figure out how to link
something that big... I've tried the -Z and -O flags to ld to no avail.

Clearly I'm doing either something wrong, or impossible or stupid.

FWIW, here is the size of the same program on the VAX

myname# ls -l irc-4.4
-rwxr-xr-x  1 root       413696 Jun  8 08:46 irc-4.4*
myname# size irc-4.4
text    data    bss     dec     hex
293888  67584   20784   382256  5d530

I have a feeling that 300kb of text, along with 67kb of data is just too
much...?

Any pointers would be appreciated!

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20100810/53bcfe09/attachment.html>


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

* [TUHS] 2.11 BSD question... (exe sizes)
  2010-08-10 22:23 [TUHS] 2.11 BSD question... (exe sizes) Jason Stevens
@ 2010-08-11  3:49 ` John Cowan
  2010-08-11  4:45   ` Jason Stevens
  2010-08-11  7:27 ` Jochen Kunz
  2010-09-03 11:22 ` Tom Ivar Helbekkmo
  2 siblings, 1 reply; 6+ messages in thread
From: John Cowan @ 2010-08-11  3:49 UTC (permalink / raw)


Jason Stevens scripsit:

> I'll admit I'm not all that swift on the pdp-11, but I get the impression
> that the maximum exe size is 128kb with 64kb of instructions, and 64kb of
> data?  Isn't there something that can be done with overlays or some other
> linker thing to act like an 8086/80286 with the large memory model (ie
> multiple segments...?)

The PDP-11 is inherently a 16-bit-pointer machine; it has no concept
of 32-bit pointers, so it is always either in the x86 small or the x86
tiny model.  On DEC's operating systems, you could indeed set up overlays
that allowed code to be swapped in and out, either to disk or to unmapped
physical memory (much quicker!)  However, AFAIK ld(1) never provided that
capability to userspace, although the technique is used inside the kernel.
In any case, such tricks don't help with data space, which is strictly
limited to 64K.

--
There is / One art                      John Cowan <cowan at ccil.org>
No more / No less                       http://www.ccil.org/~cowan
To do / All things
With art- / Lessness    



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

* [TUHS] 2.11 BSD question... (exe sizes)
  2010-08-11  3:49 ` John Cowan
@ 2010-08-11  4:45   ` Jason Stevens
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Stevens @ 2010-08-11  4:45 UTC (permalink / raw)


>
>
> The PDP-11 is inherently a 16-bit-pointer machine; it has no concept
> of 32-bit pointers, so it is always either in the x86 small or the x86
> tiny model.


I guess it's logical that after the years, intel could at least make *some*
improvements....


> On DEC's operating systems, you could indeed set up overlays
> that allowed code to be swapped in and out, either to disk or to unmapped
> physical memory (much quicker!)  However, AFAIK ld(1) never provided that
> capability to userspace, although the technique is used inside the kernel.
> In any case, such tricks don't help with data space, which is strictly
> limited to 64K.
>

And that pretty much seals the deal.  Oh well, it's amazing how big things
have grown over the years....!



> --
> There is / One art                      John Cowan <cowan at ccil.org>
> No more / No less                       http://www.ccil.org/~cowan
> To do / All things
> With art- / Lessness
>


Thanks anyways!

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20100811/2f3c10d5/attachment.html>


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

* [TUHS] 2.11 BSD question... (exe sizes)
  2010-08-10 22:23 [TUHS] 2.11 BSD question... (exe sizes) Jason Stevens
  2010-08-11  3:49 ` John Cowan
@ 2010-08-11  7:27 ` Jochen Kunz
  2010-09-03 11:22 ` Tom Ivar Helbekkmo
  2 siblings, 0 replies; 6+ messages in thread
From: Jochen Kunz @ 2010-08-11  7:27 UTC (permalink / raw)


On Tue, 10 Aug 2010 18:23:00 -0400
Jason Stevens <neozeed at gmail.com> wrote:

> I get the impression that the maximum exe size is 128kb with 64kb of
> instructions, and 64kb of data? 
> Isn't there something that can be done with overlays
You are limited to 64 kB of data. Code size can be larger then 64 kB
with the help of overlays. Have a look at how the kernel does this.
-- 


\end{Jochen}

\ref{http://www.unixag-kl.fh-kl.de/~jkunz/}




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

* [TUHS] 2.11 BSD question... (exe sizes)
  2010-08-10 22:23 [TUHS] 2.11 BSD question... (exe sizes) Jason Stevens
  2010-08-11  3:49 ` John Cowan
  2010-08-11  7:27 ` Jochen Kunz
@ 2010-09-03 11:22 ` Tom Ivar Helbekkmo
  2 siblings, 0 replies; 6+ messages in thread
From: Tom Ivar Helbekkmo @ 2010-09-03 11:22 UTC (permalink / raw)


Jason Stevens <neozeed at gmail.com> writes:

> I'll admit I'm not all that swift on the pdp-11, but I get the impression
> that the maximum exe size is 128kb with 64kb of instructions, and 64kb of
> data?  Isn't there something that can be done with overlays or some other
> linker thing to act like an 8086/80286 with the large memory model (ie
> multiple segments...?)

There is. :)

> I've been trying to build ircII-4.4 and I can't figure out how to link
> something that big... I've tried the -Z and -O flags to ld to no avail.
>
> Clearly I'm doing either something wrong, or impossible or stupid.

IIRC, you want something along the lines of:

ld -i -o irc -Z a.o b.o -Z c.o d.o -Z e.o f.o -Y g.o h.o -lc

where -i says to use split I/D (64KB for each), each -Z introduces a set
of object modules to go into one overlay, and the -Y introduces the
object modules that are not to be overlaid.  You'll want your main() to
be in the -Y group, ideally along with the most used parts of the code.
Each -Z group should ideally contain object modules that are all used at
the same time; the idea is to minimize the number of overlay swaps that
have to be done.

There are binaries in 2.11BSD that are built in this way.  Look for the
-Z flag in the Makefiles.

Use size(1) on the a.out to see the sizes of the various overlays and
the main area: you'll get error messages from ld(1), and size(1) will
help you figure out how you need to move objects around to keep the main
area under 56KB, and each overlay under 8KB.  (Actually, I seem to
recall that those limits can also be 48 and 16, or 40 and 24, and so
on.  'man ld' might be of help.)

> FWIW, here is the size of the same program on the VAX
>
> myname# ls -l irc-4.4
> -rwxr-xr-x  1 root       413696 Jun  8 08:46 irc-4.4*
> myname# size irc-4.4
> text    data    bss     dec     hex
> 293888  67584   20784   382256  5d530
>
> I have a feeling that 300kb of text, along with 67kb of data is just too
> much...?

You might be able to squeeze it in.  Your data space usage will be less
on a 16-bit system, and you may be able to reduce the sizes of arrays
and allocations here and there by accepting limitations in the resulting
program.

-tih
-- 
I don't believe that souls or bodies can be changed by incantation.
                                            --Christopher Hitchens



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

* [TUHS] 2.11 BSD question... (exe sizes)
       [not found] ` <4C627129.2050509@softjar.se>
@ 2010-08-11 15:05   ` Jason Stevens
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Stevens @ 2010-08-11 15:05 UTC (permalink / raw)


The 'problem' is with the de driver...Basically SIMH flags something wrong
with all incoming packets, and the driver thinks they are all corrupt...

in the procedure derecv

                   if ((rp->r_flags &
(RFLG_ERRS|RFLG_FRAM|RFLG_OFLO|RFLG_CRC))||
                       (rp->r_flags&(RFLG_STP|RFLG_ENP)) !=
(RFLG_STP|RFLG_ENP) ||
                       (rp->r_lenerr & (RERR_BUFL|RERR_UBTO|RERR_NCHN)) ||
                       len < ETHERMIN || len > ETHERMTU) {

something here is being passed wrong.. I've just changed the statement to
if(1==2) to keep the logic flow...

Anyways the same issue cropped up with 4.2 BSD & the VAX 11/780

On my pdp-11 the ini I'm using is:

set cpu 11/94 4M
set cpu cis
set cpu idle
set xu ena
att xu slirp
;attach tm0 211bsd.tap
attach tm0 ircii-4.4.source.tap
set rp0 rp06
attach rp0 auto.dsk
set rq dis
set rk dis
set rl dis
set hk dis
set rx dis
set tq dis
set dz lines=8
att dz 1000
boot rp0

I'm also using a version of SIMH that I've replaced the libpcap with SLiRP
from Qemu.. It's basically a user mode ip stack to do NAT.  The advantage is
that they always have the same ip address, and it doesn't
require escalated privileges to run.

On Wed, Aug 11, 2010 at 5:45 AM, Johnny Billquist <bqt at softjar.se> wrote:

> Jason Stevens <neozeed at gmail.com> wrote:
>
>  I managed to get 2.11 installed on SIMH, and hacked the de driver to work
>> (pretty much the same thing I did for 4.2 BSD on the 11/780) and now I've
>> gotten it networking.
>>
>
> Huh? What did you hack with the qe driver? Was that in 2.11BSD? I didn't
> know there was any problems with it in the first place.
>
> Or is there some problem in simh that you fixed?
>
>  I'll admit I'm not all that swift on the pdp-11, but I get the impression
>>
>> that the maximum exe size is 128kb with 64kb of instructions, and 64kb of
>> data?  Isn't there something that can be done with overlays or some other
>> linker thing to act like an 8086/80286 with the large memory model (ie
>> multiple segments...?)
>>
>
> Yes and no. In principle, the maximum size of a program is 64K instruction
> and 64K data. That's as much as is directly addressable. With overloays you
> can extend that somewhat, but there are limitations and restrictions.
>
>
>  I've been trying to build ircII-4.4 and I can't figure out how to link
>> something that big... I've tried the -Z and -O flags to ld to no avail.
>>
>> Clearly I'm doing either something wrong, or impossible or stupid.
>>
>> FWIW, here is the size of the same program on the VAX
>>
>> myname# ls -l irc-4.4
>> -rwxr-xr-x  1 root       413696 Jun  8 08:46 irc-4.4*
>> myname# size irc-4.4
>> text    data    bss     dec     hex
>> 293888  67584   20784   382256  5d530
>>
>> I have a feeling that 300kb of text, along with 67kb of data is just too
>> much...?
>>
>> Any pointers would be appreciated!
>>
>
> You'll need to trim some fat off.
>
> Points to remember:
> 64K data is the max. There is no way to use overlays to get more data
> space. Overlays can only extend the instruction space.
> Overlays and the main program share the same address space. That is, the
> size of the main code and the largest overlay segment together must not
> exceed 64K. So, overlays is just a way to move parts of the program in and
> out of your basic 64K address space.
> When you link a program, you'll be able to see the sizes of all segments as
> well as the main program.
>
> As an example, this is how tcsh looks like:
>
> Test:/# size /bin/tcsh
>
> text    data    bss     dec     hex
> 48960   14844   11986   75790   1280e   total text: 140864
>        overlays: 15424,16000,14144,14016,16256,16064
>
> Notice how text+max(sizeof overlays) is less than 64K.
>
> All that said, you can easily find IRC clients who are much smaller than
> that... :-)
>
>        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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20100811/96ac7b37/attachment.html>


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

end of thread, other threads:[~2010-09-03 11:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-10 22:23 [TUHS] 2.11 BSD question... (exe sizes) Jason Stevens
2010-08-11  3:49 ` John Cowan
2010-08-11  4:45   ` Jason Stevens
2010-08-11  7:27 ` Jochen Kunz
2010-09-03 11:22 ` Tom Ivar Helbekkmo
     [not found] <mailman.1.1281492002.20712.tuhs@minnie.tuhs.org>
     [not found] ` <4C627129.2050509@softjar.se>
2010-08-11 15:05   ` Jason Stevens

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