Cross compiling SDL 1.2.15 for ARM Win32

I was getting this fun error:

C:\proj\ss\SDL-1.2.15\VisualC\SDL>link /dll -out:sdl.dll *.obj winmm.lib dxguid.lib gdi32.lib user32.lib advapi32.lib dxguid.lib uuid.lib dxguid.lib Version.res
Microsoft (R) Incremental Linker Version 14.24.28315.0
Copyright (C) Microsoft Corporation. All rights reserved.

Creating library sdl.lib and object sdl.exp
SDL_dx5events.obj : error LNK2001: unresolved external symbol GUID_SysMouse
SDL_dx5events.obj : error LNK2001: unresolved external symbol GUID_SysKeyboard
SDL_dx5events.obj : error LNK2019: unresolved external symbol IID_IDirectInputDevice2A referenced in function DX5_DInputInit
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_XAxis
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_YAxis
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_ZAxis
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_RxAxis
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_RyAxis
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_RzAxis
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_Slider
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_Key
SDL_dx5video.obj : error LNK2001: unresolved external symbol GUID_POV
sdl.dll : fatal error LNK1120: 12 unresolved externals

Which was NOT easy to track down. Thankfully while amputating and chasing the origin of GUID_Key, I ran across this: cboard.cprogramming.com

I have read various texts that state you must
Code:?

1#define INITGUID

And yes, you do!

In the file SDL-1.2.15\src\video\windx5\directx.h I just added it to the top, and now it’ll build the hacky DLL!

Maybe it’s something for Visual C++ version 19? I don’t know.

Anyway the advantage is now I have full audio for DosBOX!

Luckily updating binaries wasn’t too hard.

Living with ARM for a week

So after the crazed purchase I made a few weeks ago, I returned from Japan, and was able to unbox and use the machine I’d been wanting for a while, a non x86 Windows laptop!

The NovaGo has a Snapdragon 835, and my phone, the ASUS ROG phone has the 845. Yes for this week, my cellphone actually has the stronger processor than my computer. Honestly this is almost an unthinkable situation! Although I haven’t been using my phone as a desktop substitute this week. It’s amazing how MS screwed up 10 on the phones, and Continium.

By default it comes crippled with this ‘S’ mode Windows, which hearkens back to the Windows RT launch, with the difference that it’s a quick trip to the application store to unlock Windows 10 Professional. It’s a free download as it should be, and it doesn’t even require a reboot!

Build quality isn’t so bad, the screen folds all the way back to make the machine into a ‘tablet’ although I don’t like that mode so much, it just feels wrong to wrap a keyboard around a monitor. However if you have rambunctious young kids, it’s great as when someone went running by me flailing their arms around like a while animal, when they struck the laptop the screen could easily fold back 180 degrees. Yay.

My first thing to do after setting up Office and VMWare VDI was to install the Linux subsystem, and Ubuntu. it’s exactly the same as it is on x86_64, which is great. And this let’s me have the best of both worlds, just like x86_64. As much as I dislike stumbling around with that aborted child of Pascal & Fortran (Python) at least I can run it under (mostly) Linux to get something close to like the production environment.

The C/C++ compiler is actually all cross tools. I wanted CLI only stuff because I like torturing myself, and it required a few GB of downloads. The good news is that the latest Windows 10 SDK does support GDI/CLI apps, so no crazy SDK hacking required, unlike back in the Windows RT days. Oddly enough the Taskforce 87 interpreter runs fine, but nothing else does.

I did a horrible job at hacking up SDL 1.2 to at least run (kind of, the audio doesn’t work, and it’s all WinDB *EDIT I got it fixed!!!) I got a few things up and running, including DOSBox and FrontVM. One thing that greatly helps is that i386 binaries ‘just work’. Honestly you wouldn’t even know you are running them when you are. Which made hunting down the ARM64 version of Chromium Edge kind of difficult to find. There really needs to be a more apparent way to tell them apart, if anything for battery efficiency.

As pictured, SQL Server 4.21a runs just fine, again you wouldn’t even notice. Same for Visual C++ 1.0 & FORTRAN PowerStation 1.0.

Again the audio in my crap SDL build doesn’t work, so DOSBox is silent, and without Direct X, the text mode is tiny. Oh also, there is no OpenGL in this version of Windows dev kit for some reason. Running ssystem is ungodly slow. Also the default optimizations seems to be Os, optimize for space, and on this ASUS I have to say /Ox is way way faster. DooM is quite playable on DOSBox when build with /Ox, unlike /Os.

