Linux 0.01 on Qemu!

Well sort of.

Linux 0.01!

Linux 0.01!

I looked at the source again, and for some reason 99% of it compiled without issue.  I recall having all kinds of issues, but clearly I was doing something wrong back then.  At any rate, all I really had to do was modify the commenting style in the 8086 boot block code, and modify the image creation tool to open files in O_BINARY mode for Windows, and I got an image that will boot, then panic because it has issues reading the hard disk.  I tried the seemingly small ‘fix’ from Linux 0.11 but it’s not working.

If anyone cares, I updated the sourceforge download, as MinGW-aout-linux–001_010_011.7z

Linux at 25 years!

As we quickly approach this amazing milestone, I think it’s always interesting to re-visit the roots of Linux, back to the really ancient versions.  Thanks to the hard work of oldlinux.org, the oldest intact Linux source code available is Linux 0.10 from November of 1991.  A popular writeup on 0.10 was up on kerneltrap.org which appears to have been vaporized, but thanks to archvie.org is preserved.

Since this version is complete I thought it would be fun to run it through the Linux 0.11 build process & toolchain to see if I could get a working kernel.  Well I had a few stumbling blocks, the bootblocks and the keyboard assembly driver were giving me issues, and for the sake of time, I went ahead and replaced them with the code from 0.11, and along with minor patching to the IDE disk driver.  I added in a simple line to let me know I was actually booting up my franken 0.10 kernel with Qemu.  Also I found later versions of Qemu work much better with 0.10 regarding the IDE disk.

Linux 0.10 on Qemu, cross compiled on Windows

Linux 0.10 on Qemu, cross compiled on Windows

I know it’s not much to look at but it really is building and running.  I’m using the disk for the 0.11 series, as the userland seems to somewhat work.  It’s very touchy, and prone to crashing as it ‘has a bug in the buffer cache’ that I didn’t feel like trying to track down.  Nobody should be using this for anything serious anyways.

Install the 0.11 a.out GCC 1.40 on Win32 cross environment (I guess you can build them on Linux too if you so desire), and if you have a working MSYS environment you can run ‘make’ and it should give you a kernel.  The command file ‘linux.cmd’ will boot it up, and attach the disk image that I used to test.  There are permission errors, and well.. errors.  0.10 was not able to selfhost, but it should be enough to boot, mount the root, and run stuff like the sample ‘hello world’ program.

For those who like to browse the source, I have a browsable tree here.

And for the 2-3 people who care, here is my updated linux-0.10 source tree hosted on sourceforge.

Tahoe?

D:\aoutgcc\tahoe\GENERIC>gcc -v
gcc version 1.40

