Simh 3.7-3 released!

Hope you had a good holiday, Bob has published a new update to SIMH!

http://simh.trailing-edge.com/

On a related note, I’ve been able to get a few to compile for the iPhone, but they have fread errors… I’m not sure what’s going on so I’m going to try to adapt the disk access to sqllite (it’s part of the base os on the iPhones!) kind of like my .net ‘updates’ to simh.

I really need to put all these things somewhere…

Well at anyrate I think I’ll try to build a NLM for the 1 remaning Netware user out there.. And to check portability.

libpcap updates for Qemu 0.9.0

I decided to update my pcap patches for Qemu 0.9.0 . Now I know that for the majority of people the user mode NAT works fine for them, or they are on a platform where they enjoy playing tun/tap games. However tun/tap aren’t available on every platform. That and some of us run things like Novell Netware.

The patches are as follows:

The patch for plain QEMU
http://qemu-forum.ipi.fi/download.php?id=389

And adding support for NeXTSTEP
http://qemu-forum.ipi.fi/download.php?id=390

Now how robust is this? Well I have transfered about a gigabyte on a VM on the internet with this thing. The machine in question is a windows 2003 server running this Qemu as a service. http://tiger.vaxenrule.com/ . It’s hosting it’s own Apache, and it seems somewhat responsive to me.

I can provide exe’s if anyone is interested just contact me via here…

Qemu 0.90 patched for NeXTSTEP 3.3 i386

Patches for Qemu 0.90 are available here:
http://www.vaxenrule.com/Shared%20Documents/patchesforNeXTSTEP-on-Qemu-0.9.diff The busmouse patch still survives here.
The win32 exe is here.

A PowerPC macosx 10.4 binary is available here:
http://www.vaxenrule.com/NextSTEP%2033/qemu-0.9.0-osx-10.4-PowerPC

This moves the soundblaster to IRQ 7, and incorporates a bus fix & busmouse additon. Remember to remove the parallel port for this to work correctly. Tested with NeXTSTEP 3.3

Why all the patches, you may ask? Well for some reason NeXTSTEP is unable to correctly drive the mouse in Qemu. Nobody has tracked it down, but I suspect it’s some wierd issue with the BUS… Anyways I found this busmouse patch ages ago, and I’ve just been finagaling it for ages so that it will keep on working. I know that there are a hand full of enthusists left, but I figure that for all interested they would appreciate this.

Standalone Virtual Server annoyances

Ok, Ive been out of the country for a while… lots of fun!

At anyrate, I’ve installed Virtual Server 2005 R2SP1 on my parents computer to give it a good shake down. The good part is that it support’s DVD iso images! Woohoo!

The bad part is that for the most part you’ll get access errors when trying to use it. The only way I’ve figured out how to setup the thing, is to first configure IIS to not allow anonymous users, use the ‘built in security’. Next you’ll have to tell IE that on ‘trusted’ or ‘local’ zones you should have it pass the security automatically. That’ll get you to the configuration page. The next hurdle is that it wont let you start a remote console..

You’ll have to go into the virtual server security setup, and explicity add your user in there with full rights. The administrators group isn’t enough.

With all that out of the way you should be good to go now!

I’m in London… England

