Thanks Apple!

iPod is disabled

iPod is disabled

I only have to wait 24,153,992 minutes to unlock my iPod!  That is just under 46 years.

So I haven’t used this in a few months, and the battery went flat, but with iOS 9 or whatever this is running it reset to 1970, and now won’t let me even try to unlock it.  Good thing the MacBook Air I sync’d it with is dead too.  I guess that’s 2012 for me.

I just don’t want to hard reset it, so I guess I’ll have to see if there is a root kit/hack to set the clock.

So apparently in OS X packages actually expire

I found this out trying to install XCode 4.2 on OS X 10.6

Failed install preflight: Error Domain=PKInstallErrorDomain Code=102 UserInfo=0x1d9a30 “The package “iPhoneSDKTools.pkg” is untrusted.” Underlying Error=(Error Domain=NSOSStatusErrorDomain Code=-21 47409654 UserInfo=0x1dbe90 “The operation couldn’t be completed. CSSMERR_TP_CERT_EXPIRED”)

CSSMERR_TP_CERT_EXPIRED??

Yep turns out XCode 4.2 (and probably many others) will actually expire.  So turn off the automatic clock sync, and set your time back to before the package was issued (Xcode 4.3, released on February 16, 2012..) and you’ll be good to go.

Installing Xcode 4.3

Installing Xcode 4.2

Shoebill ported to Windows!

Shoebill!

Shoebill!

Good news, as mentioned here, the Shoebill emulator was recently given some much needed SDL love, and ported to Linux.

Well that’s great and all, but the vast majority of people who run anything these days do it with Windows.  So I decided to try to get it to compile with MinGW to see how far I could get.

And the short version is that I got it working!

The long version is that in the first pass there is some SIGUSR2 stuff that is undefined.  And for a good reason, since it won’t work.  So I just commented them out.  The next minor problem was the lack of bzero.  Honestly I don’t know why bzero is missing from MinGW, but who knows why.

Shoebill also processes some internal macros with a perl script that for some reason was dropping in binary values into the source, making GCC mad.  I just commented out a line that was adding in more comments into the header.  This let me compile with a simple pass.

There was some issues reading the ROM file, since the 68000 is a BIG ENDIAN processor, and the 8086 is LITTLE ENDIAN, Shoebill makes extensive use of hotns and hotnl, ntohl, and ntohll.  These can be found in the winsock library, and even better they dont need any winsock initialization, they work right away.  I just have to make sure I include winsock2.h, and link against the winsock library.

However when trying to boot, the checksum was 0x00000000, not the expected value!   Luckily there was an assert to catch that and crash.  This led me to notice that in Linux files are opened in binary mode by default, while on Windows, they are opened in ASCII mode.  A quick change of all the fopen calls, and I was reading the ROM, but now crashing on the disk.

As it turns out newer versions of GCC go all crazy when it comes to structs, and try to automatically align to boundaries for quick access.  Which sound nice, until you try to read in some binary data, and expect things to be in certain locations and find out that your structure is larger than expected, and data is read in the wrong place.

The solution is to force the compiler to leave it alone with

__attribute__ ((__packed__))

HOWEVER as luck would have it, Microsoft apparently packs structures a different way, and you have to either make a macro to do a bunch of work to force it to make the structure 1:1 of what you expect, or use the CFLAG option of

-mno-ms-bitfields

And now MinGW’s GCC will build something along the lines of what it’d build on Linux.

Putting it all together, I amazingly got this!

Shoebill on Windows

Shoebill on Windows

Phew!  So for those interested, here is the source code drop(Use the updated one here!), and here is the binary.

If you ever wanted to see the “OS X” of the 1980’s, now is your chance!

Virtual IIGS for Chrome, Active GS!

It’s a simple pluggin for Chrome, download it and you are good to go.  As a bonus, check out The Lost Treasures of Infocom!

No really!

Besides the disk swapping, it’s pretty cool!

Planetfall!

Planetfall!

 

Qemu 0.12.5 and OS X 10.4.1

Well as the maintainer of the SIMH binaries on sourceforge, I end up needing access to a bunch of different platforms to build some prebuilt binaries for non win32 people out there.

As a direct result, I end up emulating many of the platforms, but for OS X, I have an old PowerPC mac mini that I used to build stuff, but I gave it away last year. Anyways after digging around on various networks, I came across this file, “tiger-x86.tar.bz2” So after copying it to my pc, and doing the bzip2/tar decompress shuffle, I had what looked like a VMWare config for OSX on intel.

So I figured this was as good as any test for the latest build of Qemu. After a bunch of experimenting I worked out this was the best way to start it:

qemu.exe -L pc-bios -m 512 -hda tiger-x86-flat.img -net nic,mdel=rtl8139 -net user -no-acpi -no-reboot -k en-us

Then when the bootloader comes up, I just typed in:

platform=x86pc

Qemu 0.12.5 osx 10.4.1 logon screen

OS X’s logon screen

And away it went!