D:\aoutgcc\tahoe\GENERIC>make 2> err.txt
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_access.c
cat kdb_access.s | a386 -o kdb_access.o
rm -f kdb_access.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_command.c
cat kdb_command.s | a386 -o kdb_command.o
rm -f kdb_command.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_ctype.c
cat kdb_ctype.s | a386 -o kdb_ctype.o
rm -f kdb_ctype.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_expr.c
cat kdb_expr.s | a386 -o kdb_expr.o
rm -f kdb_expr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_format.c
cat kdb_format.s | a386 -o kdb_format.o
rm -f kdb_format.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_input.c
cat kdb_input.s | a386 -o kdb_input.o
rm -f kdb_input.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_message.c
cat kdb_message.s | a386 -o kdb_message.o
rm -f kdb_message.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_output.c
cat kdb_output.s | a386 -o kdb_output.o
rm -f kdb_output.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_pcs.c
cat kdb_pcs.s | a386 -o kdb_pcs.o
rm -f kdb_pcs.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_print.c
cat kdb_print.s | a386 -o kdb_print.o
rm -f kdb_print.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_runpcs.c
cat kdb_runpcs.s | a386 -o kdb_runpcs.o
rm -f kdb_runpcs.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_sym.c
cat kdb_sym.s | a386 -o kdb_sym.o
rm -f kdb_sym.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../kdb/kdb_trap.c
cat kdb_trap.s | a386 -o kdb_trap.o
rm -f kdb_trap.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../net/af.c
cat af.s | a386 -o af.o
rm -f af.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../net/if.c
cat if.s | a386 -o if.o
rm -f if.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../net/if_loop.c
cat if_loop.s | a386 -o if_loop.o
rm -f if_loop.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../net/raw_cb.c
cat raw_cb.s | a386 -o raw_cb.o
rm -f raw_cb.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../net/raw_usrreq.c
cat raw_usrreq.s | a386 -o raw_usrreq.o
rm -f raw_usrreq.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../net/route.c
cat route.s | a386 -o route.o
rm -f route.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/if_ether.c
cat if_ether.s | a386 -o if_ether.o
rm -f if_ether.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/in.c
cat in.s | a386 -o in.o
rm -f in.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/in_pcb.c
cat in_pcb.s | a386 -o in_pcb.o
rm -f in_pcb.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/in_proto.c
cat in_proto.s | a386 -o in_proto.o
rm -f in_proto.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/ip_icmp.c
cat ip_icmp.s | a386 -o ip_icmp.o
rm -f ip_icmp.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/ip_input.c
cat ip_input.s | a386 -o ip_input.o
rm -f ip_input.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/ip_output.c
cat ip_output.s | a386 -o ip_output.o
rm -f ip_output.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/raw_ip.c
cat raw_ip.s | a386 -o raw_ip.o
rm -f raw_ip.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/tcp_debug.c
cat tcp_debug.s | a386 -o tcp_debug.o
rm -f tcp_debug.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/tcp_input.c
cat tcp_input.s | a386 -o tcp_input.o
rm -f tcp_input.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/tcp_output.c
cat tcp_output.s | a386 -o tcp_output.o
rm -f tcp_output.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/tcp_subr.c
cat tcp_subr.s | a386 -o tcp_subr.o
rm -f tcp_subr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/tcp_timer.c
cat tcp_timer.s | a386 -o tcp_timer.o
rm -f tcp_timer.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/tcp_usrreq.c
cat tcp_usrreq.s | a386 -o tcp_usrreq.o
rm -f tcp_usrreq.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netinet/udp_usrreq.c
cat udp_usrreq.s | a386 -o udp_usrreq.o
rm -f udp_usrreq.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/idp_usrreq.c
cat idp_usrreq.s | a386 -o idp_usrreq.o
rm -f idp_usrreq.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns.c
cat ns.s | a386 -o ns.o
rm -f ns.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns_error.c
cat ns_error.s | a386 -o ns_error.o
rm -f ns_error.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns_ip.c
cat ns_ip.s | a386 -o ns_ip.o
rm -f ns_ip.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns_input.c
cat ns_input.s | a386 -o ns_input.o
rm -f ns_input.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns_output.c
cat ns_output.s | a386 -o ns_output.o
rm -f ns_output.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns_pcb.c
cat ns_pcb.s | a386 -o ns_pcb.o
rm -f ns_pcb.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/ns_proto.c
cat ns_proto.s | a386 -o ns_proto.o
rm -f ns_proto.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/spp_debug.c
cat spp_debug.s | a386 -o spp_debug.o
rm -f spp_debug.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../netns/spp_usrreq.c
cat spp_usrreq.s | a386 -o spp_usrreq.o
rm -f spp_usrreq.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/init_main.c
cat init_main.s | a386 -o init_main.o
rm -f init_main.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/init_sysent.c
cat init_sysent.s | a386 -o init_sysent.o
rm -f init_sysent.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_acct.c
cat kern_acct.s | a386 -o kern_acct.o
rm -f kern_acct.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_clock.c
cat kern_clock.s | a386 -o kern_clock.o
rm -f kern_clock.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_descrip.c
cat kern_descrip.s | a386 -o kern_descrip.o
rm -f kern_descrip.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_exec.c
cat kern_exec.s | a386 -o kern_exec.o
rm -f kern_exec.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_exit.c
cat kern_exit.s | a386 -o kern_exit.o
rm -f kern_exit.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_fork.c
cat kern_fork.s | a386 -o kern_fork.o
rm -f kern_fork.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_malloc.c
cat kern_malloc.s | a386 -o kern_malloc.o
rm -f kern_malloc.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_mman.c
cat kern_mman.s | a386 -o kern_mman.o
rm -f kern_mman.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_proc.c
cat kern_proc.s | a386 -o kern_proc.o
rm -f kern_proc.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_prot.c
cat kern_prot.s | a386 -o kern_prot.o
rm -f kern_prot.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_resource.c
cat kern_resource.s | a386 -o kern_resource.o
rm -f kern_resource.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_sig.c
cat kern_sig.s | a386 -o kern_sig.o
rm -f kern_sig.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_subr.c
cat kern_subr.s | a386 -o kern_subr.o
rm -f kern_subr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_synch.c
cat kern_synch.s | a386 -o kern_synch.o
rm -f kern_synch.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_time.c
cat kern_time.s | a386 -o kern_time.o
rm -f kern_time.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/kern_xxx.c
cat kern_xxx.s | a386 -o kern_xxx.o
rm -f kern_xxx.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/quota_kern.c
cat quota_kern.s | a386 -o quota_kern.o
rm -f quota_kern.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/quota_subr.c
cat quota_subr.s | a386 -o quota_subr.o
rm -f quota_subr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/quota_sys.c
cat quota_sys.s | a386 -o quota_sys.o
rm -f quota_sys.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/quota_ufs.c
cat quota_ufs.s | a386 -o quota_ufs.o
rm -f quota_ufs.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/subr_log.c
cat subr_log.s | a386 -o subr_log.o
rm -f subr_log.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/subr_prf.c
cat subr_prf.s | a386 -o subr_prf.o
rm -f subr_prf.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/subr_rmap.c
cat subr_rmap.s | a386 -o subr_rmap.o
rm -f subr_rmap.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/subr_xxx.c
cat subr_xxx.s | a386 -o subr_xxx.o
rm -f subr_xxx.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/sys_generic.c
cat sys_generic.s | a386 -o sys_generic.o
rm -f sys_generic.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/sys_inode.c
cat sys_inode.s | a386 -o sys_inode.o
rm -f sys_inode.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/sys_process.c
cat sys_process.s | a386 -o sys_process.o
rm -f sys_process.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/sys_socket.c
cat sys_socket.s | a386 -o sys_socket.o
rm -f sys_socket.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/tty.c
cat tty.s | a386 -o tty.o
rm -f tty.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/tty_conf.c
cat tty_conf.s | a386 -o tty_conf.o
rm -f tty_conf.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/tty_pty.c
cat tty_pty.s | a386 -o tty_pty.o
rm -f tty_pty.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/tty_subr.c
cat tty_subr.s | a386 -o tty_subr.o
rm -f tty_subr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/tty_tty.c
cat tty_tty.s | a386 -o tty_tty.o
rm -f tty_tty.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_alloc.c
cat ufs_alloc.s | a386 -o ufs_alloc.o
rm -f ufs_alloc.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_bio.c
cat ufs_bio.s | a386 -o ufs_bio.o
rm -f ufs_bio.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_bmap.c
cat ufs_bmap.s | a386 -o ufs_bmap.o
rm -f ufs_bmap.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_disksubr.c
cat ufs_disksubr.s | a386 -o ufs_disksubr.o
rm -f ufs_disksubr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_fio.c
cat ufs_fio.s | a386 -o ufs_fio.o
rm -f ufs_fio.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_inode.c
cat ufs_inode.s | a386 -o ufs_inode.o
rm -f ufs_inode.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_mount.c
cat ufs_mount.s | a386 -o ufs_mount.o
rm -f ufs_mount.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_namei.c
cat ufs_namei.s | a386 -o ufs_namei.o
rm -f ufs_namei.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_subr.c
cat ufs_subr.s | a386 -o ufs_subr.o
rm -f ufs_subr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_syscalls.c
cat ufs_syscalls.s | a386 -o ufs_syscalls.o
rm -f ufs_syscalls.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_tables.c
cat ufs_tables.s | a386 -o ufs_tables.o
rm -f ufs_tables.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/ufs_xxx.c
cat ufs_xxx.s | a386 -o ufs_xxx.o
rm -f ufs_xxx.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_domain.c
cat uipc_domain.s | a386 -o uipc_domain.o
rm -f uipc_domain.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_mbuf.c
cat uipc_mbuf.s | a386 -o uipc_mbuf.o
rm -f uipc_mbuf.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_proto.c
cat uipc_proto.s | a386 -o uipc_proto.o
rm -f uipc_proto.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_socket.c
cat uipc_socket.s | a386 -o uipc_socket.o
rm -f uipc_socket.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_socket2.c
cat uipc_socket2.s | a386 -o uipc_socket2.o
rm -f uipc_socket2.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_syscalls.c
cat uipc_syscalls.s | a386 -o uipc_syscalls.o
rm -f uipc_syscalls.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/uipc_usrreq.c
cat uipc_usrreq.s | a386 -o uipc_usrreq.o
rm -f uipc_usrreq.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_drum.c
cat vm_drum.s | a386 -o vm_drum.o
rm -f vm_drum.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_mem.c
cat vm_mem.s | a386 -o vm_mem.o
rm -f vm_mem.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_mon.c
cat vm_mon.s | a386 -o vm_mon.o
rm -f vm_mon.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_page.c
cat vm_page.s | a386 -o vm_page.o
rm -f vm_page.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_proc.c
cat vm_proc.s | a386 -o vm_proc.o
rm -f vm_proc.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_pt.c
cat vm_pt.s | a386 -o vm_pt.o
rm -f vm_pt.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_sched.c
cat vm_sched.s | a386 -o vm_sched.o
rm -f vm_sched.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_subr.c
cat vm_subr.s | a386 -o vm_subr.o
rm -f vm_subr.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_sw.c
cat vm_sw.s | a386 -o vm_sw.o
rm -f vm_sw.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_swap.c
cat vm_swap.s | a386 -o vm_swap.o
rm -f vm_swap.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_swp.c
cat vm_swp.s | a386 -o vm_swp.o
rm -f vm_swp.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../sys/vm_text.c
cat vm_text.s | a386 -o vm_text.o
rm -f vm_text.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/autoconf.c
cat autoconf.s | a386 -o autoconf.o
rm -f autoconf.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/conf.c
cat conf.s | a386 -o conf.o
rm -f conf.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/cons.c
cat cons.s | a386 -o cons.o
rm -f cons.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/clock.c
cat clock.s | a386 -o clock.o
rm -f clock.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/kdb_opset.c
cat kdb_opset.s | a386 -o kdb_opset.o
rm -f kdb_opset.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/mem.c
cat mem.s | a386 -o mem.o
rm -f mem.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/ns_cksum.c
cat ns_cksum.s | a386 -o ns_cksum.o
rm -f ns_cksum.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/sys_machdep.c
cat sys_machdep.s | a386 -o sys_machdep.o
rm -f sys_machdep.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/trap.c
cat trap.s | a386 -o trap.o
rm -f trap.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/ufs_machdep.c
cat ufs_machdep.s | a386 -o ufs_machdep.o
rm -f ufs_machdep.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoe/vm_machdep.c
cat vm_machdep.s | a386 -o vm_machdep.o
rm -f vm_machdep.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoeif/if_ex.c
cat if_ex.s | a386 -o if_ex.o
rm -f if_ex.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoevba/vba.c
cat vba.s | a386 -o vba.o
rm -f vba.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoevba/vd.c
cat vd.s | a386 -o vd.o
rm -f vd.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoevba/vx.c
cat vx.s | a386 -o vx.o
rm -f vx.s
gcc -c -S -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL ../tahoevba/hd.c
cat hd.s | a386 -o hd.o
rm -f hd.s
gcc -c -O -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL -DTIMEZONE=480 -DDST=1 -DMAXUSERS=32 param.c
gcc -O -I. -I../h -I.. -I../usr/include -DGENERIC -DTAHOE -Dtahoe -DKADB -DFPE -DNS -DINET -DTCP_COMPAT_42 -DQUOTA -DKERNEL -c -o ioconf.o ioconf.c
loading vmunix