For me, I spend most of my day to day in Office, and VMWare VDI, connecting to secure networks. So I’m just one step above a terminal. Which I guess is kind of sad, but this machine more than fills that roll for me. The 120GB of storage is tight. This isn’t a development machine persay, nor is it something to download tonnes of data to, it’s a lightweight machine where it’s strength is the built in 4G modem, and when running ARM software the longer battery life. To me the biggest drawback is that the keyboard isn’t backlit. Even though I touch type, I didn’t realize how much I’d grown used to it for casual use.

I guess it’s a hard toss up from this and a PINEBOOK Pro, I think most readers here would prefer the Pinebook, for all it’s openness, although I still like the idea of being able to copy over the Win32s version of Lemmings, and it just running. For me I kind of like this thing, although once I switch back to an x86_64 with more memory, better GPU and disk options, maybe this just feels like some kids toy.

Neko98 ARM!

I don’t know how I didn’t think of this, but I also ported Neko98! Although the STL is having an issue with the ‘control panel’ so Neko is on autopilot.

This app can’t run on your PC

As for the emulation, it is 32bit only, so expect to see this stupid message quite a bit. The neckbeard is a nice touch though.

Also built into the thing is a cell modem. I guess it’s really not a surprise as the 835 really is a cellphone SOC. I have a ‘wifi egg’ as they are called here, a WiFi hotspot with unlimited internet from CLS, which is on the old 4G network. I popped the SIM in, and it picked up the APN settings on it’s own and I was connected in under a minute. I have to say that it’s about time that SIM cards have this stuff programmed into them for a plug & play experience. And thankfully the ASUS is unlocked, although from what I understand these were sold in the USA bundled with some cell service plans.

For anyone with one of these rare machines that cares to play along you can find my built stuff on my ‘vpsland’ archive:

https://vpsland.superglobalmegacorp.com/install/Windows10-ARM/

And the f2c/dungeon build along with the C/C++ compiler is in the aptly named dungeon-2.5.6-ARM(32bit)-win32.zip file.

Just made a drunk purchase… Not too mad

NovaGo!!

I’ve been a hidden long time fan of non x86 NT, I’ve owned Alphas and PowerPC (still sadly no MIPS), and when it came to the arm platform, ive since picked up the Surface RT and the Surface 2 RT. YouTube works fine on both, although the 2 is far faster and overall nicer user experience. I use the 1st Gen as a winamp player as it’s easier to jailbreak and cross compile to and mess with. But locked down Windows 8.0 for arm is insanely limited.

Enter Windows 10 and another botched shot at Windows on ARM for the general consumer. These ship with a S limited version of windows, which apparently can be easily unlocked to full 10 pro. I chose the Asus as it’s a laptop, and has more ram than the HP. Both however should be enough for casual day to day usage of office and edge chromium. I’ll have to see how it goes for either cross or native compiling.

Although the arm in these machines is 64bit, is there 32bit user land at all? Is it still possible to maintain a 32bit userland of gcc 1/2 and binutils for legacy compiles? How terrible is x86 qemu on arm emulation? DOSBox native? I guess SDL should be a simple rebuild like NT MIPS?

I’m also curious about WineVDM and MS-DOS player.

Oh well, I’m just waiting for a flight in the airport, going slowly insane.

UPDATE on the ASUS here:

My conclusion is really that the biggest problems with the physical machine is the lack of a backlit keyboard, and the tiny storage. Windows on ARM feels like a solution looking for a problem, but the obtuse problem is non x86 diversity. And in those regards it’s pretty much working fine.

But looking forward to a non x86 usable machine. I even have an unlimited chip for Hong Kong. It’ll be interesting if it can keep up for me, and if I’ve finally hit Ted Smith FORTRAN Maximum usage. Although this has no floppy drives.

WindEmu

AKA 16 shades of gray by Ninji. I was given a link to this fine project by ‘w‘ and I thought that emulation was a great way to get 2020 off to a start. And wow what a project.

I have to say I’m pretty amazed how they took an essentially dead platform, and very quickly was able to take an unknown ROM, and parse it enough to glue it to a CPU emulator and get it booting. And in 3 days!

Even better, is the emscripten version, where you can boot it from your browser! no really!

https://wuffs.org/WindEmu/index.html

Back in the 90’s I saw the crash of the much lofted Newton, and I remember seeing devices like this, and the reprise of geoworks, but they all seemed like such cut down toys. For me, the first killer one, was the Windows CE devices that had PcAnywhere. As now I could actually have a ‘palm top’ with a modem, and dialup into work, and remote control the server infrastructure. I didn’t need a laptop, just a tiny bag, for a machine that I could drive with 2 AA batteries. Although I think Windows CE will go down as the biggest mistake Microsoft had, as it left them complacent in the smart phone space, and their massive market domination was utterly destroyed by iOS & Android. And who thinks Microsoft is relevant today, or a threatening monopoly like they were in the 90’s?

