gzip for Xenix

sorry I didn’t realize that IIS was blocking the gzip download because of it haveing no extension…

I really need to redo that whole install.

Meanwhile you can download it here:

gzip-i386-xenix

Also I found on some old “Soviet Union” website (no really it’s a .su!) a binary version of GCC for Xenix… I’ll post more later as I get a chance to go through the thing….

For the adventurous it’s here:

ftp://ftp.kiae.su/pub/unix/os/xenix/gnu/  (now offline)

It’s kind of interesting to find such a thing, and if you see the dates, it’s from January 28th 1991… In the last days of the Soviet Union… Well lucky for us, someone in Russia is a packrat! I guess they were starting to switch out from homemade PDP-11’s into 386’s and they didn’t bother porting their ‘pirated’ versions of Unix v6…

Fun with INTERACTIVE UNIX 3.0

(This is a guest post from Antoni Sawicki aka Tenox)

ix30
I’ve been hunting for a complete set of INTERACTIVE UNIX System for quite some time. While I had the “basic set” of it, the real stuff Visix Looking Glass graphical environment was nowhere to be found. Recently I got my hands on a box containing a massive set of 5.25″ floppy disks. Without further delay this is how the famous 386 UNIX GUI looks like:
The os has a long and convoluted history. It started as PC/IX for the IBM XT created by Interactive Systems Corporation. Later updated to 386/ix and renamed as INTERACTIVE UNIX System V/386. The company was acquired by Kodak and the OS was later sold to Sun Microsystems.
SunSoft INTERACTIVE UNIX 4.1
Sun has reportedly used the OS to help port SunOS/Solaris to x86 platform. However they also sold and supported it as a stand alone product. The system was widely used as part of Reuters Terminal and other embedded applications. It briefly survived Oracle acquisition making the os Oracle INTERACTIVE UNIX?

This article specifically covers version 3.0 released by ISC around 1991. The installation is pretty straightforward except for swapping 50 disk images and later configuration of NIC, TCP/IP and VGA/X11. The floppy images are available here. I have spent quite a lot of time to get TCP/IP working and VGA at half decent resolution.

Fortunately thanks to 86Box you can enjoy a fully working OS in a “high-res” (1024×768) mode, 256 colors and working TCP/IP. You can even pretend to browse the web using early version of Mosaic and WRP:

Looking Glass comes with a file manager and funky icons for pretty much every utility in the system:

The OS has a bunch of GNU apps and I even found a super early version of xv:

Finally this is how you manage the system with a “sysadm” utility and “kconfig” kernel configurator:

On a text console side, the OS has virtual consoles switchable via SYSRQ + F key. Console is on F8.

One should probably appreciate that PC had such a cool Unix version before Linux was even born. Unfortunately this stuff was all prohibitively expensive and mortals could not afford it to run on their 386s.

You can download 86Box version here. Make sure to look at readme for some last minute updates. Especially around configuring TCP/IP and Looking Glass licensing. There also is a VirtualBox OVA, however it only works in 800×600 and no networking/tcpip. Additional software can be downloaded from funet ftp. Install disks are here.

Also you may be interested in a follow up article covering VP/ix DOS hypervisor included with the OS.

Have Fun With Virtualization!

The 2038 ‘problem’.

Eventually you will start to hear about the 2038 problem regarding UNIX, and the C language. Looking at the 4.3 BSD source, the problem is pretty simple.

The time_t value holds the number of ‘ticks’ since new years, 1970. It’s a signed long, that can hold a maximum value of 2147483648. This will set you into the year 2038. There is some great detail on the site 2038bug.com . Naturally the easiest option here, is to simply change it from a signed long to an unsigned long. This will let us use a maximum value of 4294967296, which translates to the date Sun Feb 6 06:28:15 2106.

While this is not a “perfect” solution for some people, this works great on platforms that are not built with compilers that can understand 64bit “long longs”. Not to mention that constantly updating a pseudo long long could have negative implications in the kernel….

The bottom line is that eventually we need to move away from 32bit platforms, and with some programs that try to look 30+ years into the future, the time is NOW. But just because you are on a 64bit UNIX doesn’t mean the date isn’t being kept in a 32bit signed value for ‘compatibility’…

