Upgrading Debian 8 to version 9

More so my own use, but this article on linuxconfig.org was a LOT of help.

Basically and with no explanation the steps are :

apt-get update
apt-get upgrade
apt-get dist-upgrade

dpkg -C

apt-mark showhold

cp /etc/apt/sources.list /etc/apt/sources.jessie

sed -i ‘s/jessie/stretch/g’ /etc/apt/sources.list

apt-get update

apt list –upgradable

apt-get upgrade
apt-get dist-upgrade

aptitude search ‘~o’

And that’s it!

I also took the BBR congestion update tip from tipsforchina.com

wget –no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh

And adding the following to /etc/sysctl.conf after the “net.ipv4.tcp_congestion_control = bbr” line.

fs.file-max = 51200
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.core.netdev_max_backlog = 250000
net.core.somaxconn = 4096
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 10000 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_mem = 25600 51200 102400
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_mtu_probing = 1

Platform SDK & DirectX for Visual C++ Express Edition 2005

Visual C++ 2005 Express Edition

So I’m back out, and on my limited machine (I did order something new, but on a group buying thing so it won’t be here for another SIX weeks… but then I’ll be on the road again so if I’m lucky 11 weeks……..) I’m using Visual C++ 2005 Express Edition, which by default includes just enough to compile simple stdio CLI based stuff.  To do anything more complicated you need what is known as the ‘Platform SDK’.  And to match up for the time period I’m using the Windows® Server 2003 SP1 Platform SDK Full Download. And of course various Direct X SDK’s too.

For my benefit (maybe yours too), here is

Instructions to integrate the Platform SDK are here, although I did set this to match the expected paths that were in my setup after installing service pack 1.  However I still had to manually do step 4:

Update the default.js file (found in %VSINSTALLDIR%\VC\VCWizards\AppWiz\Generic\Application\scripts\1033) and change the two lines that read:

LinkTool.AdditionalDependencies = “kernel32.lib $(NoInherit)”;

to:

// LinkTool.AdditionalDependencies = “kernel32.lib $(NoInherit)”;

And I was all set to go.

To make life easier (for me) this is headers & libs for the platform SDK + Direct X 6 & 7, and only 18 megabytes, instead of hundreds to download platform_directx6_7.7z  This has the directories and whatnot where they were expected, although you’ll have to manually add in the Direct X include & library directories, if you want to do anything with Direct X.

From the Tools menu in Visual Studio, select Options. The Options dialog box appears.

From the Options dialog box, expand the Projects and Solutions node and select VC++ Directories. In that section, add the following paths to the appropriate subsection:

Early Direct X SDK’s

I found these while looking for something that it turns out I don’t need. Well wasn’t that great.

Anyways this includes the Direct X aka the Windows 95 Game SDK, which contains a substantial bit more documentation than the prior WING project.

I don’t think these are all that interesting to the vast majority of people, but more so anyone looking at SDK’s from the mid 90’s.

NetHack in your browser via Moxie CPU

I saw this many years ago, but for some reason never finished writing about this. Moxie was a virtual CPU designed to be as simple as possible for the GNU toolchain to target.

Perhaps one of the more interesting things was a port of RTEMS to the Moxie CPU, and a port of Nethack to that architecture. And of course there was a javascript simulator environment allowing me to easily embed it into this post.

Terminal uses canvas

So yes, it’s a virtual CPU, OS & Game, running in java-script and on the page.

More pointless site updates…

Debian 9… time flies.  Also moved from MySQL to MariaDB version: 10.1

Oh and from PHP v5 to PHP v7.

I guess if you can read this, then it’s still working….

Looks like the MariaDB migration had some weird and under-performing defaults.  So I found this my.cnf to at least pick up some new defaults.  I don’t see any my-huge.cnf on this Debian install so yeah…

Finished rebuilding my MS-DOS machine