The Psion is an interesting ‘forward’ thinking machine, in that it’s ARM powered, has a Compact Flash slot, RS-232, and infared!.. A perfect mobile machine for the late 90’s. Although combining this with a cellphone would prove too much for far too many of these upstarts, it really was Apple’s brilliant move with the Motorola E398/ROKR that by partnering with a handset manufacturer they could learn all the ropes of bringing a handset to market and then bring along the massive disruption in the industry that is the iPhone.

But before the iPhone, tiny embedded OS’s on tiny RISC processors was the general path save for the few x86/Geos devices. While it was ‘neat’ it really was a dark age of portable machines. So close, yet so far away.

WindEmu is pretty amazing, at the least totally check it out in your browser!

And check out Ninji’s blog as well!

GXemul for Win32

Luna m88k booted off RAM disk

Don’t get all to excited, it’s a terrible port, but it’s to the point where it can barely run stuff. Although I don’t know how much is me, and how much is GXemul. I probably should have tested on Linux first.

Anyways it’s enough to boot the Luna m88k OpenBSD ram disk up to the single user mode, and poke around. The hard disk doesn’t pick up, and I haven’t even tried the NIC, although the address is looking pretty bogus.

I wanted to try the PMAX version of Mach, but then it hit me, that there is no server to load. And porting the system level from Mach 3.0 to 2.5 looks way more involved than Mach 3.0 being ‘something minor’.

Back on the 88k front, the Luna shipped with something called UniOS-Mach, but good luck finding that in this day & age. I guess I’ll have to go back to Japan.

For the crazy among us, go ahead and try gxemul-0.6.2-ultra-primative.zip The name says just how stable it is.

In the meantime here is a super low resolution capture of the screensaver from a Luna via http://www.nk-home.net/~aoyama/luna88k/

As an update, I added in the timer code from PCemu, and now that the timers appear to be firing some stuff like OS/F 1.0 get’s further!

OS/F 1.0 in single user mode

I need to go through the setup stuff a lot better as this is just untar’d and not setup at all. Not that it’s useful, but here, osf1-barely.7z .

So if anyone downloaded gxemul prior to this update, re-download it again! I put the m88k ramdisk kernel in there too so you can quickly test the Luna 88k emulation.

Proot, defeating security by ignoring it in user-space

From the proot project site :

PRoot is a user-space implementation of chroot, mount –bind, and binfmt_misc.

Android among other Linux systems creates a very restricted user mode where the end user is denied the root user privileges. This is annoying as to ‘root’ a phone can be incredibly complicated l, and beyond a normal user that wants to use their phone for more than some kind of cat video social machine (don’t tell me the incredible popularity of cat videos isn’t toxoplasmosis!).

Many new phone SOC’s are supporting external HDMI, and USB host capabilities allowing you to dock your phone and use it with a keyboard and mouse.

Well thanks to the app, aptly named UserLand, running a light weight Linux distro is just a few screen presses away!

What is cool is that by emulating a scant few system calls it makes the deployment quick and seemingly trivial. And a lot more lightweight compared to docker, User Mode Linux, or Qemu (in full system emulation). But it can invoke qemu to run foreign architecture binaries to give Intel users an Arm UserLand.

Yes, via VNC you can run X11! And yes on my phone it shows all 8 Cores.

Although I’ve been using qemu, UML and other strategies to sidestep restrictive environments, proot proves itself as an exciting new tool!

So I was building a Windows 2019 server

As I got a ‘totally legit’ serial code in my box of cereal.

After the install I thought it’d be fun to install the Linux Subsystem.

While following the powershell instructions here, I thought the list of quick links of distros to download was interesting:

That’s right ARM Linux userland! I still have high hopes for Windows on ARM (I have 2 Windows RT devices now!!) although I’m not holding my breath.

Maybe there will be some ARM boards that are suitable for the desktop that aren’t over 1k USD.. That’d be nice.

Interesting trivia is that the Linux Subsystem started it’s life on ARM as a way to run Android binaries on Windows Phone. And true to everything Microsoft does, it got to the point where it could start to run things (albeit poorly) and was summarily killed. Although it’s found life despite the original false start as a general ‘text mode’ subsystem for Windows.