Yeah, lots of fun for work, with back to back travel. However while I was out, Micorosft Virtual Server R2 sp1 shipped! Details are available here ( http://www.microsoft.com/windowsserversystem/virtualserver/ ). I’m pretty sure this supports Vista Ultimate & Business as a host platform. I think it includes more support for Linux, but I’ve just installed it on a bare machine, I haven’t had a chance to fire it up just yet.

It’s overcast but not raining. Sometimes I forget what the weather in England can be like. I should have brought a jacket.

Oh well Wednesday I’ll be in the Americas again….

Fun from Miami

It’s not really a vacation per say, but I’ve been in Miami the last week for work… And it’s been quite the dog/pony show. At any rate I leave Miami on Tuesday, then Wednesday I’m out to London…

I’ve been playing with this:

http://puszcza.gnu.org.ua/projects/apout/

It’s like psim, except the enviroment is the PDP-11. I took the source and ripped out the core unixystuff (ttio, forking & whatnot) until I got a copy to build under Windows. It’ll play hunt the wumpus from Research Unix v6.

I’ll post more on this later.

Oh and I’m still alive!

Linux the old

My first experience with Linux was with SLS, or Soft Land Systems. It was the first pre-packed Linux system for those of us who didn’t have a Minix system to cross build from. Although Taunenbaum saw this as a draw back, like Linus many of us had 386 computers, and wanted to exploit their power. Many of us were sickened by the shattered hope that was the 286, which provided protected mode, abet in 64k chunks. The 386 offered the holy grail, or a 4 gigabyte address space! No more offset games.

At the time the closest one could hope in terms of a personal Unix was SCO Xenix, which with the developer packages was prohibitively expensive, or Coherent. Coherent was a clean room re-implementation of Unix version 7 ( http://www.vaxenrule.com/sls%201.05.zip.torrent ).

I’m going to use Qemu, again because of it’s cross platform nature, and it’s ability to emulate the NE2000. One can only hope one day that VMWare or Virtual PC would allow some kind of interface for us to ‘hack’ emulated hardware into their infrastructure…..

Anyways first let’s create a 200mb disk

Qemu-image create –f qcow sls.disk 200M

Don’t laugh, 200mb back then was a ‘big deal’… Really. Mine was SCSI, and probably weighed some 7lb.

Unzip your sls distro somewhere accessible from your Qemu tree. I’m just going to stuff mine under a sls directory. During the install we will need a boot disk, simply copy any one of the files to ‘boot’. We’ll touch on it later. To boot from the floppy I’m going to issue:

qemu -L . -hda sls\sls.disk -m16 -net nic -net user -fda sls\a1.3 -boot a

At the LILO prompt simply press enter. Then you’ll be informed
Press to see SVGA-modes available, to continue….

Press space. Early Linux kernels had this annoying ‘feature’ compiled in.. I know, I think I’m the only person that doesn’t like custom fonts, nor do I like directory colors.

At the login prompt, login as root then run the fdisk command. The keystrokes for creating a primary Linux partition is as follows:
n
p
1
1
400

Now we are going to make a smallish swap partition.
n
p
2
401
406

Now we need to change its type to swap.
t
2
82

It’s just a byte flag, but each operating system selects a flag to identify itself to others, a marker of what is where. Before emulation on dual boot systems this was a “big deal”… However now dedicating a virtual machine to an entire OS takes out the complexity that plagued so many users so long ago….

Let’s save the changes type typing in ‘w’.

We are then told to reboot the system. Type in ‘sync’ a few times, then close qemu & restart it with the same flags.

Now we can login as ‘install’. We can use the color screen, so enter ‘y’. We are going to do the brave thing, and use floppy disk images. That’s option 1. The floppy images are 3 ½” so that’s option #2.

Now we need to identify the root & swap partitions. Select #1, then type in /dev/hda1. It will want to format it, so let it. Next select #2 for the swap, and type in /dev/hda2 .
Now we can select #7 to commence installation.

To get the full experience we are going to install the full thing… 100MB of it.. Option #4. We don’t want to be prompted we simply want everything that SLS has to offer, so answer ‘n’.

You will be prompted for a2-a4 Don’t forget in Qemu it’s ctrl-alt-2 for the runtime config, and you just issue:

change fda sls\a2

and so on for the rest of the disks. Then ctrl-alt-1 to go back to the main screen.

While this may seem tedious it’s better & faster than the real thing. Trust me!

Once X11 finishes unpacking, place in the boot disk, and let it write to it. Next feel free to preset the video mode to -1. We don’t have a modem, so you can answer no. Next we’ll allow the install to mark /dev/hda1 as the active partition. Just press enter for the question about dos partitions. Pick a snazzy hostname. The default softland works just fine. We have no patch disks, so you can just enter ‘n’ and press enter.

Phew we have just installed SLS! Press enter!

After that you can boot up into Linux 0.99.15g/SLS 1.0 . The best that 1994 has to offer.

Before we leave for now, lets get X-11 rolling. Login as root, no password, and then run syssetup. Choose 5,2,6,0. This configures the basic VGA server, a PS/2 mouse & exits the basic program. Running ‘startx’ Should get you into a really old X-11. No Gnome/KDE here! The mouse however acts erradictly. Ctrl-alt-backspace will bring you back to the prompt. I’ll see if I can figure this out later…

But for now that covers a basic install. Next up we’ll do some networking, and a game perhaps….

A minor update….

OS/2 1.3 on Bochs
OS/2 1.3 on Bochs
OS/2 1.3 does infact run under BOCHS. Here is the catch, like Xenix you currently must make an image of an existing installation, and point Bochs towards it.

Here is the flag that I used:
ata0-master: type=disk, path=”os2-1.3.img”, cylinders=919, heads=16, spt=17

Bochs will complain about the geometry not matching… Just hit the ignore button, and it boots up just fine.

Thanks to Geoff Shearer for trying, since I had figured it wouldn’t even work.

I promise, a quick tour of SLS Linux next time… Where the distro wars all started!

A tale of two kernels.

Back in the early 1990’s Microkernel’s were all the rage. Everywhere you would go you’d hear all about Pink, Taligent, Windows NT, and the grand daddy of them all Mach.

Probably the most well known debate about microkernel vs monolithic kernels was the Tanenbaum vs Torvalds debate that raged on comp.os.minix back in 1992. You can read the entire thing here : ( http://www.oreilly.com/catalog/opensources/book/appa.html ). It was interesting in the sense that even Ken Thompson of UNIX fame even chipped in. Tanenbaums’s major points were that a microkernel is more inherently portable than a monolithic kernel, and that microkernels could be more reliable, and easier to maintain. Of course more than 10 years later we can see that Linux still flourishes, and that outside of Windows NT & OS X no mainstream OS relies on a microkernel. Even OS X treats mach more as a call library than a traditional microkernel, since all of the exe’s in Darwin / OS X are Mach-O format, not COFF/ELF,A.OUT, etc etc.

Mach started out as a project from CMU derived from the UNIX source code, to try to re-invent the lower levels of UNIX into something that would scale easier to multiprocessors, support for threads, and the holy grail of them all, expand it’s portability. Sadly the first few versions of Mach are barred from distribution due to their inclusion of encumbered UNIX source code. However when the university of Utah picked up Mach, and released Mach4 (UK22, info here http://www.cs.utah.edu/flux/mach4/html/Mach4-proj.html ), including full source. Also they provided Lites, a BSD server that can run atop Mach, giving the user a ‘UNIX’ system, as it were.

Lites
Lites

So digging through some network groups, and testing stuff, I finally slapped together the pieces, and built a Mach/Lites system on NetBSD 1.1 . And how does it perform? It’s significantly slower than NetBSD is. You can tell that the amount of context switching involved in Mach as a program makes a call the microkernel, which in turn validates & passes it to the server, which further validates, runs the process, then sends the results back to the kernel, which then passes it back to the program. I’ve heard in a worse case scenario a 500% reduction in speed. You can always read more info on the fine wiki article here ( http://en.wikipedia.org/wiki/Mach_kernel ).

Lots of people will argue that microkernel’s have simply failed, and that it’s simply an example of what seemed like a good idea being pushed too hard once it was found to fail. It a lot of ways it reminds me of ADA.

So for now I’m going to provide a Qemu image of Lites running on Mach 4. unzipping the file will provide you with a lites.cmd file which for windows users you can just run directly. Things to note are:

-The version of Qemu that I’ve bound requires libpcap to be installed.
-Mach4 can only address 16mb of ram, due to DMA issues across the 16mb line.
-I’ve enabled user mode networking so that
-the cmd file sets up local port 23 to be redirected to the VM. This will allow you to telnet in simply by ‘telnet localhost’. You may want to use putty for better terminal handeling
-The included Gcc 2.4.5 is ancient. Outside of building a simple irc client, I wouldn’t expect much.
-The boot process is broken, and it’ll parse through the rc scripts twice. Just let it do it’s thing, and it’ll drop to a login prompt.

Logging into Lites/NetBSD
Logging into Lites/NetBSD

Other than that it behaves just like a NetBSD 1.1 machine.

Notice that grub boots the kernel /Mach.UK22 . When Mach boot’s it’ll load up the files emulator & startup. The ‘emulator’ is the Lites microkernel. Once it’s loaded it’ll start mach_init which just symlinks to /sbin/init and the normal NetBSD bootup will commence.

You can download my image directly here as MachUK22-lites-nat.zip.

Next time we’ll play with SLS Linux.

psim, the PowerPC simulator

Psim is one of those great peices of software that has been long sice forgotten. In every copy of GDB since 4.14 it has been sitting there dormant. What is it? Well it’ll emulate various PowerPC systems to some degree (GXemul & Qemu are better now) but what is cool is the ‘run’ program. Simply put, any system that can run GDB can run powerpc NetBSD statically linked EXE’s! Now isn’t that exciting!

Now I know you’ll want to build your own copy of the ‘run’ program, and then setup a cross compile enviroment so that you, to can produce NetBSD PowerPC executables. I’m assuming that you are not on a PowerPC running NetBSD, since this whole excersize would be… redundant.

For this example I’m using OpenBSD 4.0 on the i386. You will need a real unixy envioment for this. MinGW isn’t good enough, cygwin however is. BSD/Linux will work too.

Ok first let’s start with building the run program. I’m going to download my GDB from ftp://ftp.gnu.org/ .

Gdb 5.3

Unpack it somewhere, and then run the following commadn to configure GDB.


./configure --enable-sim-powerpc --target=powerpc-unknown-eabi --prefix=/usr/local/psim

 

You will need to replace or update the sim/ppc/emul_netbsd.c program to include system calls up to 300, and make sure that 279 is setup to do_fstat. Otherwise you will be unable to run any programs. This is also a good excersize to see how libraries interact with the simulator so you can add your own native interfaces, for things like OpenGL, SDL….

 

Now we are ready to build it.. You could use -O0 in your CFLAGS to build it quicker, but it will result in a slower run times.. If you have issues with this you will want to use those flags so it doesnt take forever to be building this thing. Otherwise a simple ‘make;make install’ will suffice.

Next up is binutils. I’m using version 2.17

Binutils 2.17

Again download and unpack this somewhere (/usr/src?) Then run the following to configure your binutils


./configure --target=powerpc-unknown-netbsd --prefix=/usr/local/psim

Since execution time here isn’t as critical as the emulator, and I want to hurry it along I’m going to use the following command to build & install:


make CFLAGS=’-O0 -pipe’ ;make install

On OpenBSD 4.1 the install fails, and I had to manually copy the binutils applications into /usr/local/psim/powerpc-unknown-netbsd-bin

Before you build gcc you will want to populate your directory with headers & libraries from NetBSD 1.4 get the compiler package and copy the usr/lib files to /usr/local/psim/powerpc-unknown-netbsd/lib and the usr/include files to /usr/local/psim/include . I get my includes & lib files from here ( ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-1.4/macppc/binary/sets/comp.tgz )

Gcc 3.3

You may need to do some special tweaking to this source to get it to run correctly
Optionally running make with CFLAGS=-O0 may speed your compliation.

You know the drill by now. Download, unpack and configure as follows:


./configure --target=powerpc-unknown-netbsd --prefix=/usr/local/psim --disable-shared --enable-languages="c" --disable-threads --disable-intl

Now make the compiler as follows. Note that I’m only interested in the C compiler. I haven’t even looked at C++/ObjectiveC…

You will need to add /usr/local/psim/bin into your path, as Gcc 3.3 will expext to be able to call powerpc-unknown-netbsd-ld/ar/ranlib etc while building itself.

export PATH=$PATH:/usr/local/psim/bin

Next I would comment out the following line from gcc/builtins.c

builtins.c:2864:// error (“__builtin_saveregs not supported by this target”);

Now we can build the compiler


make CFLAGS=’-O0 –pipe’

Now before we get all giddy, lets test this thing out!

cd into the gcc directory, and lets make a simple c program… hello world is a good starting place.

use xgcc to compile it, and this will test your c compiler.


#include <stdio.h>
void main(void)
{
printf("hello from PowerPC\n");
}

bash-2.05a$ xgcc hello.c -o hello

hello.c: In function main':hello.c:2: warning: return type ofmain’ is not `int’

bash-2.05a$ file hello

hello: ELF 32-bit MSB executable Version 1

bash-2.05a$ ./hello

bash: ./hello: cannot execute binary file

Ok the executable that we have just created is NOT for our native platform, but for the PowerPC.. So lets kick in the emulator! If you didn’t patch your emul_netbsd.c you’ll get this:


% /usr/local/psim/bin/powerpc-unknown-eabi-psim hello

do_call() os_emul call 279 out-of-range

 

However if you did, this is what you’ll get!
% /usr/local/psim/bin/powerpc-unknown-eabi-psim hello
hello from PowerPC

On my computer the installation of gcc gets retarded so I manually copy the files to the right places.


cp xgcc to /usr/local/psim/bin/powerpc-unknown-netbsd-gcc

mkdir -p /usr/local/psim/lib/gcc-lib/powerpc-unknown-netbsd/3.3/

cp cc1 /usr/local/psim/lib/gcc-lib/powerpc-unknown-netbsd/3.3/

cp crtsaveres.o /usr/local/psim/lib/gcc-lib/powerpc-unknown-netbsd/3.3/

Building cross compilers is always involved, but hopefully this will help someone.