PDP11/70 memory size and Unix7

58 views
Skip to first unread message

Michael Katzmann

unread,
May 8, 2026, 10:24:51 AM (6 days ago) May 8
to [PiDP-11]
I've been attempting to increase the memory defined in simh for the pdp11 to 4MB in the boot.ini file but have run into an problem.

When I define a memory of greater than 2MB, Unix7 cannot calculate the correct memory size and crashes.

As I understand it the 11/70 can have 4MB of memory and Unix 7 examines the memory to determine the amount available. What am I missing here?

set cpu 11/70 2048K

: hp(0,0)unix
mem = 2018560
#

set cpu 11/70 3M

: hp(0,0)unix
mem = -1127168
ka6 = 2274
aps = 141630
pc = 67502 ps = 30010
trap type 11
panic: trap


set cpu 11/70 4M

: hp(0,0)unix
mem = -86784
ka6 = 2274
aps = 141630
pc = 67502 ps = 30010
trap type 11
panic: trap


~          

Johnny Billquist

unread,
May 8, 2026, 10:26:53 AM (6 days ago) May 8
to pid...@googlegroups.com
Probably that Unix V7 have a sign issue when figuring out memory...
(Just guessing, but it seems very suspect that the problem happens when
above 2M, which is when the PAR registers start having the high bit set
in the 16-bit word...)

Johnny
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> pidp-11/3580a9fb-1888-4dd0-b6a7-d94c76a5181fn%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/3580a9fb-1888-4dd0-b6a7-
> d94c76a5181fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Clem Cole