I managed to score a TEKRAM P6B40-A4X 3 slot ISA mother-board last week, along with a CT-4500 ISA SoundBlaster AWE64 Value Edition at Capital Computer Centre, a second hand computer hardware market in Hong Kong.  I had also scored a cheap Windows 98 machine which I had hoped to use it’s case and peripherals as the basis for this ISA machine.  However that didn’t work out as the floppy drive was not only stuck in the case, but didn’t work.  And it’s CD-ROM drive didn’t work either.  I got the machine for $100 HKD so I really couldn’t complain too much, the memory, disk and P4 board were fine.  So I had to look for a case that had not only external 5 1/4″ bay, which isn’t too hard today, but it’s getting harder and harder as many systems don’t have any optical drives.  The hardest part was finding a case that had an expose 3 1/2″ bay.  After a lot of searching there was only ONE I could find, the DEEPCOOL DUKASE V3.

It was inexpensive enough, costing around $279 HKD, and thankfully had a PC-Speaker, and a bunch of screws.  Gutting out the Windows 98 machine, tossing it’s case, and I put everything in the deep cool case.

The case, installed

Naturally it didn’t work the first time.  I had to download the PDF manual, and do the jumpers over again.  After powering it up, I got the long beep followed by three short beeps.  Turns out my AGP Voodoo 3 wasn’t seated properly, so I re-seat the card and I’m able to DooM from my MS-DOS rig, but now it’s in a case, and not all in the open.

External media, so 1980’s!

The hinge is magnetic, and not too obvious at first.  But it does the job, and hides the ancient removable disks.

my horrible cabling

One thing of note, for a board this old, it required the old 40 pin IDE cables.  I found mine in a junk bin for $10 HKD each.  Not bad, but I literally only saw two.  I had a much easier time finding a NIB PS/2 Mouse & Keyboard.

close-up of the sound card

Like all terrible RGB builds, this case has a plastic window so you can gawk at the cards.  I don’t know who does this, but I guess it’s a thing.

I installed Windows 95, from floppies, and then downloaded the AWE Value drivers from vogons, and a Voodoo 3 driver from driverguide of all places… If you need it, beware of their ads that either want to install some spyware crap, or their insane games to get to the actual driver.  But I did get it to work.

40 pin IDE ribbon vs an 80 pin IDE ribbon cable.

The CPU is a Pentium III running at 450Mhz with 512MB of RAM.  It’s the at the edge of what Windows 95 can support without any modifications.  I may later on want a better sound card, I know I need to find the MIDI cable to hook up my Roland or Yamaha MIDI synthesizers up.  If you want to get into the retro PC thing with physical hardware (Don’t get me wrong, PCem is freaking amazing!), the longer you wait the harder it’s going to be to find things like 40 pin IDE cables.  Let alone ISA motherboards that are not hundreds of dollars.

I had originally 80 pin IDE cables out of the Windows 98 machine, however I never pulled them off to notice that the 80 pin standard are keyed.  This means that one of the pins are blocked off so you cannot put the ribbon in backwards.  This means that if I wanted to no clip pins off the motherboard, I would need to find original 40 pin IDE cables.  I got lucky again, another visit to Capital Computer Center, and I was in business.

Quad core by Singular Crew / C64 demo

One of the coolest Commodore demos in some time.  Featuring quad Commodore 64’s.

Some details: This is the party version, rendered with VICE. AVSEdit Plus and VirtualDub used to merge videos. Unfortunately we had no four projectors to show it realtime. An idea to start: use rod or board to press space same time.

Credits:
Main code: Scorpy.
Zoomer part and some bugfix by Soci.
12 channel music: Vincenzo
Four screen picture: Leon
Rotator logo and some grafic artwork: Poison.

Note: The rotating logo in the last part originally designed to an Amiga demo 10 years ago which never finished.

I have to say, it not only looks great, but sounds great! Obviously we didn’t need the C65, we just needed a cluster of C64s.

Fashion over form aka the lofree keyboard

So as part of the fun for being on the road at the moment, my “disposable” cheap laptop took a dive just after the NS32032 article.  I’m in a town that has a remarkable manufacturing base, however there is nowhere to get anything even slightly computer related.

But no problem you say, we live in the future, and the future is internet delivery.  While there is no Amazon delivery in China, I went ahead and ordered a bluetooth keyboard and mouse on TaoBao for my existing Windows 10 tablet making it into a quick desktop.  I’ve already used Microsoft ARC mice before, but the bluetooth model is great.  Snap to configure, and it’s a real pleasure to use.  The head is more pressure sensitive, like something Apple would have made, making scrolling a breeze.

