unresolved symbol __imp____iob_func aka SDL 1.25 & Visual Studio 2015

While trying to build something with Visual C++ 2015 Community edition I got this fun error while trying to link:

LNK2019 unresolved external symbol __imp____iob_func referenced in function _ShowError
LNK2019 unresolved external symbol __imp__fprintf referenced in function _ShowError

So it turns out that some of the fundamental streams have changed, and when the SDL library is compiled it attaches LIBC into it, which then creates this fun mis-match.  The fix is easy, of course, just download the source to SDL 1.25, and re-build it with Visual Studio 2015.  But then you’ll get another error that /ZI and /Gy- are incompatible with eachother.  I just changed /ZI to the older /Z7 setting, and I could quickly compile SDL, copy the libs to my project and happily link & run.

Installing Borland C++ 3.1 in DOSBox: Too many subdirectories!

too many subdirectories?!

So I wanted to install Borland C++ 3.1 under DOSBox to compile something ancient.  I’m on a MAC so MS-DOS player is not currently an option.  I have disk images, which p7zip can happily break down into files, giving me a bunch of files in a single directory, the perfect thing to mount as a ‘disk’ under DOSBox.  However I had subdirectories with patches, source and other stuff in my virtual ‘floppy disk’.  And the installer bombed.  Turns out it wasn’t any file limitation, or anything in the guest C: drive, no the Borland installer doesn’t like sub directories on the install source.

Remove those, and it’ll install just fine.

Also, maybe it’s the weird Borland extender, but Borland C 2.0 runs WAY faster under DOSBox than version 3.1

Quakecon 2017

It’s that time of year again, QUAKECON.  If I were one to plan things, I’d be there either as an indie, with a table featuring such hits as QuakeWorld for OS/2, and of course the much beloved Quake II for MS-DOS.  But I’m a slacker, and things get forgotten.

As always, the old iD catalogue is on sale, featuring DooM!

Ultimate DooM is $9.75 HKD which is $1.25 USD.  So if for some reason you have never bought DooM, at this price it’s hard not to have it.  And of course all the old MS-DOS DooM can be had for $3.15 USD!  And of course for those who want to downgrade to version 1.1, don’t forget my ancient article “Just how ‘original’ is the Ultimate Doom on steam?

26th anniversary of Linux!

As the joke goes:

Happy 25th birthday, Linux! Here’s your f-ing cake, go ahead and compile it yourself.

So it’s always a fun time for me to push my old project Ancient Linux on Windows.  And what makes this so special?  Well it’s a cross compiler for the ancient Linux kernels, along with source to the kernels so you can easily edit, compile and run early Linux from Windows!

As always the kernels I have built and done super basic testing on are:

  • linux-0.10
  • linux-0.11
  • linux-0.12
  • linux-0.95c+
  • linux-0.96c
  • linux-0.97.6
  • linux-0.98.6

All of these are a.out kernels, like things were back in the old days.  You can edit stuff in notepad if you so wish, or any other editor.  A MSYS environment is included, so you can just type in ‘make’ and a kernel can be built, and it also can be tested in the included Qemu.  I’ve updated a few things, first with better environment variables, and only tested on Windows 10.  Although building a standalone linux EXE still requires a bit of work, it isn’t my goal here as this whole thing is instead geared around building kernels from source.  I included bison in this build, so more of GCC is generated on the host.  Not that I think it matters too much, although it ended up being an issue doing DooM on GCC 1.39.

So for people who want to relive the good old bad days of Linux, and want to do so from the comfort of Windows, this is your chance!


Download Ancient Linux on Windows
Download Ancient Linux on Windows

Setting up Windows environment variables for DJGPP (& other GCC based compilers)

DJGPP & other compilers, such as EMX require that you set needed variables with a UNIX style slash convention.  Also it is a pain to hard code the entire path into a command shell.  I know this works on Windows 10, although I’m not sure about earlier versions.

The %cd% variable contains the current directory, so it makes it easy to do something like this:

@echo.
@set tmpdir=%cd%\tmp
@set path=%cd%\bin;%PATH%
@set C_INCLUDE_PATH=%cd%\include
@set _LIBRARY_PATH=%cd%\lib
@echo.
@echo finished.

Which is great, but of course all the paths are MS-DOS style.  There now is the ability to replace strings!

@set _tmpdir=%cd%\tmp
@set tmpdir=%_tmpdir:\=/%
@set _tmpdir=

So in this example I set a temporary variable to the MS-DOS style path, and then using the pattern :(match)=(replace) it will then replace \ with /, giving me the UNIX style path.  I then just set _tmpdir to nothing, unsetting the variable.  So this way I don’t have to hard code any paths, and I can flip the slashes as needed.

Another fun thing is you can do logic blocks..  A simple one if a file doesn’t exist then compile it:

IF NOT EXIST dhyrst. (
echo.
echo Executable missing attempting to compile….
@make -f makefile
echo.
)

I’m sure most people knew about this, but for an old guy used to doing things the hard way, it was nice to see that there finally was some way to do this kind of thing.

Uploaded my cross DJGPP v1 environment to sourceforge

project is here.