D:\aoutgcc\tahoe\GENERIC>

I’m surprised I got that much to compile.  Obviously things like swapgeneric, locore, kdb_machdep & machdep had to be removed as they contain too much Power 6/32 (Tahoe) assembly.

I did this with my Linux 0.11 on Windows build adventure.

So no, this won’t run, or probably be made into anything even close to being useful.  I can’t imagine anyone who would care, but here is my source tree.

tahoe_pass1.7z

EMX GCC 2.5.8 for Windows

Continuing in my quest of useless stuff, here is GCC 2.5.8 for EMX as a native Win32 executable set.

With some weirdness of inline not being recognized, I just commented that out.  The GCC driver program does have some issues though, and Im just not in the mood to fully figure out why either the EMX or MS-DOS versions can’t correctly  capture return codes, or if it was better to just use -pipe and _pipe with _O_TEXT mode set, but again how to figure out if the pipe closed cleanly or with errors?  So for now it’ll always assume everything worked, but it will still print errors.  Sigh.

With that said, the CC1, CC1OBJ, CC1PLUS drivers all built, so you can use C, ObjectiveC, and C++. yay.

The functional version of this is EMX 0.8H, with the gcc 2.5.8 update.  Maybe I’ll put this all on sourceforge so people don’t have to deal with my crappy download system, but for now it’s on my site.