But that isn’t what we are here for…

So, having to buy a keyboard sight un-seen, I knew I would have to probably go past the super cheap discount stuff that is labeled bluetooth, but probably isn’t, and look at the higher end stuff.  And that is when this thing caught my eye:

Keyboard

The keyboard set me back 599 RMB, which isn’t too bad, and I have to say I had high hopes for this keyboard.  Yuantong Express thought it was OK to just leave it in the building next to where I’m staying, and didn’t bother to notify me, as it should be somehow obvious.  Although they were fast to deliver, not knowing for 2 days that they had delivered kind of sucked.

Looking at the box, I couldn’t tell if it was some artistic minimalist design, or if this was aiming for something higher end.

Opening the box, and taking out the Styrofoam cover reveals the keyboard in one of those soft plastic bags with a quick start guide, and an accessories box.

tThis is the enclosed USB charging cable.  The keyboard itself boasts of a 4000 mAh battery.  I would hope it would last a long time, however I do enjoy the back-lighting so I’m sure that greatly reduces the longevity.

The keyboard itself feels really solidly constructed.  It doesn’t suffer from being made out of weak or inferior plastic.  The keys feel nice to the touch, kind of reminding me of the older Italian keyboards with their nice rounded and indented keys that fit nice on your fingertips.   The backlight makes looking at it, and looking for keys pretty easy to spot.. which brings me to the bad spot.

Being a reduced form-factor keyboard, this isn’t built as something you can just pick up and touch-type with ease.  While I do know how to touch type, the big gotchas are the right shit being incredibly small, and the number row is literally one off.  I find myself drifting to the up arrow half of the time I want to shift, and always a number off.  It can be a bit irritating, but the keyboard looks so nice it’s almost forgivable.

I would worry about shoving this thing into a bag, and traveling with it, as the keys sit high, and I’d hate to break it.

When I started to write this, I went to look it iup, and it turns out it was actually on indiegogo.com.  Interestingly enough that means I paid $90 for this keyboard, that is currently $125+shipping.  Although me being in China means I win out in shipping.

In all it’s not the worst keyboard I’ve used, and will end up taking a little getting used to.  But when compared to something like the Microsoft Surface Pro type cover, this is about a billion times better.

As a bonus they threw in a simple tablet stand.  I’d overlooked the need for one, so having it included with the keyboard was a nice bonus.

For anyone who cares, this is where I bought it.

Jerry Pournelle RIP (1933-2017)

I had just heard the news that Jerry had passed away.  While famous for his scifi writing, his work for the military and pushing ‘smart weapons’, getting kicked off the ARPANET for wrong think, and of course being the first person to use a word processor to write a book and get it published.

He was also known as quite the tinkerer and getting the luck of having people send him stuff to play with, and he’d write about it in his column on Byte back in the day (starting in 1984!), and you can find his full BYTE credentials here.

Although at the time I had thought of it as very chaotic, all over the place, and full of, well just simple bonehead mistakes, in retrospect Jerry’s chaos had a tremendous impact on me, and in some unconscious way I had inadvertently followed in his style through virtualization.  And I can say that although some things are pretty obvious in hind sight, when you are in the middle of it, some bad things seem like good ideas!!  Although the price for ‘bricking’ a virtual machine is a lot lower, and the ability to quickly go back and forth, and experiment more pretty much consequence free is definitely a plus!

He, along with John C Dvorak were frequent guests on TWiT, with I think his last appearance in 2015, which I have to say I had always admired their cantankerous old man style.  One that I find myself increasingly take on with age.

From Jerry’s son Alex:

I’m afraid that Jerry passed away.
We had a great time at DragonCon.
He did not suffer.

(8 Sep 2017 – 3:45pm PDT)

He was 84

Definicon DSI-32 co-processor emulation

Definicon DSI-32 coprocessor card

Well this is a little interesting thing.  Back in the 1980’s people were increasingly frustrated with the limitations of the 8086 processor in their IBM PC/XT computers, and wanted a way to get the latest & greatest 16 bit, and 32bit processors.  One such hot processor was the  National Semiconductor NS32032.