To test the idea, I’ve taken the 4.3 UWisc BSD from my project here, and gone about making some changes.

Starting with the file /usr/sys/h/types.h

myname# diff -r types.h x
47c47
< typedef long time_t;

> typedef unsigned long time_t;

Very simple, right? The kernel has it’s own version of this file, /usr/sys/h/types.h , and will require the same fix.

myname# diff -r types.h x
47c47
< typedef long time_t;

> typedef unsigned long time_t;

Now with that out of the way, the next thing to do is patch some of the functions in libc.

/usr/src/lib/libc/gen/time.c

myname# diff time.c /time.c
25c25
< long

> unsigned long

/usr/src/lib/libc/gen/ctime.c

myname# diff ctime.c /ctime.c
248c248
< long hms, day;

> unsigned long hms, day;

Ok, that’s the bulk of the changes. Really.

Rebuild the kernel & libc, and install them.

cd /usr/sys/GENERIC
make clean
make
cp vmunix /

cd /usr/src/lib/libc
make
cp libc.a /lib
cp libc_p.a /usr/lib
ranlib /lib/libc.a
ranlib /usr/lib/libc_p.a

Now with that out of the way, reboot the VM.

So far everything should behave normally. But it’s time for some fun!

First, let’s make sure we can use dates beyond the 2038 bug date. This program comes from the aforementioned 2038bug.com site. I’ve just added one header needed by 4.3 BSD to get the time_t structure called in correctly.

#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <sys/types.h>

int main (int argc, char **argv)
{
time_t t;
t = (time_t) 1000000000;
printf (“%d, %s”, (int) t, asctime (gmtime (&t)));
t = (time_t) (0x7FFFFFFF);
printf (“%d, %s”, (int) t, asctime (gmtime (&t)));
t++;
printf (“%u, %s”, (unsigned int) t, asctime (gmtime (&t)));
return 0;
}

Now when I run it I get this:

myname# gcc 2038.c;./2038
1000000000, Sun Sep 9 01:46:40 2001
2147483647, Tue Jan 19 03:14:07 2038
2147483648, Tue Jan 19 03:14:08 2038

Notice that it works!

Unfortunately the date command in BSD (well just any 32v derived UNIX) is set to handle two digit years. So what I’ve done is to ‘fix’ date to handle four digit years. So here is the diff:

myname# diff date.c date4year.c
94c94
< long time();

> unsigned long time();
160c160
< tv.tv_sec += (long)tz.tz_minuteswest*60;

> tv.tv_sec += (unsigned long)tz.tz_minuteswest*60;
167c167
<

> /*printf(“setting time….”);*/
228c228,229
< year = gp(L->tm_year);

> year = gp2(L->tm_year);
> /*printf(“gtime year %d\n”,year);*/
243c244,246
< year += 1900;

> /*year += 1900;
> no more 2 year dates!
> */
270a274,292
> gp2(dfault)
> {
> int c, d,e,f;
>
> if (*sp == 0)
> return (dfault);
> c = (*sp++) – ‘0’;
> d = (*sp ? (*sp++) – ‘0’ : 0);
> e = (*sp ? (*sp++) – ‘0’ : 0);
> f = (*sp ? (*sp++) – ‘0’ : 0);
> /*printf(“c %d d %d e %d f %d\n”,c,d,e,f);*/
>
> if (c < 0 || c > 9 || d < 0 || d > 9)
> return (-1);
> if (e < 0 || e > 9 || f < 0 || f > 9)
> return (-1);
> return ((f*1000)+(e*100)+(d*10)+c);
> }
>
293c315
< long waittime;

> unsigned long waittime;

Now I can set the time like this:

myname# ./date 201001021208
Sat Jan 2 12:08:00 PST 2010
myname# ./date
Sat Jan 2 12:08:01 PST 2010

And all is well.

So let’s take it to 2040!

myname# ./date 204001011433
Sun Jan 1 14:33:00 PST 2040
myname# ./date
Sun Jan 1 14:33:02 PST 2040

And there we have it!

The old date command would return Thu Nov 26 08:04:46 PST 1903, which is slightly wrong!

