Yet another update! networking for 4.2 BSD

4.2BSD telnetI have released yet another interim update to my VAX BSD on Windows installer package.

I redid the 4.2BSD package, so anyone that has downloaded, will want to download again (there were 2 downloads… )

Anyways I found a source tree of 4.2 BSD with the if_de.c and the same fix for the 4.3 BSD’s worked fine for this one as well. Now you can telnet into 4.2 BSD!

You can download it from here:

https://sourceforge.net/project/showfiles.php?group_id=204974&package_id=245145

It is worth noting that I didn’t even look at the TCP/IP stack so it’s possible that you could be hit with issues with negative numbers in the TCP sequencing, and other weird 4.2 to 4.3 bugs.

Also attempting to fix locore.s to allow more then 8mb of ram seems to have a kernel that hangs right after mounting the root partition.. If anyone remembers what to do to fix it, I’d appreciate it. I see in google’s usenet cache, they had the same issue at Nova University, but I didn’t see any follow up for a fix.

This update now brings all of the 4BSD packages on Windows up to a network operational level. Also please note that they all use the same user mode mapping ports (ie 42323 to 23 into the VM) so you currently cannot operate all of them at the same time. If that is an issue for anyone you can regen the exe’s from the SIMH project page:

https://sourceforge.net/project/showfiles.php?group_id=154308&package_id=244757

Otherwise you can just contact me.

 

And update on the update

Well I was playing around with a version of 4.3 BSD I’d never heard of, that was from the University of Wisconsin, when I figured out a quick hack to get the 4.3 BSD’s networking operational under SIMH’s 11/780 emulator. I simply removed the error checking from the recv portion in the if_de.c file, and it now works!

So I have updated some packages on the sourceforge site:

https://sourceforge.net/project/showfiles.php?group_id=204974&package_id=245145

4.3 BSD & UWisc 4.3 BSD have been added, and both are ready to run with SLiRP (User mode networking/nat).

As for the Wisconsin release, it may interest people as they had taken the NFS & VFS code from SunOS and integrated them into 4.3 BSD before the RENO time frame. From there it seems that most of the hackers at UWisconsin went on to either Legato or SUN to continue their work, leaving this release as a single event… The tape image seems to have last been used January 12th, 1987. This release does not appear on the UNIX family tree’s.. It’s like a long forgotten offshoot, but still I think it’s kind of cool. And it shows just how networking was done back then with nearly 4000 enteries in the hosts file!

I’ve been trying to track down some more info from the TUHS list, but if anyone else passing by wants to add anything, feel free to let me know!

Otherwise, the installer package on sourceforge should run on any Windows 98 or above machine.

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

NASA space probe data

While nothing to do with emulation, I came across this ftp server with all kinds of data from NASA probes.

nssdcftp.gsfc.nasa.gov

It’s got all kinds of readings, and even some programs to interpret the data.. (FORTRAN from what I saw). It’s got to be one of the better clearing houses of space probe data available… I suppose later on I’ll see what’s involved in running some of these programs.. But I wouldn’t hold your breath…!

Even for the less inclined, there is jpeg & tiff data!

For example here is a picture from the viking project on Mars:
ftp://nssdcftp.gsfc.nasa.gov/miscellaneous/planetary/viking/images/vom_sj05s070.jpg

Stunning to say the least.

easy68k & sozobon

Easy68k

I know this is a little weird to follow, but I thought it was somewhat interesting. Anyways I’ve been reading up on some CP/M stuff, and found some interesting m68k stuff. There is this really cool m68k simulator/test environment called easy68k. Ok so the 68000 isn’t exactly the hottest chip, but for anyone that’s used a Mac, Amiga, Atari ST, SEGA Genesis, or old SUN the m68000 was the end all be all CPU. Anyways you can download the easy68k simulator from here:

http://www.easy68k.com/

Now I’ve never been really all that good with assembly. I know one day I should learn, but until then, there is higher level languages, and of course the best ‘medium’ level language C. Back in the day the ‘sozobon’ compiler was somewhat portable, and a good & easy 16 bit C compiler. Now as far as I know there really hasn’t been any activity on this since 1991, so it’s getting hard to find, and of course the archived copies I found needed LZH.. You can find some archived copies here:

http://umich.edu/~archive/atari/Languages/Sozo2/

Since I didn’t want to go thru a big ordeal, I found an extracted copy of the sources here:

http://cd.textfiles.com/crawlycrypt1/program/compiler/sozobon/

Building the sozobon compiler

Using wget I pulled down the source code. It’s worth noting that unlike GCC this is SMALL… although it only targets the 68000 cpu. The only source that I’m using is the actual C compiler. I suppose if I were better I could map the simulator, and setup the assembler & linker to target the environment all the way… However for now I’m just interested in showing the relationship between a compiler, to the assembler. Now the source is old enough that it uses the reserved word inline in gunk.c I simply changed it to Xinline. I’ve attached a diff for those who like diff’s however as you can see it’s really simple, I just renamed them, so they don’t conflict.


--- gunk.c Fri Feb 22 05:33:34 1991
+++ gunk-fix.c Mon Mar 9 14:35:33 2009
@@ -37,7 +37,7 @@
int (rewri)(); / rewrite function */
};