Enter the Definicon DSI-32 co-processor card.  It’s a simple 8bit ISA card containing the NS32032 processor, some memory an sockets for both a math co-processor, and a MMU.  The NS32032 is also somewhat infamous as being rather ‘VAX like’, and being difficult for compilers of the era to properly optimize for.  As mentioned in Michael Tiemann’s interview in the O’Riley book Open Sources .

The real bombshell came in June of 1987, when Stallman released the GNU C Compiler (GCC) Version 1.0. I downloaded it immediately, and I used all the tricks I’d read about in the Emacs and GDB manuals to quickly learn its 110,000 lines of code. Stallman’s compiler supported two platforms in its first release: the venerable VAX and the new Sun3 workstation. It handily generated better code on these platforms than the respective vendors’ compilers could muster. In two weeks, I had ported GCC to a new microprocessor (the 32032 from National Semiconductor), and the resulting port was 20% faster than the proprietary compiler supplied by National. With another two weeks of hacking, I had raised the delta to 40%. (It was often said that the reason the National chip faded from existence was because it was supposed to be a 1 MIPS chip, to compete with Motorola’s 68020, but when it was released, it only clocked .75 MIPS on application benchmarks. Note that 140% * 0.75 MIPS = 1.05 MIPS. How much did poor compiler technology cost National?) 

Such was the fate of the NS32032.  Getting back to the Definicon card, it has no real IO of it’s own, instead it relies on being able to copy memory in and out of a window to program the CPU, much like how LIM EMS stores more than 64kb onto a card.  MS-DOS provides all the I/O operations though a simple software interrupt driven system, allowing the host to open and read files, tell the time, and even simple EGA graphics.

Unfortunately, the window of interest in these types of boards waned pretty quick, so the only development tools available are the original Green Hills Software packages, along with a simple PD (no sources) LISP & FORTH interpreter.  The board has support for C, Assembly, Fortran and Pascal.  Naturally the user is expected to invoke each component of the tool chain manually, as was the case for many micro hosted tools of the day.  What is kind of interesting is that the environment isn’t a strict 8086 MS-DOS based cross compiler, rather the tools run on the NS32032 co-processor allowing seemingly large programs to run on machines from the early 1980s.

In addition to PC ISA boards, the NS32032 was popular as a secondary processor for various machines, including the 6502 based Acorn.

BBC Second Processor NS32032

This module could plug into the back of the Acorn, and then much like the Definicon DSI-32, let Acorn users run full 32bit program on their 8bit machines.  There has been an ongoing effort to emulate the Second Processor in a FPGA.  Flipping that on it’s head, a NS32032 emulator was found, and using a FPGA Acorn, the second processor was then emulated on a raspberry pi, using a C based emulator for the NS32032.

FPGA Acorn with raspberry pi second processor

Taking that CPU core, and finding the source code to the load program allowed for a 32bit Linux or Windows based load program to feed the C CPU core emulator.  I made some minor tweeks regarding it’s handling of files, and have a version that runs on Windows.

Series 32000 Emulator 4Mb Version 1.0b(MinGW32) of 8 Sep 2017
C-32000 1.6.12 Copyright(c)1985 Green Hills Software, Inc.
Series 32000 Emulator 4Mb Version 1.0b(MinGW32) of 8 Sep 2017
CSD-32000 Assembler V1.00a, Computer Systems Design
Pass 1 in progress
Pass 2 in progress
Pass 3 in progress
0 Assembly error(s) detected.
Series 32000 Emulator 4Mb Version 1.0b(MinGW32) of 8 Sep 2017
DSI-32000 Linker V1.03c, Definicon Systems Inc
@ FILE=LIB\CMAIN
@ LIBRARY=LIB\CLIB
@ NOCOMM
@ MOD=80
@ MODULE=CLIB/CODE_START=3600,NOCOPY
@ MODULE=CLIB/LINK_START=35E0,NOCOPY
@ MODULE=CRTLIB.C/CODE_START=4000,NOCOPY
@ MODULE=CRTLIB.C/LINK_START=7500,NOCOPY
@ MODULE=CRTLIB.C/SB_START=7000,NOCOPY
@ STACK=+40
@ CODE=A000
@ RAM=0..FFFFF
Series 32000 Emulator 4Mb Version 1.0b(MinGW32) of 8 Sep 2017
Dhrystone(1.1) time for 50000 passes = 1
This machine benchmarks at 50000 dhrystones/second