unread,
May 8, 2026, 10:53:40 AM (6 days ago) May 8
to Michael Katzmann, [PiDP-11]
Yep, that's a known bug with the original Research Distribution tape.  The crash occurs because the kernel's memory management initialization and certain device drivers assumed an 18-bit limit. To fix this, you must modify the kernel configuration and the memory probing routine in machdep.c.   If you grab the V7M tapes, which is the DEC additions and corrections to stock V7, it will work immediately [https://bitsavers.org/bits/DEC/pdp11/v7m/v7m_2.1_dist.tap].  V7M is pre-configured and includes the DEC additions and corrections to stock V7, designed for both the original Unibus/Massbus PDP-11 models and 22-bit Q-bus machines. One very nice addition is the support for overlays [this was later picked up in 2.8BSD and follow-on versions].

If you want to try it yourself (which is a wonderful way to start to learn about the UNIX kernel, and how many of us started back in the day), the important manual steps for the fix are:
  • Modify machdep.c: You must update the memall and memfree routines to handle the 22-bit Page Address Registers (PARs) correctly for memory above the 2MB (18-bit) boundary.
  • Unibus Map Support: On an 11/70, Unibus devices (such as the RK05) can access only the first 256KB of memory unless the Unibus Map is properly initialized and managed by the kernel. Original V7 lacked full Unibus Map management, causing crashes when drivers attempt to perform DMA to memory addresses above 248KB.
  • Massbus Driver Patches: If using Massbus drives (RP04/05/06), the driver must be updated to use 22-bit addressing rather than 18-bit addressing.
Peter Collinson (another old UNIX jockey like me) has a github with his changes to stock V7 and some extra's that fix other issues and make it easier to type to with a glass CRT, and a copuple of othjer tools as well as a couple simh *.ini files that he uses to create everything: https://github.com/pcollinson/unixv7-extras

--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/3580a9fb-1888-4dd0-b6a7-d94c76a5181fn%40googlegroups.com.

Anton Lavrentiev

unread,
May 8, 2026, 10:54:41 AM (6 days ago) May 8
to Johnny Billquist, pid...@googlegroups.com
It indeed looks like the sign overflow issue, even in the output for "mem =".
Perhaps, V7 wasn't suited to run with full 4M memory on PDP11
> To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-11/a0559046-dcb9-48d9-86ef-d9281145c3f3%40softjar.se.

Johnny Billquist

unread,
May 8, 2026, 10:55:42 AM (6 days ago) May 8
to pid...@googlegroups.com
Um? 18-bit limitations do not cause the system to crash when memory goes
above 2MB...

Johnny

On 5/8/26 16:52, Clem Cole wrote:
> Yep, that's a known bug with the original Research Distribution tape.
> The crash occurs because the kernel's memory management initialization
> and certain device drivers assumed an 18-bit limit. To fix this, you
> must modify the kernel configuration and the memory probing routine in
> machdep.c.   If you grab the V7M tapes, which is the DEC additions and
> corrections to stock V7, it will work immediately [https://
> bitsavers.org/bits/DEC/pdp11/v7m/v7m_2.1_dist.tap <https://
> bitsavers.org/bits/DEC/pdp11/v7m/v7m_2.1_dist.tap>].  V7M is pre-
> configured and includes the DEC additions and corrections to stockV7,
> designed for both the original Unibus/Massbus PDP-11 models and 22-bit
> Q-bus machines. One very nice addition is the support for overlays [this
> was later picked up in 2.8BSD and follow-on versions].
>
> If you want to try it yourself (which is a wonderful way to start to
> learn about the UNIX kernel, and how many of us started back in the
> day), the important manual steps for the fix are:
>
> * Modify machdep.c: You must update the memall and memfree routines to
> handle the 22-bit Page Address Registers (PARs) correctly for memory
> above the 2MB (18-bit) boundary.
> * Unibus Map Support: On an 11/70, Unibus devices (such as the RK05)
> can access only the first 256KB of memory unless the Unibus Map is
> properly initialized and managed by the kernel. Original V7 lacked
> full Unibus Map management, causing crashes when drivers attempt to
> perform DMA to memory addresses above 248KB.
> * Massbus Driver Patches: If using Massbus drives (RP04/05/06), the
> driver must be updated to use 22-bit addressing rather than 18-bit
> addressing.
>
> Peter Collinson (another old UNIX jockey like me) has a github with his
> changes to stock V7 and some extra's that fix other issues and make it
> easier to type to with a glass CRT, and a copuple of othjer toolsas well
> as a couplesimh *.ini files that he uses to create everything: https://
> github.com/pcollinson/unixv7-extras <https://github.com/pcollinson/
> unixv7-extras>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-11/
> CAC20D2MchZUVBP04ta0kXTTQVLvXj-Z%2B4abxG6fFU%2Bdp13n3aQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/pidp-11/
> CAC20D2MchZUVBP04ta0kXTTQVLvXj-
> Z%2B4abxG6fFU%2Bdp13n3aQ%40mail.gmail.com?
> utm_medium=email&utm_source=footer>.

Johnny Billquist

unread,
May 8, 2026, 10:56:58 AM (6 days ago) May 8
to pid...@googlegroups.com
And just to be extra clear. The 18-bit limit means a maximum memory of 256K.

Johnny
>>     I've been attempting to increase the memory definedin simh for the
>>     pdp11 to 4MB in the boot.ini file but have run intoan problem.
>>
>>     When I define a memory of greater than 2MB, Unix7 cannot calculate
>>     the correct memory size and crashes.
>>
>>     As I understand it the 11/70 can have 4MB of memoryand Unix 7

Johnny Billquist

unread,
May 8, 2026, 10:59:19 AM (6 days ago) May 8
to Anton Lavrentiev, pid...@googlegroups.com
One have to remember that when the 11/70 came out, you couldn't
physically hook up more than 2M to it, which is why some of the early
documentation only says 2M (yes, you also sometimes have the confusion
between bytes and words that muddy this water).

But it was just the simple fact that the MJ11 core memory boxes each
holds a maximum of 256K of memory, and you could have a maximum of 8 of
those boxes. Thus 2MB. So more memory than that wasn't something tested
much immediately after the machine came on the market.

Johnny
>> To unsubscribe from this group and stop receiving emails from it, sendan email to pidp-11+u...@googlegroups.com.

Michael Katzmann

unread,
May 8, 2026, 5:08:51 PM (6 days ago) May 8
to Clem Cole, [PiDP-11]
I tried to install the V7m tape according to these instructions, and things went well up to the installation of the /usr file system.

In any case, with just a root and sys file system I could boot but, once again, only if the 11/70 has no more than 2MB. 
--
   |\      _,,,---,,_             Michael Katzmann
   /,`.-'`'    -.  ;-;;,_         NV3Z / VK2BEA / G4NYV
  |,4-  ) )-,_. ,\ (  `'-'
 '---''(_/--'  `-'\_)

Clem Cole

unread,
May 8, 2026, 8:03:10 PM (6 days ago) May 8
to Michael Katzmann, [PiDP-11]
I just reread my message of this AM,  a typo/bad wording below.

On Fri, May 8, 2026 at 10:52 AM Clem Cole <cl...@ccc.com> wrote:
Yep, that's a known bug with the original Research Distribution tape.  The crash occurs because the kernel's memory management initialization and certain device drivers assumed an 18-bit limit. To fix this, you must modify the kernel configuration and the memory probing routine in machdep.c.   If you grab the V7M tapes, which is the DEC additions and corrections to stock V7, it will work immediately [https://bitsavers.org/bits/DEC/pdp11/v7m/v7m_2.1_dist.tap].  V7M is pre-configured and includes the DEC additions and corrections to stock V7, designed for both the original Unibus/Massbus PDP-11 models and 22-bit Q-bus machines. One very nice addition is the support for overlays [this was later picked up in 2.8BSD and follow-on versions].

If you want to try it yourself (which is a wonderful way to start to learn about the UNIX kernel, and how many of us started back in the day), the important manual steps for the fix are:
  • Modify machdep.c: You must update the memall and memfree routines to handle the 22-bit Page Address Registers (PARs) correctly for memory above the original Unibus (18-bit) boundary [as I recall Ken only tested against a 21 bits as that's all they had at the time].  
  • Unibus Map Support: On an 11/70, Unibus devices (such as the RK05) can access only the first 256KB of memory unless the Unibus Map is properly initialized and managed by the kernel. Original V7 lacked full Unibus Map management, causing crashes when drivers attempt to perform DMA to memory addresses above 248KB.
  • Massbus Driver Patches: If using Massbus drives (RP04/05/06), the driver must be updated to use 22-bit addressing rather than 18-bit addressing.
    Peter Collinson (another old UNIX jockey like me) has a github with his changes to stock V7 and some extra's that fix other issues and make it easier to type to with a glass CRT, and a couple of other tools as well as a couple simh *.ini files that he uses to create everything: https://github.com/pcollinson/unixv7-extras

    Clem Cole

    unread,
    May 8, 2026, 8:59:59 PM (6 days ago) May 8
    to Michael Katzmann, [PiDP-11]
    Make sure in the file h/systm.h "maxmem" is an unsigned integer, not an int.  IIRC, maxmem is in "clicks" (64 bytes), but it gets converted in a couple of places into bytes by shifting it 6 places to the right, and you need to make sure that after the conversion, it does not become negative.  I thought Fred had fixed all of those in v7m, it's been a while since I looked.  Obviously, it works fine on 2.11BSD; I had it right in my old V7 system at Teklabs, but those bits are not online anywhere. FWIW: The line in machdep that you are seeing is: printf("\nmem = %D\n", ctob((long)maxmem)); 
    As Anton noted, you are clearly getting bitten by the sign, since that should be positive; so start there.  There may be a couple of other places.  Print out param.h and systm.h as well as machdep.c looking for naked declarations like: register i or just plain int x  and ensure that you are getting overflowed.  The good news here is that the Dennis compiler for V7 knows about unsigned, which was not true for V6 (you had to declare things as a pointer to ensure unsigned usage).
    Reply all
    Reply to author
    Forward
    0 new messages