However running Linux binaries on Windows currently just shows that NTOS isn’t as efficient as the Linux kernel when it comes to emulating the Linux ABI. Although this was the original ‘dream’ of the microkernel, and a POSIX subsystem for NT was always part of the original design, although it really was more of a checkbox for GSA contracts, and outside of being able to use pax & vi it really was handicapped by not having BSD extensions, and especially by not having any access to the TCP/IP stack.

EDIT*

I should add these notes from the future past for the future me, when messing around with Windows Server 2019 build 1809 when they finally brought the Linux Subsystem into the fold. Unpacking the distribution and running the ‘setup’ sets it up DIRECTLY into that directory. So put it where you want it.

When you mess that up, you have to use the wslconfig program!

Of note is:

wslconfig /list /all
Lists all distributions, including ones that aren’t currently usable. They may be in the process of installing, uninstalling, or are in a broken state.

wslconfig /unregister <DistributionName>
Unregisters the distribution from WSL so it can be reinstalled or cleaned up.

This way you can now clean up your mess, and get Linux installed right.

win86emu: the greatest thing for Windows RT that Microsoft should have made.

While I’m writing this, I’m listening to Neuromancer via WinAmp & the ancient Speex plugin I had updated about 8 years ago.

x86 node running on Windows RT

I took my Surface, and downgraded it to the North American 8.0 version without updates, added my MS ID, and from there ran the jailbreak and win86emu (sometimes called x86node) and from there I was able to run some simple Win32 exe’s.

Even though I had done a simple cut down QuakeWorld port with the GDI only display, using win86emu it’ll run the 80386 build as well.  while I haven’t thrown much at it, I’m just amazed that so far things are working.

When you think that between the jail-break to unlock the ability to run programs combined with a CPU translator, and Win32 to Win32 thunk / translation program, why on earth did this thing ship without it?  It’s amazing that between trying to launch a platform with no inertial for applications after Android &  Apple were selling millions of hardware units, and billions of software units, and cutting the past applications.  It’s just crazy.

And then Microsoft did their normal thing when something goes wrong, which is basically end it, and destroy all evidence it existed.  There is no Windows 10 upgrade for the Surface, even though Windows 10 IOT has been hacked to run from a USB stick on the Surface, but it’s insanely slow.

I figured since this is kind of hard to find I’ll just mirror it on Source Forge… along with the source.

So while out today I found a Windows RT Surface for $25

I had to pay another $15 for the charger.  I should have run away, but I’m a sucker.

Yes, there are basically NO apps, but thanks to this little guide

QuakeWorld on Windows RT

I was able to port over some trivial stuff, the usual things like hello world, Infocom Interpreter, a f2c build of Dungeon, then I went with something I’d been messing around an old GDI driver for WinQuake that builds with the NT 3.5 SDK (finally got it!).  So with a few minor tweeks here it is cross compiled from my x86_64 to the surface.

Last time I talked about the Surface was nearly 6 years ago…  The platform’s fate was pretty much sealed on day one.  With no open Win32 API it shunned traditional devs, and with some completely new and insane model it was such a hurdle for new devs, why put so much effort into such an old tired company like Microsoft?

I figured for the price of a good lunch it’d be a fun toy.

Too bad the speakers don’t work though.

I know the window on Windows 8.1 apps is closing soon.  I should put something together for the dead platform.  Maybe for phone too.  But for tonight, it was kinda fun doing a copy/paste attack to then run unsigned EXE’s on the device.

I might upload the tool chain later, but at the moment getting Visual Studio 2012 Ultimate is a breeze.

Virtualization Challenge III – Acorn ARM Minix

(This is a guest post from Antoni Sawicki aka Tenox)

Recently came across this unfinished port of Minix 1.5 to Acorn Archimedes A310. According to the readme file this is a set of patches that needs to be applied on a standard Minix 1.5.10 code base on a Unix machine. The code then needs to be to transferred to Risc OS machine for compilation. Once complete then you need to manually create boot records and a file system. Sounds like a fun little project.

What I want is pretty standard:

  • A ready to use working disk image that anyone can unpack and run on a modern machine under an emulator of your choice (commercial OK).
  • Aclock binary and screenshot.

First person to deliver these gets a prize of £100 (that is 100 GBP / Pound Sterling). I strongly encourage to coordinate your efforts via comments.

If needed I can supply licenses for commercial Acorn emulators and C compiler for Risc OS, albeit I only have license for a modern ROOL DDE. I hope ancient version is not needed, but this part of the challenge. Note that I can’t just give away the licenses to anyone, I will only share or purchase new licenses for serious contenders on one to one basis.

Let the challenge begin!