Here is my build, along with binaries:

emx_gcc_258_phase1_xgcc_cccp_cc1_cc1obj_cc1plus.7z

And the un touched source code, as provided in the 0.8H update

emx_gcc_258_virgin.7z

I’ve only tested it with MS-DOS, and PDOS.  I’m also using the ancient binutils from my GCC 1.40 on Windows experiment.

Spent some more time messing with NetHack 1.3d revived

1.3d revived and reloaded

1.3d revived and reloaded

And now it runs on Windows 10 (probably lots of Windows NT as well) thanks to EMX+RSXNT.

I put a Windows binary build on sourceforge, with the needed termcap and rsxnt.dll to run.  It works best if installed into the root of a drive, but it doesn’t matter which drive letter (I suppose you could even use subst).  I was patching around the stock NetHack 1.3d, but considering the weird issues I was having with it ‘mostly’ working, it was easier to just lean on the NetHack 1.3d revived project.  I should also say this is what I also used to get NetHack 1.3d running on the x68000.

I’ve been able to save, restore and go up, down and even die without it crashing so it seems OK to me.

It’s kind of cool to build it with GCC 1.40 on Windows 10, and get a native executable.  Maybe pointless in the golden age of emulation / virtualization as you could just as easily build stock 1.3d on a 4.2 BSD VAX, or even 386BSD 0.1 system.