Naturally EVERY program that calls time/date stuff will have to be checked to be fully 2038 vetted, but you get the idea. The major offender in the date command is the idea of adding 1900 to the date, which is not needed when you specify the full year.

While this 2038 solution is simple, it still requires people to start to take action. It seems the industry is not moving yet, but it’ll certainly require source code access to make it quick & easy… But I’m sure like the Y2k issue, people will wait until 2036, and by then there’ll be good money in programs that can decompile various UNIX binaries, and change that signed long value… The ‘issue’ is the other fallout like the slight change I had to make to the 2038 test program….

Always remember to keep your source SAFE!

Oh, and happy new years!

some flashterm updates

well I’m no great php coder.. lol but I’ve managed to slap together an extension for wikimedia that launches the terminal!

superglobalmegacorp.com

I’ve been mirroring a bunch of the pages I wrote over on gunkies, and included a bunch of quick connect profiles etc…

Right now I’ve got the following there…

Access research Unix v1
Access 4.2 BSD
Access 4.3 BSD
Access 4.3 BSD Uwisc
Access 4.3 BSD Quasijarus

Ancient UNIX on the front page of slashdot

So today on slashdot I saw this:

“In this its 40th year of operating system life, some Unix stalwarts are trying to resurrect its past. That is, they are taking on the unenviable and difficult job of restoring to their former glory old Unix software artifacts such as early Unix kernels, compilers and other important historical source code pieces. In a paper to be presented at next week’s Usenix show, Warren Toomey of the Bond School of IT is expected to detail restoration work being done on four key Unix software artifacts all from the early 1970s — Nsys, 1st edition Unix kernel, 1st and 2nd edition binaries and early C compilers. In his paper, Toomey states that while the history of Unix has been well-documented, there was a time when the actual artifacts of early Unix development were in danger of being lost forever.”

It’s always cool when this stuff gets some attention. I just wish someone who would write this stuff, would show people HOW to run it… It’s not that hard is it???

SYSIII comes alive on SIMH’s VAX 11/780

Ok, good news, I got it to boot! The bad news is that it’s kind of complicated… First you need a working UNIX/32V machine. And what’s worse is that UNIX SYSIII is not ‘free/shareware’ or anything like that. You need a license to run it.

It cost $100 to get one.

But they don’t sell it anymore.

So this is for the few people with a SYSIII license.

Anyways, to get the jump on SYSIII you need to add a second disk to a working UNIX/32V install. So after a while I managed to work out getting a second HP disk online on 32v, formatting it, and restoring a bare SYSIII install… (Nao’s 32v tape image has support for more then one HP disk, it was just a matter of figuring out the
major/minor for the 2nd disk (0/8,0/14)).

From the extracted cpio’s I took the following files (after looking at
the source of cmd/init.c):

/etc/init
/etc/inittab
/bin/sh
/bin/ls
/bin/env

Then I just created the following device files:

crw-rw-rw- 1 console console 0, 0 Jun 23 09:24 console
crw-rw-rw- 1 console console 3, 0 Jun 26 1979 null
brw-rw-rw- 1 console console 0, 0 Jun 26 1979 rp0a
brw-rw-rw- 1 console console 0, 7 Jun 26 1979 rp0h
brw-rw-rw- 1 console console 0, 8 Jun 26 1979 rp1a
brw-rw-rw- 1 console console 0, 14 Jun 26 1979 rp1h

And fired it up!

——–

VAX780 simulator V3.8-1

$$ unixhpht

UNIX/3.0.1: unixhpht
real mem = 8323072
avail mem = 8207872

# ls
bin
dev
etc
unixhpht
# cd bin
# ls
env
ls
sh
# cd /
# ls
bin
dev
etc
unixhpht
# cd dev
# ls -l
/etc/passwd file cannot be opened for reading#
#
# ls>/etc/passwd
# ls -l
/etc/group file cannot be opened for reading#
#
# ls>/etc/group
# ls -l
total 0
crw-rw-rw- 1 console console 0, 0 Jun 23 09:24 console
crw-rw-rw- 1 console console 3, 0 Jun 26 1979 null
brw-rw-rw- 1 console console 0, 0 Jun 26 1979 rp0a
brw-rw-rw- 1 console console 0, 7 Jun 26 1979 rp0h
brw-rw-rw- 1 console console 0, 8 Jun 26 1979 rp1a
brw-rw-rw- 1 console console 0, 14 Jun 26 1979 rp1h
#
——–

