It’s just been really busy with this move, unpacking and the usual losing things, finding things and breaking things.
In the middle of it all, I found something online, that I want to at least do some proper article thing about… As it’s been really exciting, and goes back to the first month I started this blog.
Outside of NeXTSTEP, the other i386 commercial version of Mach 2.5 surfaced, the Mt Xinu version!
Even better, a few years ago, I had stumbled onto the source code for 2.5 buried on the 4th disc of the CSRG set, and with a LOT of luck and persistence I can confirm that the sources are complete enough to build.
loading vmunix.sys rearranging symbols text data bss dec hex 389088 45564 101364 536016 82dd0 ln vmunix.sys vmunix; ln vmunix vmunix.I386x.STD+WS-afs-nfs
However, as luck always has it, start.s in the i386 code does something weird at the 3GB mark causing a triple fault on any kind of modern emulation/virtualization setup.
/ Fix up the 1st, 3 giga and last entries in the page directory mov $EXT(kpde), %ebx and $MASK, %ebx mov $EXT(kpte), %eax and $0xffff000, %eax or $0x1, %eax mov %eax, (%ebx) mov %eax, 3072(%ebx) / 3 giga -- C0000000 mov $EXT(kpde), %edx and $MASK, %edx
Not all that sure why, but at least on Bochs, I can see the triple fault.
00036527018d[CPU0 ] page walk for address 0x0000000000101122 00036527018d[CPU0 ] page walk for address 0x00000000e0000011 00036527018d[CPU0 ] PDE: entry not present 00036527018d[CPU0 ] page fault for address 00000000e0000011 @ 0000000000101124 00036527018d[CPU0 ] exception(0x0e): error_code=0002 00036527018d[CPU0 ] interrupt(): vector = 0e, TYPE = 3, EXT = 1 00036527018d[CPU0 ] page walk for address 0x00000000c0161370 00036527018d[CPU0 ] PDE: entry not present 00036527018d[CPU0 ] page fault for address 00000000c0161370 @ 0000000000101122 00036527018d[CPU0 ] exception(0x0e): error_code=0000 00036527018d[CPU0 ] exception(0x08): error_code=0000 00036527018d[CPU0 ] interrupt(): vector = 08, TYPE = 3, EXT = 1 00036527018d[CPU0 ] page walk for address 0x00000000c0161340 00036527018d[CPU0 ] PDE: entry not present 00036527018d[CPU0 ] page fault for address 00000000c0161340 @ 0000000000101122 00036527018d[CPU0 ] exception(0x0e): error_code=0000 00036527018i[CPU0 ] CPU is in protected mode (active) 00036527018i[CPU0 ] CS.mode = 32 bit 00036527018i[CPU0 ] SS.mode = 32 bit 00036527018i[CPU0 ] EFER = 0x00000000 00036527018i[CPU0 ] | EAX=e0000011 EBX=0015f000 ECX=00161dc1 EDX=0015f000 00036527018i[CPU0 ] | ESP=0000efbc EBP=0000efbc ESI=00193fb8 EDI=00009d84 00036527018i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf SF zf af PF cf 00036527018i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D 00036527018i[CPU0 ] | CS:0028( 0005| 0| 0) 00000000 ffffffff 1 1 00036527018i[CPU0 ] | DS:0020( 0004| 0| 0) 00000000 ffffffff 1 1 00036527018i[CPU0 ] | SS:0010( 0002| 0| 0) 00001000 0000ffff 0 1 00036527018i[CPU0 ] | ES:0020( 0004| 0| 0) 00000000 ffffffff 1 1 00036527018i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 00036527018i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 00036527018i[CPU0 ] | EIP=00101122 (00101122) 00036527018i[CPU0 ] | CR0=0xe0000011 CR2=0xc0161340 00036527018i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 00036527018i[CPU0 ] 0x0000000000101122>> add byte ptr ds:[eax], al : 0000 00036527018d[SIM ] searching for component 'cpu' in list 'bochs' 00036527018d[SIM ] searching for component 'reset_on_triple_fault' in list 'cpu' 00036527018e[CPU0 ] exception(): 3rd (14) exception with no resolution, shutdown status is 00h, resetting
Mach 3.0 doesn’t do this, so I’ll have to dig far deeper into start.s which is kind of really beyond me.
Building a boot disk … is involved. 😐
rm -rf /usr/src/mach25-i386/obj mkdir /usr/src/mach25-i386/obj cd /usr/src/mach25-i386/standi386at/boot make fdboot /home/user/mkfs /dev/rfloppy 2880 18 2 4096 512 32 1 dd if=/usr/src/mach25-i386/obj/standi386at/boot/boot.fd of=/dev/rfd0d /home/user/fsck -y /dev/rfloppy cd /usr/src/mach25-i386/ make mount /dev/floppy /mnt cp /usr/src/mach25-i386/obj/STD+WS-afs-nfs/vmunix /mnt sync umount /mnt /home/user/fsck -y /dev/rfloppy
So, I’m not all that dead. For anyone super impatient, you can download my VMDK here, which runs on Qemu & VMware, it includes a serial terminal on COM1 so you can use a real terminal, and if you are like me, uuencode/uudecode files in & out of the system. As always read the 404 page for the current username/password.