Maybe I’ll finish the work to see if I can get it running on OS/2 or MS-DOS via EMX, but for now the project stuff is on sourceforge.net

 

GCC 1.37 on MacOS

I didn’t even know there was such a thing!

But sure enough, the file GNUMPW.SIT, and the later gcc-1.37.1r15-all.sea.bin are the real thing!  The file GNUMPW unstuffs to GCC 1.37.1r7(All), although Stuffit 5 and higher won’t unpack the file, I’ve converted it unpacking with version 4 & repacking with 5.5.

The readme from r7 is dated November 2nd, 1990.  I found some history on this port on the archives of the GCC mailing list here.  The port was done by Stan Shebs, while working for Apple.  As he states the port started in 1989 and was first used in an abandoned m68k based project, and later a possible replacement for the Apple compiler for OS 7.

For this experiment I was using the r15 version, as I didn’t find anything out about the prior versions until after I had written this.

GCC on MacOS needs the MPW environment, which for me is incredibly awkward to work with. While some people may love it, it is very strange in that you have to highlight commands in the window, then hit clover+enter to run them.  Like a mainframe, you can input commands wherever in the screen.

The next hardest thing was finding a version of MPW that will work with this.  It needs the MPW C compiler for it’s includes, and libraries.  The 3.5 stuff didn’t seem to work for me, however doing a LOT of searching, and I did find a ‘toast CD-ROM’ image‘ of 3.1 that includes all the C, and Assembler tools that I need to build an executable.

I also don’t know why, but running make just shows me what needs to be done, it never actually makes anything.  I’m probably doing something wrong, but for such a long dead tool, trying to find out how to use it, or how do you interrupt a “stream” like manually running cc1 is beyond me.  I just have to force quit the emulator.