So now the remaining thing to do is to add another HP disk, format it
under SYSIII, and restore onto it… I wish I could share more of my
work, but I figure this will help someone down the road who wants to
venture down the SYSIII on the 11/780.

Added UNIX/32v to the sourceforge project

You can download UNIX/32v here: https://sourceforge.net/project/downloading.php?group_id=204974&filename=unix32v-0.3.exe&a=43027585

As a simple windows installer. Just install and run and you’ll be at the login: prompt in no time!

32v is the common ancestor to both 4BSD and SYSV. While primitave by modern standards, this is the version where all 32bit unix’s can be traced back to. This is also the release that was central in the AT&T vs CSRG lawsuit. It is basically a port of the PDP-11’s v7 unix onto the VAX 11/780. I left the default kernel which is restricted to 1MB of ram, and 2 disks.. Only one disk is currently being used.

This version is FREE thanks to the old Caldera license.

Sadly, the DZ11 seems to not be working correctly so this is limited to a single user.. I have made slight modifications to the bootloader & init to print the Caldera message, and to boot 32v into multi user mode.

For what it’s worth, this is a list of the games of 32v:
arithmetic
backgammon
bcd
ching
fish
fortune
hangman
number
quiz
random
trek
wump

This copy of 32v is made possible from the instructions found here:
http://zazie.tom-yam.or.jp/starunix/32v/32v.html (Thanks to Nao!!)

Packages so far on Uwisc 4.3BSD

I’ve been compiling quite a bit of stuff.. Looking back it was something I intended to do back in October of 2007… Well no time like the present then! I’ve done my best to include all the relevant bits for each of the following packages. It’s entirely possible I’ve missed stuff, so feel free to re-build the stuff as you wish. Some of the packages require you to build them with GCC as the default CC won’t work. However if you are going to build it yourself you won’t be able to jump to gcc 2.7.2.2 as it requires gperf which in turn requires a working c++ compiler. So far here are the following packages:

bash-1.14.7
bash-2.0
binutils-2.8.1
bison-1.25
flex-2.5.4
gcc-1.42
gcc-2.4.5
gcc-2.5.8
gcc-2.7.2.2
gdb.3.1
gzip-1.2.4
hack.1.0.3
irc2.8.21
ircii-4.4
lynx-2.8.2
make-3.75
pine-3.87
screen-3.7.1
unzip522

All of these can be downloaded from here. I’m keeping all the source code (unaltered) in tap format for the SIMH emulator right here.

To get the C compilers going I had to build gcc 1.42 with the system compiler (cc/PCC) then use that version of GCC to build the next version. Once I had gcc 2.5.8 building, then I was able to build binutils 2.8.1 without issues, then rebuild gcc 2.5.8 to use binutils instead of the default system assembler so that I could build lynx and it wouldn’t barf because of the massive switch statement…

And no, -J didn’t help.

Speaking of lynx the search ability is broken because the function simply isn’t in 4.3 BSD (bsearch), and for pine, I had to make a fake tmpfile function that uses the /tmp/pinebox directory.

The gcc 2.5.8 package includes the C++ components, and I’m pretty sure I did with 2.7.2.2 as well. I’m not sure if GCC 3.x kept the VAX cpu so I haven’t pushed forward, but seeing that the cc1 exe is over 1mb it doesn’t seem worth it to push ahead.

I’ll have to see about including more games. The selection in this 4.3 release is kind of weak,

aardvark* boggle* hack@ monop* snake*adventure* ching* hangman* quiz* snscore*backgammon* cribbage* hunt* robots* teachgammon*battlestar* doctor* lib/ rogue* trek*bogdict* fortune* mille* sail* zork*

I’ll have to see what’s missing from where.. Also I notice that the arrow key bindings in terraterm are not working… I’ll have to dive into that as well. It may end up with a new re-relase of the emulator or a patch thing. I’ll have to see.