-int m_unfold(), unfold(), m_cast(), cast(), m_inline(), inline();
+int m_unfold(), unfold(), m_cast(), cast(), m_inline(), Xinline();
int m_hardas(), hardas(), m_fcmp(), fcmp(), m_md_shf(), md_shf();
int m_eident(), eident(), m_incdec(), incdec(), m_fldas(), fldas();

@@ -48,7 +48,7 @@
{m_eident, eident},
{m_incdec, incdec},
{m_hardas, hardas},
- {m_inline, inline}, /* must cast before inline /
+ {m_inline, Xinline}, /
must cast before inline */
{m_fcmp, fcmp},
{m_fldas, fldas},
{0}
@@ -424,7 +424,7 @@
return 0;
}

-inline(np)
+Xinline(np)
NODEP np;
{
register NODEP nmp, cmap;
@@ -782,7 +782,7 @@
register NODEP tp;

spar1 = "%fpcmp";
- inline(np);
+ Xinline(np);

tp = copyone(np);
tp->n_left = np->n_left;

Now with that out of the way, you should be able to build with the make.unx


% make -f make.unx
gcc -DUNIX -O -c d2.c
gcc -DUNIX -O -c decl.c
gcc -DUNIX -O -c expr.c
gcc -DUNIX -O -c fix.c
gcc -DUNIX -O -c fun.c
gcc -DUNIX -O -c g2.c
gcc -DUNIX -O -c gen.c
gcc -DUNIX -O -c gsub.c
gcc -DUNIX -O -c gunk.c
gcc -DUNIX -O -c main.c
main.c:424: warning: 'optnl' was declared implicitly 'extern' and later 'static'
main.c:417: warning: previous declaration of 'optnl'
gcc -DUNIX -O -c md.c
gcc -DUNIX -O -c nodes.c
gcc -DUNIX -O -c out_st.c
gcc -DUNIX -O -c p2.c
gcc -DUNIX -O -c pre.c
gcc -DUNIX -O -c tok.c
gcc -DUNIX -O -c subs_c.c
gcc -o xhcc d2.o decl.o expr.o fix.o fun.o g2.o gen.o gsub.o gunk.o main.o md.o nodes.o out_st.o p2.o pre.o tok.o subs_c.o

Writing hello world!

OK, with the compiler built, let’s write a simple C program. I’ve setup a simple main, and calls to a ‘putc’ and an ‘exit’ that currently don’t do anything. We will have to fix that in the assembly source.. but for now it’s nice as it sets up a place holder.



char MESSAGE[]="this is a message";
void putc(c)
char *c;
{

}
void exit()
{}

void main()
{
int j;
j=0;
putc(MESSAGE);
exit();
}

Now we can compile the source file (x.c) and use the -S flag, so it only outputs an assembly source, that we can then massage to work with easy68k.


% ./xhcc -S x.c ; cat x.s
.data
.globl _MESSAGE
_MESSAGE:
.dc.b $74,$68,$69,$73,$20,$69,$73,$20,$61,$20,$6d
.dc.b $65,$73,$73,$61,$67,$65
.dc.b 0
.text
.globl _putc
_putc:
bra L1
L0:
;var 4 8 _c
L2:
unlk a6
rts
L1:
link a6,#-0
bra L0
.globl _exit
_exit:
bra L4
L3:
L5:
unlk a6
rts
L4:
link a6,#-0
bra L3
.globl _main
_main:
bra L7
L6:
;var 2 -2 _j
clr.w -2(a6)
move.l #_MESSAGE,-(sp)
jsr _putc
add.w #4,sp
jsr _exit
L8:
unlk a6
rts
L7:
link a6,#-2
bra L6
.data

As you can see from the source below the following changes were made:

-Added the ORG $1000
-Changed the formatting of the _MESSAGE into a format that easy68k’s assembler likes.
-Removed all the .globl statements.
-Renamed the _main section to START & and add the end start tags.
-Populated the exit procedure with the ‘exit’ code from easy68k’s example
-Changed putc to use the d0 register instead of d6, and added the print string code from easy68k.


ORG $1000

_MESSAGE dc.b $74,$68,$69,$73,$20,$69,$73,$20,$61,$20,$6d
dc.b $65,$73,$73,$61,$67,$65
dc.b 0

_putc:
bra L1
L0:
;var 4 8 _c
move.b #14,d0
trap #15

L2:
unlk a0
rts
L1:
link a0,#-0
bra L0

_exit:
bra L4
L3:
L5:
unlk a6
rts
L4:
move.b #9,d0
trap #15
link a6,#-0
bra L3

START:
bra L7
L6:
;var 2 -2 _j
clr.w -2(a6)
move.l #_MESSAGE,-(sp)
jsr _putc
add.w #4,sp
jsr _exit
L8:
unlk a6
rts
L7:
link a6,#-2
bra L6
end start

conclusion

Now you can run the code in the simulator, and watch it enter the ‘start’ section, call the putc with the address of _MESSAGE, return to the main, and then call the _exit procedure, which calls the sim68k exit program interrupt. I’ll leave this as an exercise to the read for any real value…. I just thought it was cool, that without really learning any assembly I was able to write a basic ‘hello world’ type program in an hour….