But beyond that, running make gives me the steps, and I manually select and run the steps, and I was able to get a program to run!

xxx

sieve

I know it may not look like much, but getting it to actually run something was quite monumental for me!

I thought for the hell of it, I’d try to build the InfoTaskForce 1987 interpreter, but it seems to get confused at the whole input method.

Planetfall on MacOS

Planetfall on MPW

There were some issues compiling input.c, as it didn’t like the external table, so I made it’s own local table.  It also didn’t like some pointer arithmetic, but making GCC happy only gives me a program that can’t recognize any verbs.  And from there it won’t quit, basically hanging the system.

I’m sure I’m doing something wrong, but at the same time it was interesting to see GCC on MacOS, during the whole GNU boycott of Apple for the ‘look and feel’ lawsuit against Microsoft.  No doubt it let a lot of people sell other C compilers on the Mac Platform during this window of time.

GCC requires a 68020 processor, as GCC’s native 68000 based target would be SUN-2 hardware.  While it can compile with the -m68000 flag, I haven’t tested with a 68000 based emulator to see if that’s even true.  In the off chance someone wants a combined MPW+GCC I made a disk image here: MPW 3.1 with GCC 1.37.img.gz.  Disk Copy 6.3 should be able to mount it OK, or any emulator that likes HFS disk images.

Ported System16 0.53 to Windows

To be honest, it was about 30 minutes worth of work to jump from Allegro 2.11 to Allegro 4.2.  I’ve never used it before, but the only ‘gotcha’ was how they handle the main to WinMain for linking.

At the end of your main procedure, you need to place the following code:

END_OF_MAIN()

And that is it! No semicolon either!

Last night I was playing with Musashi, and actually had the ‘demo’ program loading up the Altered Beast program, and running.  I just put in the memory areas to let it have read only to the ROM space, read write to the memory addresses, and write only to the IO ports.  It was enough for it to lock up in an endless loop like this:

E 3990: 4a38 f01c           : tst.b   $f01c.w
E 3994: 67fa                : beq     3990

Well some digging around and I found these vague hints:

Some special bytes:
F018: if bit5 is set 1, the screen is not updated
F01C: Timer ?
TimerA=&RAM[0xFF][0xF01C];
TimerB=&RAM[0xFF][0xF01E];

So it looks like it’s waiting for a shared memory value to be set to a ‘1’, so I setup the IRQ to include this nice hack:

offset=0x00FFf01c-0x00FF0000;
WRITE_BYTE(g_ram, offset,1);

And we were away.

So I thought I’d try to make the big step, as System16 v0.53 uses an ancient version of the UAE Amiga emulator, somewhere between 0.4 and 0.6, I think.  Anyways I was hoping to expand more and more functionality, and one thing SEGA did love to do was add more and more processors into their designs with some boards sporting up to three 68000 processors.  And Musashi can support multiple processors so, it seemed like a good fit.

So I amputated the UAE code, and tried to see how many functions System16 calls out from UAE, and it isn’t that much.  Most calls involve setting up emulation, and executing a single instruction. System16 handles all the memory access, Interrupts, and I/O.  So a few hours of bashing away I got it to link, and was greeted with a nice black screen.  I did remember that when I was first playing with the code, that even though the CPU was executing instructions nothing would be drawn without the external interrupt.  So I googled around and found another emulator, Virtual Jaguar, that also uses the Musashi 68000 CPU core.

So I could take the old UAE way of executing an interrupt from this:


void inline Exception(int nr, CPTR oldpc)
{
MakeSR();
#ifdef DEBUG_INT
TraceOn();
printf("Exception %0x, valeur = %0x, pc = %0x\n", nr, oldpc, m68k_getpc());
printf("Valeur de r�gistre SR = 0x%0x\n", regs.sr);
#endif
if(!regs.s) {
   regs.a[7]=regs.isp;
   regs.s=1;
   }

regs.a[7] -= 4;
put_long (regs.a[7], m68k_getpc ());
regs.a[7] -= 2;
put_word (regs.a[7], regs.sr);
m68k_setpc(get_long(regs.vbr + 4*nr));

#ifdef DEBUG_INT
printf("VBR=%08x , NR=%d , I=%04x \n", regs.vbr, nr, regs.vbr+4*nr);
if (strace) printf("int jump 0x%0x\n", regs.pc);
#endif

regs.t1 = regs.t0 = regs.m = 0;
}