I was unable to get either the Pascal  or Fortran compilers to generate output that the assembler liked, however the C compiler works.  Other ISA NS32032 cards include the Opus, which could be configured to run SYSV unix!

For a while, these types of second processor cards were quite common, even being used as upgrade cards, like the Microsoft Mach-20, or giving access to a completly different CPU/OS combination like the CP/M z80 card for the Commodore 64, to the incredible Amiga BridgeBoard.

One thing to keep in mind is that the DSI-32 board came out in 1985.  The GNU project wouldn’t launch in earnest until 1988, which may not seem like that big of a window but in reality it really is.  3 years is a substantial time in the industry.  And like many things GNU in the 1980’s it was focused on bigger minicomputers like the SUN-2/SUN-3, VAX etc, not common machines like the Apple Macintosh, Commodore Amiga, Atari ST, although it’s 68000 was common subset of the 68010 in the SUN-2 and 68020 of the SUN-3.  Even the 32-bit giant of them all, the 80386 didn’t begin to get support until GCC 1.23 (the summer of 1988.  Early GCC had incredibly rapid progress).  But by the late 1980’s people with NS32032’s were using them in full systems, they weren’t the typical ‘brain in a jar’ type users that had these fancy CPU co-processor cards.

I did built a copy of GCC 1.39 & GAS 1.38 for the NS32K, although since it’s unable to link in any format the DSI-32 would understand it did seem kind of pointless.  The assembler syntax is quite different.  Perhaps if it were the 1980’s something like the x68000 port of GCC which modified GCC to use a syntax that the platform’s native assembler & linker were comfortable with.

Using the 1987 Infocom Interpreter source code, I was able to cross compile it to the NS32k.

Series 32000 Emulator 4Mb Version 1.0b(MinGW32) of 8 Sep 2017
DSI-32000 Linker V1.03c, Definicon Systems Inc
@ FILE=LIB\CMAIN
@ LIBRARY=LIB\CLIB
@ NOCOMM
@ MOD=80
@ MODULE=CLIB/CODE_START=3600,NOCOPY
@ MODULE=CLIB/LINK_START=35E0,NOCOPY
@ MODULE=CRTLIB.C/CODE_START=4000,NOCOPY
@ MODULE=CRTLIB.C/LINK_START=7500,NOCOPY
@ MODULE=CRTLIB.C/SB_START=7000,NOCOPY
@ STACK=+40
@ CODE=A000
@ RAM=0..FFFFF

C:\dsi\set021387>emu.exe infocom -a planetfa-37.z3
Series 32000 Emulator 4Mb Version 1.0b(MinGW32) of 8 Sep 2017
PLANETFALL
Infocom interactive fiction – a science fiction story
Copyright (c) 1983 by Infocom, Inc. All rights reserved.
PLANETFALL is a trademark of Infocom, Inc.
Release 37 / Serial number 851003

Another routine day of drudgery aboard the Stellar Patrol Ship Feinstein. This
morning’s assignment for a certain lowly Ensign Seventh Class: scrubbing the
filthy metal deck at the port end of Level Nine. With your Patrol-issue
self-contained multi-purpose all-weather scrub brush you shine the floor with a
diligence born of the knowledge that at any moment dreaded Ensign First Class
Blather, the bane of your shipboard existence, could appear.

Deck Nine
This is a featureless corridor similar to every other corridor on the ship. It
curves away to starboard, and a gangway leads up. To port is the entrance to
one of the ship’s primary escape pods. The pod bulkhead is closed.

Deck Nine Score: 0/4451
>

Although the The DSI-32 was followd up by 68020 based DSI-780, which was nearly three times faster.  As with the Amiga Bridge board, and cards like the SunPCi, these types of cards became more and more of an addon to run IBM PC software, and less about trying out new and exciting processors.  But now thanks to emulation you can try them all out without any additional messy hardware.

Anyone who cares, my dump of what I found and messed around with is here:

ns32032_dsi-32.7z

Great resources can be found:

Thanks to Alexander Voropay for giving me some heads up & materials for this interesting side trek!