I should add a quick note on how to unpack these tap files. First you will need bzip2 on your native pc. You should be able to get one here.

Now just uncompress the file..

C:\Program Files (x86)\uwiscbsd>bzip2 -d lynx-2.8.2.binary.BSD-4.3.Uwisc.tap.bz2

Now you need to go to the SIMH console window. It will say something like this in it:

VAX780 simulator V3.8-1
Listening on port 42221 (socket 376)
Waiting for console Telnet connection
Running

Hit Control+E and it’ll interrupt the simulator. Then we need to attach the tap file like so:

Simulation stopped, PC: 800018A3 (MTPR #0,#12)
sim> att ts0 lynx-2.8.2.binary.BSD-4.3.Uwisc.tap
sim> c

the att command will attach the tap file to the ts0 device. the c will tell the simulator to continue. Now just switch to a tty windows (or attach a pty), then it’s a simple matter of running the following commands:

myname# cd /
myname# mt rew
myname# tar -xvmf /dev/rmt12
x /usr/local/bin/gzip, 66560 bytes, 130 tape blocks
x /usr/local/bin/lynx, 949248 bytes, 1854 tape blocks
x /usr/local/lib/lynx.cfg, 97203 bytes, 190 tape blocks
myname# rehash

Thats about all it takes, now you can run lynx. If you so wish, you can run back to the SIMH console, and tell it to “det ts0” which will detach the tape image.

Announcing Research Unix v1 for Windows

 

Today I have decided that I should make a windows installer for the Unix v1 restoration project’s efforts on getting Unix v1 running.

For windows users this is a simple click & install project. This version of Unix v1 will support up to 8 simultaneous users on the system. Please note that this is a ‘rework’ of the v1 kernel from printouts to run a v2 userland, and the earliest C compiler from somewhere around v3-v4. It is not ‘pure’ per say as almost all v1 Unix documentation, tapes have been lost.

Simply install with all options, then click on the “RUN unixv1” link, and the kernel will load up (quickly!) to a login prompt. Login as root, and you should be good to go. Additional users can telnet into the host PC on port 12323 and they will be prompted to login. You can also use the “attach a pty” link, and it will launch teraterm pro onto the port 12323.

Because of the age of this system lots of commands that you take for granted did not exist back in 1972. A quick survey of my own use led to this:

Sync –doesn’t exist-
Reboot –doesn’t exist-
Vi –doesn’t exist-
Clear –doesn’t exist-
Cd –it’s actually chdir
Finger –doesn’t exist-
UUCP –doesn’t exist-
TCP/IP –doesn’t exist-

Remember it’s on a system with 32kb of ram. Don’t confuse Unix’s humble beginnings with the later v7 on the VAX, or the BSD releases that added TCP/IP networking.

I have included the PDF for the 2nd edition programmers guide. Since the userland is from this generation it is as close as you will get to a system manpage.

To exit the emulator, you can just close the SIMH process window, or hit Control+E then q to quit. I’m not sure of a ‘clean’ way to reset a Unix v1 machine. If there is significant disk corruption, I’d just recommend un-installing this program, then re-installing. It is no doubt the saving grace about running this emulated. As far as I know nobody has run this on a physical PDP-11. You would require an actual 11/20 because of how the multiply / divide instruction is handled. I won’t run on any of the bigger PDP-11’s.

The project page is:

http://sourceforge.net/projects/bsd42/

You can download this release from here:
https://sourceforge.net/project/downloading.php?group_id=204974&filename=Research-unixv1-0.3.exe&a=32102074

Updates on my sourceforge BSD/SIMH packages

On my project page I have made some new packages for 4.3BSD & 4.2BSD. Both of which can be downloaded here.

The updates include:
-moving to 3.8-1 of SIMH
-turning off unnecessary services in BSD
-moving from putty to Tera Term
-fixing PDF documentation links..

While not a major update, I figure since people are still downloading the 4.3 BSD RENO version as of TODAY I figure an update for these people wouldn’t be such a bad thing…

As before they are windows install packages, although I guess if you were so motivated you could extract them on some kind of *nix box..