To this:


void inline Exception(int nr, CPTR oldpc)
{
unsigned int sr = m68ki_init_exception();
unsigned int newPC = cpu_read_long(nr<<2);

m68ki_stack_frame_3word(m68k_get_reg(0L, M68K_REG_PC),sr);
m68k_set_reg(M68K_REG_PC,newPC);
}

A quick recompile, and it was running!

Now with that in play, I went ahead and dumped all the old code, and the old Allegro, and went through re-building with Allegro 4.2 on Windows.  It didn’t take that long, I was really impressed!  At the same time I didn’t improve on anything in the slightest.

System16 v0.53 on Windows

System16 v0.53 on Windows

This is only a proof of concept, the fun hasn’t even started yet.  If you want a ‘solid’ emulator, go with MAME.  This isn’t anywhere near ready but it is interesting that it is running.  There is much more work to do with this, especially adding a Z80, and YM2151.

You can download the Win32 executable here.  You’ll need your own Altered Beast ROMs, it’s an ancient set, nothing that any recent download will map to.

More fun with GCC 6.1

So after looking at the -Ofast flags in that utterly unfair GCC 1.4 vs GCC 5.1, and 6.1 , I thought I’d try to build Cockatrice III with it.  Everything went well, and I had a build in no time.

I always hated how I had to massively downsample the audio so I could at least hear things, so I thought I’d try to put them back to 44100Khz, 16bit stereo.  And while compiling, older GCC runs fine, while 6.1 throws this run error!

../SDL/audio_sdl.cpp:57:43: error: narrowing conversion of '-1404829696' from 'int' to 'uint32 {aka unsigned int}' inside { } [-Wnarrowing]
 uint32 audio_sample_rates[] = {44100 << 16};
                                           ^
makefile:104: recipe for target 'obj/audio_sdl.o' failed
make: *** [obj/audio_sdl.o] Error 1

Well it turns out that it’s getting truncated as the audio_sample_rates are defined as an unsigned int, but it really want’s to be a regular integer.  So I changed the type, and now I have high def audio!  While I was in there, I fixed some stupid typos in the keyboard so I can actually use vi in MacMiNT.

It’s still in 256 colors, I’m missing something fundamental as to why it’s not working but I just don’t have enough time to mess with it today.

For anyone who cares, the Win32 binary package is on sourceforge.

Stupid GCC error

So while mixing and matching GCC on Windows, I ran into this issue with stdio.h of all things:

In file included from hi.c:1:0:
\mingw\include/stdio.h:191:65: error: unknown type name ‘size_t’
_CRTIMP int __cdecl __MINGW_NOTHROW setvbuf (FILE*, char*, int, size_t);
^~~~~~

Good grief how could stdio be all screwed up?

Well, it turns out it was my fault.  I had not rebuilt things like SDL, or copied over pcap so I figured I could incorrectly just point a -I to my old includes, and the new gcc would post-pend all use -I stuff.  NOPE it pre-pends them, meaning the old headers now take priority.  And wouldn’t you know it, things have drifted between versions.  So I just manually copied the files and libraries and all was well.

Googling around I did see other people with broken stdio.h but nobody posted the solution.  I guess it’s to embarrassing, but here we are.

DJGPP memory fouled

free: memory fouled

free: memory fouled

If you ever get this fun error while trying to exit or shell a program with DJGPP:

combinelo: memory fouled

free: memory fouled

You are mixing libraries built with a different version of the DJGPP runtime.  In my case, I built the allegro library with GCC 2.7.2.2 to use the older binutils but I’m cross compiling with GCC 5, so it’s using the newer runtime.

In my case I just needed to replace the contents of the lib directory with djcrx202.zip, and I was good to go.  I guess I could re-compile allegro, but that takes the better part of forever on DOSBox, and once was good enough.