Now sure it works, but it’s SLOW. VERY Slow. You can remove some TPM extension, and it’ll speed up somewhat, and at least idle like a normal process. After all, I only wanted this setup to build some binaries, not run this like a desktop OS.
To make the bootstring permanent, you just have to open up a termianal window, and edit the file:

/Library/Preferences/SystemConfiguration/com.apple.Boot.plist

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>

<plist version=”1.0″>

<dict>

<key>Kernel</key>

<string>mach_kernel</string>

<key>Kernel Flags</key>

<string>platform=x86pc</string>

<key>Boot Graphics</key>

<string>Yes</string>

</dict>

</plist>

 

Save it, and you’ll be good to go!

For me it was nice that the networking works, so I had an easy way to get source code into the VM, and executables out of the VM. One cool thing about this VM image is that it contains the compiler! I just wonder since it’s super old will it’s exe’s I make run on modern machines…? I don’t have any way to tell, so it may all be in vain.

Even the PPC version of IE works!

Even the PPC version of IE works!

As a test for the heck of it, I downloaded Internet Explorer 5.2 for the PPC version of OSX, and it runs.. It’s too slow to actually use it, although I’ve run it on real intel macs at the apple store, and it FLIES… It’s too bad they killed it IMHO I kind of liked it.

I’m not trying to advocate piracy and all that, but rather show how Qemu can help you run some VMWare disk images, and just how flexible it is.

Apple Lisa Xenix

Wow I’m surprised a few hours googleing about and I got it running….
I found this ‘idle’ emulator (“Incomplete Draft of a Lisa Emulator”
http://sourceforge.net/projects/idle-lisa-emu ), which can infact run Xenix! It also says it can run the uniplus SYSV (so says the readme)..

Searching around I found the following site:
http://unixsadm.blogspot.com/2007/12/xenix-blast-from-past-looking-back-at.html

Whas Xenix 3.0 disk images in the DART format… which as luck would have it idle cannot mount. However I found another lisa emulator, lisaem ( http://www.sunder.net/ ) which has a tool to convert the disks from DART to DC42 (disk copy 4.2). So it was a simple matter of converting the disks

lisafsh-tool.exe “Xenix OS Boot Floppy”
quit

… etc etc… ad nasium…

Then firing up idle, setting the CPU to max speed, and booting up whenver I was going to answer a question I toggled it back to 5Mhz.. otherwise it would take FOREVER to boot… lol like the ‘good old days’.

Once the boot floppy had formatted the 5mb hard disk image, and transfered on reboot I had to tell the bootloader to boot from the profile disk..

pf(0,0)xenix

And away it went. After installing the OS & the C compiler I’m left with 23 blocks free!.. which I guess for a 5mb disk, is pretty cool.. Anyways there are assorted Xenix PDF’s which can be found here:

http://www.tenox.tc/docs/

Namely these two for Apple Lisa Xenix..
http://www.tenox.tc/docs/apple_lisa_xenix_programmers_guide.pdf
http://www.tenox.tc/docs/apple_lisa_xenix_programmers_reference.pdf
It’s amazing that lisa emulators were sort of capable of running Lisa Office System, now they can run the old unix stuff… it’s still impressive.

MacMiNT

MacMint

MacMint

Recently I came across a Power Macintosh 5400/120 at a garage sale for the bargain price of $12! I couldn’t believe my luck, for under $20 I had a fully working computer!

Except that it won’t run OS X 1.0
And it only has 8Mb of ram.

Because of its memory restrictions it can only run Mac OS 7.6

What to do….

MacMINT!

MINT back in the day for AtariST’s was a UNIX like layer that ran on top of TOS (The Atari MS-DOS like OS) and provided basic Unix services. With the program aptly called JET (Just Enough TOS), the Macintosh 68000’s can setup a TOS compatible interrupt vector table, and run TOS procedure emulation to run the MINT binaries under MacOS!

So, it’s UNIX!

Sort of.

First you need to disable Virtual Memory… That’s bad.
Next it doesn’t support TCP/IP so it’s like being on Unix v6. But it’s fun at any rate.

You can find the binaries at my mirror of sra.co.jp here.

It includes gcc 2.5.8, and a somewhat basic environment. It does have lots of potential, but the biggest gripe is that 8Mb of ram just isn’t enough to do any serious compiling, and yes it will crash with virtual memory enabled. Also since it is 68000 programs it is running under emulation.. I have to admit that I am tempted to buy some kind of 68000 based Macintosh to run MacMiNT.

I know this may not be terribly useful to people, but then again someone has to do something fun/weird on a $12 machine. I fully expect to either get a ‘bigger’ 68000 box, or more ram and run something like simh on it. I can only wonder how usable the PDP11 or the Interdata32 are.

And for anyone, like me wants a ‘clear’ program, just because, here is a simple one, just remember to link with -ltermcap.

#include <stdio.h>
#include <stdlib.h>
#include <termcap.h>

void main()

{

char buf[1024];
char buf2[30];
char *ap;
char *clearstr;

ap=buf2;
tgetent(buf,getenv(“TERM”));
clearstr=tgetstr(“cl”,&ap);
fputs(clearstr,stdout);

}