I also put up the source for my ‘null doom‘, for anyone who ever needs some massaged source to DooM that will compile with a C compiler, instead of needing something that can understand C++ style comments, although I know in cccp.c there is the ability to turn on cplusplus style processing.  However since I did want something that would compile without altering the compiler (too much) I thought it was best to just change all the comments.

And a quick download link to the zip file with the source & binaries.
Download crossdjgppv1
Download crossdjgppv1

RETROTECHTACULAR: ASCII ART IN THE 19TH CENTURY

I saw this post on hack a day, and oddly enough my old Fortran Snoopy calendar was on there.

And as  a bonus in the comments was a talk on RTTY porn.  Obviously NFSW….  But kind of interesting & funny regarding the preservation of old things.  If the thought of ascii art port from the 1960s, along with some nude pictures from the 1920’s scare you, obviously don’t click.

To me what is crazy is that I can download an entire GIF CD faster today than I could download an image back when this stuff was new and exciting.  But I did have a 2400 baud modem.

Null DooM, GCC 1.39, GO32 and DPMI


phew.

DooM via DJGPP v1 GO32

Around the time of the x68000 port of DooM, I was cutting down the DooM source for a null/portable version.  I never could get it to actually run either using EMX or  DJGPP 1.03, as I couldn’t get it to link to save my life with a constant never ending battle of unresolved symbols. After a while I just used what I had towards the x68000 version and concentrated on getting it up and running, and just shelved the null/portable effort.

Later on I wanted to get it running again as part of messing with another cross compiler, as DooM isn’t a trivial application to port and verify correct operation. And in the process of trying to get the null version to build and run on Windows using TDM GCC, I wanted to make sure it at least kept compiling with GCC v1.x.

Once more again I was able to compile individual files but unable to link.  But this time, I just looked at the diffs for binutils, I thought it should be somewhat easy to get hosted on Windows.  Although versions may point to binutils 1.0, I had to use binutils-1.9.tar.gz even though the diffs are against Mar 24 1991, and the source for 1.9 is dated April 17 1991.

My first effort gave me a linker that would happily link, but go32 would either refuse to run the executable, or just crash.  I was going to give up again, but I found mention in another file that DJGPP actually uses the linker from G++, the C++ compiler which was a separate thing in the late ’80s and early’90’s.  This time it worked, and I could link a trivial hello world style application!

Now that I finally had a cross linker actually working, I didn’t want to compile under emulation, so looking at the other diffs, they didn’t look too extensive. I went ahead ,and took DJGPP v1.06 and patched up the compiler & assembler to get a full cross toolchain.  And in no time, I had a null version of DooM running on MS-DOS well at least tested on DOSBox.

This was fun, and all but I didn’t see any easy way to do fun things like hook interrupts so I could get the keyboard & clock like any good MS-DOS program.  DPMI greatly eased this kind of stuff, so looking at the DJGPP history, DJGPP v1 version 1.10 actually adds preliminary DPMI support!  And in the next version, DPMI was much more better supported, however the binary format had changed from a.out to COFF as part of the move to v1.11. I was able to take the memory, and DPMI portions from the final v1.12 libc, and manually build and run them against the v1.06 library / dev tools.

And much to my surprise, it actually worked!  At least having the wrong format didn’t have any effect on how GO32 worked for me.

So feeling lazy, I snagged some of the support code from Maraakate’s revamp of DooM, just to make sure of the timer code, and the keyboard code, and again verified that I can build with the keyboard & timer ISR and I’m able to play the v1.9 shareware & commercial levels fine.  I haven’t done a thing to clean up or update the DooM source itself against all the dozens of bugs and issues with Ultimate DooM, or other games like Chex Quest etc.

I’m sure 99% of people wouldn’t care but you can download it here:

Win32_DJGPPv1_DooM.7z
Download crossdjgppv1

Although I’m using DPMI to drive realtime events, if I looked further at the GO32 v1.06 environments I could either figure out how it operates it’s timer, or modify the extender directly to drive the PIC timer and keyboard as I need.  But overlooking that, the vintage 1991 software is more than capable of running DooM.

DECUS links to ancient GNU software

Digital Equipment Computer Users’ Society (DECUS), used to put out tapes of interesting things to it’s members.  Back when everyone didn’t have an internet connection, or even if they did a high speed one.

I was looking for stuff where I only had a patch, but not the original files.  So it was great for me to not only dig out an ancient sed from the era, but also bison, and gas.  The ancient binutils are great for people who need to manipulate the a.out format, although the later binutils version 2 supports far more formats by virtue of it’s “BFD” or binary file database or as it was known as back then a ‘big fucking deal’

If you have ancient and or obsolete stuff, GNU stuff can fill the void of the often missing vendor development tools.  It’s crazy how many people sold the tools that kept their systems relevant, although needless to say that attitude pretty much solidified the end of their existence..

The good stuff from 1989 to 1993.

http://www.decuslib.com/decus/lt89a/gnusoftware/
http://www.decuslib.com/decus/lt89b2/gnusoftware/
http://www.decuslib.com/decus/lt90a/gnusoftware/
http://www.decuslib.com/decus/lt90b1/gnusoftware/
http://www.decuslib.com/decus/lt91a/gnusoftware/
http://www.decuslib.com/decus/lt91b/gnusoftware/
http://www.decuslib.com/decus/lt93a/gnusoftware/
It’s not complete, but it’s still fantastic!