On 2016-12-29 03:00, Nick Downing <downing.nick(a)gmail.com> wrote:
I will let you know when I get
it working :) It's not a current focus, but I will return to it someday.
In the meantime, I'm putting it on bitbucket, so others will be able to
pick it up if they wish. However, this also isn't my current focus, it's
there, but it's not documented.
The IAR compiler on the Z180 supports a
memory model similar to the old "medium" memory model that we used to
use with Microsoft or Turbo C on DOS machines, that is, multiple code
segments with a single data segment. Yes, the Z180 compiled C code is
larger than the PDP-11 compiled C code, but luckily you can have
multiple code segments, which you cannot (easily) have on the PDP-11.
Unfortunately code and data segments share the same 64 kbyte logical
address space, so what I did was to partition the address space into 4
kbytes (always mapped, used for interrupt handlers, bank switching
routines, IAR compiler helper routines, etc), 56 kbytes (kernel or
current process data and stack) and 4 kbytes (currently executing
function). The currently executing function couldn't be more than 4
kbytes and couldn't cross a physical 4 kbyte boundary due to the
hardware mapping granularity, but this was acceptable in practice.
I got
the Unix V7 clone working OK under this model and then added the
networking, so although it was a bit of a dogs breakfast, it proves the
concept works. My memory management left a fair bit to be desired (too
much work to fix) however I think porting 2.11BSD would solve this
problem since it works in the PDP-11 under split I/D, which has similar
constraints except the 4 kbyte code constraint. My understanding is
2.11BSD is actually a cut down 4.3BSD running on the HAL from 2.xxBSD, I
would like to audit each change from 4.3BSD to make sure I agree with
it, so essentially my project would be porting 4.3BSD rather than
2.11BSD. But I'd take the networking stack and possibly a lot more code
from 2.11BSD, since it is simplified, for instance the networking stack
does not use SYN cookies. cheers, Nick
Having written quite some code on the Z180, as well as god knows how
much code on the PDP-11, I'm going to agree with Peter Jeremy in that I
do not believe 2.11BSD can be made to run on a Z180. (Well, of course,
anything is possible, you could just write a 68000-emulator, for
example, but natively... no.)
Unix V7 is miles from 2.11BSD. Unix V7 can run on very modest PDP-11
models. 2.11BSD cannot be made to run on a PDP-11 without split I/D
space, which effectively gives you 128K of address space to play with,
in addition to the overlaying done with the MMU remappings.
The MMU remappings might be possible to emulate enough with the segment
registers of the Z180 for the Unix needs, but the split I/D space just
won't happen.
2.9BSD was the last version (I believe) which ran on non split-I/D machines.
Johnny
On Wed, Dec 28, 2016 at 6:14 PM, Peter Jeremy <peter(a)rulingia.com> wrote:
> On 2016-Dec-25 17:21:31 -0500, Steve Nickolas <usotsuki(a)buric.co> wrote:
>> On Mon, 26 Dec 2016, Nick Downing wrote:
>>> I became frustrated with the limitations of both UZI and NOS and decided to
>>> port 2.11BSD to the cash register as the next step, my goal was (a) make it
>>> cross compile from Linux to PDP-11, (b) check it can build an identical
>>> release tape through cross compilation, (c) port it to Z80 using my
>>> existing cross compiler.
>> A Z180 is powerful enough to run 2.11BSD? o.o;
> I suspect shoe-horning 2.11BSD onto a Z180 would be difficult - 2.11BSD
> on a PDP-11 requires split I+D and has kernel and userland in separate
> address spaces. Even with that, keeping the non-overlay part of the
> kernel in 64KB is difficult. Equivalent Z180 code is going to be much
> larger than PDP-11 code.
>
> I'd be happy to be proved wrong.
>
> --
> Peter Jeremy
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol