News:

Want an XLerator? Please participate in the market research thread: https://lisalist2.com/index.php/topic,594.msg4180.html

Main Menu

Fun with UniPlus+

Started by jamesdenton, September 13, 2026, 02:12:45 AM

Previous topic - Next topic

jamesdenton

We've been busy today.



More to share soon.

AlexTheCat123

Oh wow! I'm excited for the update!

jamesdenton

#2
Story time  :D

A while back I spent a lot of time with Uniplus UNIX while working on some documentation for the Tecmar QuadPort Serial card (clone). Around that time, I came across some documentation about a 3com EtherBox that had been adapted to the Lisa to be used with Uniplus UNIX and my interest was piqued - https://lisalist2.com/index.php?topic=38.0. There's not much info out there, but the idea of Ethernet on the Lisa (via UNIX) was intriguing.

The version of Uniplus for Lisa via install diskettes is v1.4 (sunix on the boot disk is v1.1) and doesn't include any sources, really, as it seems limited to what could reasonably fit on a 10MB ProFile. The Uniplus v1.5 kernel sources turned up on Bitsavers some time back but were incomplete. The source includes some tcp/ip releated stuff, but most of the headers were missing. Without the headers, it was not possible to make a new unix kernel – with or without IP. I seem to recall there being an imaged Profile with Uniplus installed on it (Virginia Tech?), but not sure where that ended up.

I got a wild hair over the weekend and have ended up in a neat place that I think could inspire some new things. More details below.

--

As noted in 2019, the V.1.5+ kernel source looked mostly complete, but the network headers (net/*.h) and a few system headers were missing. The missing headers turned up on the Torch Triple X UniPlus+ disks on Bitsavers, which have the same 4.1a BSD-derived stack AND runs a 68000. (Thanks, Claude!) A handful of Lisa-specific headers (ie. sys/config.h, sys/al_ioctl.h, sys/speaker.h, etc.) had to be reconstructed from the binaries and the manuals. (Claude, again). With those headers, both unix.nonet (stock) and unix.net (with network supported) compiled and linked within LisaEm * CLEANLY THE FIRST TIME *.

A few gotchas along the way:

- It seems the Lisa compiler only keeps 8 characters, so sockaddr_in collides with sockaddr unless you rename it, which UniSoft's headers already do. I think this was also seen recently in Workshop. This bit a few times.

- A 10MB Profile was not big enough. I expanded the 10MB disk to 20 MB and patched the kernel to have a 10MB partition on the end (as /dev/p0e). I updated pro.c on subsequent kernel builds to support this, but there might be a better, more dynamic way to do this. I'd imagine Unisoft used Priam Datatowers for their work and likely a cross-compiler, maybe off a PDP? Not sure.

- Lisa clock: if it goes backwards between builds, make quietly skips relinking and you end up installing the old kernel. I should've done a make clean or something – maybe I'll update the makefile for this. It would be cool to get a sync with the host clock working.

- Booting -

The freshly built kernels panicked at the first disk access (ASSERTION BSY, then panic: iinit), even though the stock 1.4 kernel booted fine. It turns out LisaEm doesn't emulate the ProFile handshake closely enough; most of this code was written long before the LOS sources were released and likely before many of the data sheets and other literature were found. I know some efforts had been made to go back and address things, but there are and were many hacks in LisaEm to compensate for differences between OSes. LisaEm was patching the 1.4 kernel in memory, at fixed addresses, to hide it (this is HLE stuff in LisaEm). Any kernel built from source has different addresses, so it got none of those patches. I think Alex also saw this with his artisanal LOS build a while back.

I had two choices – add a new entry for this v1.5 or try to fix the ProFile code in LisaEm to be more "accurate". With Claude's help we ended up with:

- a real /BSY and /CMD handshake with busy timing;
- CA1 latched on edges the way the chip does it;
- strobes only in handshake or pulse mode.

With that, the UniPlus-specific hacks could come out. I pulled some of the other LOS hacks, too, along with Xenix, and I need to really test those before saying its GOOD.

- Etherbox -

The only Ethernet driver in the kernel is if_eb.c -- this is the 3com Etherbox driver. It's driven through one VIA: a command code on port B, register numbers and data bytes on port A, one byte per strobe. The Etherbox itself is described in this PDF on page 114 as supporting the Apple II, Apple ///, and Lisa, all off a parallel port and conforms to the "Ethernet 1.0" standard!

LisaEm now emulates the EtherBox as a new device you can put on a dual parallel card port. UniPlus expects it on the upper port of the card in slot 2, but this is configurable in the kernel. The model is built from what the driver does, since I haven't found documentation for the box itself. So, "emulation" is doing a lot of heavy lifting here.

For the host side there are three backends you can use:

- a null one that just drops frames;
- a test responder that answers ARP and ping and refuses TCP connections;
- libslirp, the user-mode NAT that QEMU uses. <--- final state

With slirp, the Lisa sits at 10.0.2.15, the Mac is 10.0.2.2, and it needs no root and no host network setup. Port forwarding lets you connect from the Mac into the Lisa. There's also a register trace and a pcap dump for Wireshark, which made debugging easier.

The kernel hardcodes 89.0.41.8 as the client IP in conf.c. I thought maybe there was some significance to the 89.x.x.x  network (Class A in 1982), and it turns out that it was only allocated as recently as 2005 or so – before that it was just 'RESERVED'. This was clearly before RFC1918 and other "private" networks, let alone classless addressing.

Tested so far:

- tcpconn from the Lisa to a listener on the Mac;
- a TCP echo server on the Lisa reached from the Mac through a port forward
- udp to localhost
- icmp to localhost

Some things I'm still working on:

- Finish ping. finished
- Implement telnet client/server
- Write a route tool, so the Lisa gets a default route and can reach past the host (mac) finished
- Try the Torch telnet and ftp binaries, or port the 2.9BSD ones.
- A proper Preferences UI for the EtherBox. There's really nothing else to do here

Working through these now and I hope to publish the changes to Uniplus and LisaEm, along with some screenshots/videos in action.

jamesdenton

#3


stepleton

Congratulations! Very interesting to find schematics in the Bitsavers doc (now moved to here); conceivably you could try to clone it in the same way other Lisa PCBs have been cloned. Or, perhaps easier: use a microcontroller with a bunch of GPIO pins to speak the same language.

jamesdenton

Thanks! I could see it going two ways, at least. The easiest might be to implement the SLIP path in an ESP8266/ESP32 (there's already SLIP firmware for both) that would at least provide egress via WiFi. This would more or less mimic what's being done now with macOS, I think. A more faithful recreation of the EtherBox could be doable, too - probably with the same micro or AVR and a more modern 10bT versus, what, coax? Either way, I think there will be a hardware version coming at some point!

When I get the image finished I'll throw it up - should work with cameo or ESProFile.

sigma7

Quote from: jamesdenton on September 13, 2026, 02:49:05 PMhave ended up in a neat place that I think could inspire some new things

Yes, very impressive and interesting!
Warning: Memory errors found. ECC non-functional. Verify comments if accuracy is important to you.

bmwcyclist

Using my LISA for writing blogs and other work projects, and for fun and games at home.
Visit my shares on GlobalTalk! LISAGamingZone
Check out the NEW Lisa Software! https://github.com/GyroPilot
telnet theapplelisabbs.duckdns.org 1983