Did you know that GCC used to support Windows NT ?

I’m not talking about MingGW, Cygwin or anything else like that, but rather when support for Windows NT first appeared, it had to be compiled with Microsoft Visual C++ 1.0 of all things.

It was back in the 2.6 days of GCC, right before the stagnation that led to EGCS.

`i[345]86-*-winnt3.5'
     This version requires a GAS that has not yet been released.  Until
     it is, you can get a prebuilt binary version via anonymous ftp from
     `cs.washington.edu:pub/gnat' or `cs.nyu.edu:pub/gnat'. You must
     also use the Microsoft header files from the Windows NT 3.5 SDK.
     Find these on the CDROM in the `/mstools/h' directory dated
     9/4/94.  You must use a fixed version of Microsoft linker made
     especially for NT 3.5, which is also is available on the NT 3.5
     SDK CDROM.  If you do not have this linker, can you also use the
     linker from Visual C/C++ 1.0 or 2.0.

     Installing GNU CC for NT builds a wrapper linker, called `ld.exe',
     which mimics the behaviour of Unix `ld' in the specification of
     libraries (`-L' and `-l').  `ld.exe' looks for both Unix and
     Microsoft named libraries.  For example, if you specify `-lfoo',
     `ld.exe' will look first for `libfoo.a' and then for `foo.lib'.

     You may install GNU CC for Windows NT in one of two ways,
     depending on whether or not you have a Unix-like shell and various
     Unix-like utilities.

       1. If you do not have a Unix-like shell and few Unix-like
          utilities, you will use a DOS style batch script called
          `configure.bat'.  Invoke it as `configure winnt' from an
          MSDOS console window or from the program manager dialog box.
          `configure.bat' assumes you have already installed and have
          in your path a Unix-like `sed' program which is used to
          create a working `Makefile' from `Makefile.in'.

          `Makefile' uses the Microsoft Nmake program maintenance
          utility and the Visual C/C++ V8.00 compiler to build GNU CC.
          You need only have the utilities `sed' and `touch' to use
          this installation method, which only automatically builds the
          compiler itself.  You must then examine what `fixinc.winnt'
          does, edit the header files by hand and build `libgcc.a'
          manually.

       2. The second type of installation assumes you are running a
          Unix-like shell, have a complete suite of Unix-like utilities
          in your path, and have a previous version of GNU CC already
          installed, either through building it via the above
          installation method or acquiring a pre-built binary.  In this
          case, use the `configure' script in the normal fashion.

Well, that is quite the tall order!  I can’t believe I somehow managed to build it back then, and out of curiosity I managed to build it again.  And as you can see you need a ‘beta’ release of the GAS assembler, which is kind of impossible to find now, but it was part of the GNAT project, which used to distribute binary builds of the GCC core back in the day.  Luckily, I have a version stuffed away, although it’s from GCC 2.8.1, not as ancient as it would have when GCC 2.6 was a new thing.   But it at least assembles enough for my simple Hello World experiment.

To build GCC you need a working SED, which surprisingly CL 8.0 from the Win32s SDK, and it runs fine on Windows 7 x64 of all things.  I had to mess with some of the files, and substitute the linker & headder files from Visual C++ 2.0 but much to my amazement not only can I build GCC along with libgcc.a, it also builds incredibly fast.  On my machine I can compile GCC in about 5 seconds. Â I remember in 1995 building this on Windows 95 (I was crazy) and it is taking HOURS and HOURS.

So, one nice thing about these binaries is that you don’t need any external DLL’s  Even the import section of a simple hello world exe is tiny:

GetVersion GetEnvironmentStrings GetCommandLineA ExitProcess RtlUnwind UnhandledExceptionFilter GetModuleFileNameA GetFileType GetStdHandle GetStartupInfoA VirtualFree VirtualAlloc WriteFile WideCharToMultiByte GetLastError FlushFileBuffers SetFilePointer SetStdHandle CloseHandle KERNEL32.dll

Which implies that it only needs KERNEL32 to function.

I don’t know if it’s of any use to anyone else, but HERE is my dump of all the source and tools I used to build GCC.

Saving RISC GCC from the dumpster

Well it seems that the old GNAT stuff from NYU.EDU is no more.

D:\gnat>ftp cs.nyu.edu
Connected to cs.nyu.edu.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-Local time is now 23:26. Server port: 21.
220-Only anonymous FTP is allowed here
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
User (cs.nyu.edu:(none)): anonymous
230-Your bandwidth usage is restricted
230 Anonymous user logged in
ftp> cd pub/gnat
250 OK. Current directory is /pub/gnat
ftp> ls
200 PORT command successful
150 Connecting to port 54057
README
c++-interface.ps.gz
papers
private
226 4 matches total
ftp: 46 bytes received in 0.00Seconds 46000.00Kbytes/sec.
ftp>

For those unfamiliar they provided binary builds of GCC for various platforms, including a bunch of RISC machines. It would be a great loss for anyone trying to bootstrap GCC on one of these platforms with missing parts.

Luckily I have saved them, and put them back online!

*Dec Alpha OSF4
*HP HPPA HPUX 10.20
*i386 Solaris 2.6
*SUN Sparc Solaris 2.5.1
*IBM PowerPC AIX 4.1

For anyone interested, this is how I used GNAT to turn Solaris 2.4 into something usable.

Its that time of the year again

provider issues….

Dear Customer,

In the past month we sent out a survey to our customers requesting feedback on the services you receive from us and in particular the location. We carried out this survey due to the situation we have with our current provider in Germany. We have been fighting long and hard in an attempt to rectify long standing issues with them with regards to stability and reliability. Instead of improving, the situation has become worse to the point where servers are randomly powered down because a DC technician has knocked a power cable out and hardware is failing with no replacements being actioned despite our requests. More recently, we’ve had issues with them working on their network and ‘forgetting’ to plug servers back in.

As you can imagine, this kind of service impacts greatly on you, our customers, and it’s not something we can continue to accept. Despite our best efforts a resolution with them has been unattainable so we have had to make the decision to move customers with immediate effect.

It’s really not their fault, so time to backup again, and get ready for the shuffle.

Maybe it’s time to move to CloudFlare.

Dungeon on A/UX

Dungeon on A/UX

Dungeon on A/UX

I know it’s been a while since I’ve done one of these, but now that I’ve been playing with A/UX on Shoebill, I noticed that A/UX comes with a Fortran compiler!

So I downloaded dungeon, and took a few minutes, mostly making a GNU Makefile, and I was able to produce a working binary!

For anyone who cares it’s here.  I guess f2c is kind of pointless, seeing that the OS already comes with a F77 compiler.

Shoebill now has working Ethernet support!

Great news!  The excellent A/UX capable emulator Shoebill, now has working Ethernet support!  The sad news is that it only supports the TUN/TAP interface.  So Windows users are kind of left out in the fun.

Shoebill + Ethernet

Shoebill + Ethernet

Except, I’ve been here before with SIMH ages ago.  So I dusted off my source code, and injected it into Shoebill.  The first issue I had was that SLiRP was rejecting all the inputted frames, because of invalid frame length.  Even more weird is that ARP worked, and I could see the 10.0.2.2 and 10.0.2.3 virtual IP’s but TCP and UDP outbound wouldn’t work at all.

It took me longer than it should have but although this code worked great with GCC 2.7 and 3.0, 4.x breaks it.  And it’s the same reason why Shoebill originally didn’t work on Win32, the blasted packed structures!  So adding the ‘-mno-ms-bitfields’ flag to GCC is all it took, and now I could ping 10.0.2.2 for about 5-7 pings until SLiRP would crash.  I tried all kinds of stuff trying to see if there was an issue with SLiRP, but I should have payed closer attention to the debugger, with all those threads flying around.  It turns out Shoebill was trying to read & write a the same time, which caused SLiRP to crash as it is not re-entrant.  I tried to place mutex’s on every SLiRP call but that ended up having SLiRP not process any packets.  Very strange.  I then reduced it to where I read the frame out of SLiRP and pass it to Shoebill, and where Shoebill write’s a frame out the SLiRP.  And much to my amazement I can run ‘worms’ just fine!

So after a minute of worming and pinging I called it ‘good enough’ and rebuilt a production binary, and packaged up my source code.

For anyone who want’s to play, my Win32 EXE is here, and the source code I am using is here.

Exchange 5.5 OWA vs Outlook 2003

ASP 0115

ASP 0115

error ‘ASP 0115’

Unexpected error

/exchange/USA/root.asp

A trappable error occurred in an external object. The script cannot continue running.

So, call me crazy, but I’ve been running an Exchange 5.5 server a home for a while without issues.  It’s perfect for a single user, I can keep up to 16GB worth of email on there, and best of all I can use real email clients like Outlook (or is it LookOut!?).  Anyways I noticed something weird which is that Outlook 2003 always is unsure if the server is there, and I have to tell it that it’s OK to connect.  Also once the Outlook 2003 client connects, it kills OWA, giving me these weird ASP 0115 Unexpected errors.

googling around for a fix was a bit futile, and I’d largely written off OWA, as in this day & age, who really wants some ASP 3.0 app?  But for some reason, today was going to be the day to fix it, as I don’t have Outlook on my macbook air.

So with the Outlook 2003 clue in mind I finally found KB-818709, aka “Outlook Web Access stops responding when you try to access a mailbox on an Exchange 5.5 computer”.

As the cause states:

This problem occurs when you try to access a user account that was previously accessed by a client computer that is running Microsoft Office Outlook 2003.

Outlook 2003 adds a fourth entry to the PR_FREEBUSY_ENTRYIDS property. PR_FREEBUSY_ENTRYIDS is a multi-valued MAPI property that is stored on the Inbox folder. CDO expects three entries. The unexpected fourth entry causes heap corruption that causes OWA or the third-party program to stop responding.

Well how about that?

So with the hotfix in hand, and a reboot, it now works perfectly, like it did back in 1997.  And the best part is that it works great in Chrome.

And for anyone crazy like me with Exchange 5.5, remember to install SP4, and of course the KB829436 hotfix!

Playing around with Gopher

virtuallyfun gopher

My Gopher Site, via proxy

Back in the day, if you were ‘hip’ and ‘cool’ and had a UNIX shell account back in 1993 there was this cool way of getting around various computer systems around the world called gopher.  What was really cool, is that it offered search services, indexing and even gateways into various libraries (where they kept physical books) where you could search their card catalogs for various tomes you were looking for.

Some colleges even had various services that you could connect to, offering things like news, weather and whatnot.  It was pretty neat, however there was one stumbling block, which is gopher was a VERY controlled environment, where most universities locked their client to only starting at one particular gopher server, and to get anywhere else you had to memorize an insane number of keystrokes that would make 1800 operators go crazy.  Also there was nothing like virtual hosting, so the idea of having your own gophersite was most likely out of the question.  The other issue is that the University of Minnesota, where boombox resided (the master gopherserver) saw they had something good going, and unlike UCB’s CSRG which gave BSD away for free, they were going to license the server for $100 for a educational institution, and $500 for a commercial institution.

Needless to say, this CERN thing called HTTP which they were trying to distance themselves from, which wanted no money for became the next big thing, and with the freedom and ease of setting up website, gopher became a ghost of the past.

But as the world was starting to build web clients, many understood gopher, including Microsoft’s Internet Explorer.  Although starting with version 7 (gopher was also disabled with some updates in IE6), gopher has since been removed.  But thanks to the Utilu IE Collection, and this quick registry setting you too can surf gopher space with IE 4.0 (or 5,5.5..) like it’s the mid 1990s.

My gopher site via IE 4.0

My gopher site via IE 4.0

So needless to say with a client in hand, I wanted to setup my own server.  And keeping with it being old, I decided to use the old 2.3.1 gopher server.  I also compiled it with freeWAIS support, although I haven’t quite worked out how to get that fully working right now.  Compiling this stuff on 32bit i386 Linux was trivial to say the least, but if you need binaries or anything they are here.

the next thing was to get both wais, and gopherd running from xinetd, which was easy once I knew how.  These are the service files I created:

service gopher
{
socket_type = stream
protocol = tcp
wait = no
user = gopher
server = /usr/local/etc/gopherd
server_args = -I -l /var/log/gopherd.log -u gopher /gopher-data 70
instances = 20
}

And for wais:

service wais
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/local/bin/waisserver
server_args = -d /gopher-data/wais /gopher-data/wais.log -l 10 -p 210
instances = 20
}

Easy, right?

Gopher likes to be a named service, so I went with my virtuallyfun.com domain, as it is easier to type.  I guess I could have gone with gopher.superglobalmegacorp.com but that is… LONG. Another cool thing is that there are several gopher proxies out there for HTTP only people, so you can also get to my gopher page here (via gopher.floodgap.com).

The harder part was figuring out how the directory mapping works, but luckily there was enough in the test directory to get something working, changing this

ls

About decode-n-scripts install mspl tmp
bin ftp-horrors lib pids

Into this:

The old UNIX gopher client

The old UNIX gopher client

The secret is all in the .names and .Links files.  The .names file will map a directory name to something more pleasing, such as changing mspl to the “Microsoft Programmer’s Libary”.

Path=./mspl
Name=Microsoft Programmer’s Library

Easy, right?

And the .Links file creates links to various content, from a telnet example (to my bbs….)

Type=8
Name=QemuOS/2 BBS (My BBS!)
Host=bbs.superglobalmegacorp.com
Port=23
Numb=100
Abstract=My Synchronet BBS running on OS/2 inside of Qemu! #100
Path=

To another gopher system

Name=My lame SDF.org site
Type=1
Host=sdf.org
Port=70
Path=/users/jsteve
Abstract=My personal SDF gopherspace (itsucks) #-11
Numb=-11

To even doing some crude ascii art!

Name= # # # ##### ##### # # ## # # # #
Type=3
Path=
Numb=5
#
Name= # # # # # # # # # # # # # #
Type=3
Path=
Numb=6

.. and so on.

So yes, to be difficult, all the links in this post are gopher:// links. I don’t know if that’ll deter the likes of any self proclaimed virus scanner king, but I’d like to think that his poorly constructed automated tests will be unable to connect to gopher resources.

Now if I can figure out how to setup my own jughead or veronica to search my own wais of information, that’d be excellent.

If I had the virtual space I’d host the whole thing on a virtual VAX…. or something equally insane.  Word is Shoebill just got ethernet support, so running my gopher space on A/UX would be cool.

Running MS SQL Server 4.21 on OS X.

Yes, you read that right.  Thanks to the power of Crossover (Wine) I’m running SQL 4.21 on OS X.  But the installation is *NOT* straightforward.  Actually it doesn’t install at all.  But you can ‘transport’ a working copy from a Windows machine into Wine, and it’ll run.

The first thing is, if you’ve ever dealt with MSSQL is that it is VERY picky about machine names.  So first install MS SQL 4.21 in a NT 3.1/3.5/3.51/4.0 VM with a name you like. Also remember to set the default client library to TCPIP. Then create a Wine instance on your target box.  Next you’ll need to make a few changes to the registry to force the machine name:

HKEY_CURRENT_USER\Software\Wine\Network

UseDnsComputerName

REG_SZ N

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName

ComputerName

REG_SZ MSDE

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ComputerName

ComputerName

REG_SZ MSDE

I called my machine MSDE, as I have no imagination.  With those keys in place the next thing to do is grab the service keys..

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SQLServer

and

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SQLMonitor

Then finally the MS SQL product key:

HKEY_LOCAL_MACHINE\Software\Microsoft\SQLServer

The final step was to copy over the c:\sql directory, and create icons for the SQL Server, and the management tool.

To run, start the server first (SQLSERVR.EXE) , then launch the admin tool (SQLADMIN.EXE), and you should (hopefully) be able to connect!

MS SQL Server 4.21 running on OS X

MS SQL Server 4.21 running on OS X

And there we go! Is it useful? Not really, but I mean it is cool! I haven’t tried this with 6.0 or 6.5 but I imagine they should work as well. 7.0 and beyond are more complicated to transpose as they require a great deal of COM integration. In theory they should work.