Check it out, pretty amazing!
A IBM PC emulator in under 4kb!
Check it out, pretty amazing!
A IBM PC emulator in under 4kb!
I thought I’d go ahead and see if I could get Net/2 to build on my own.
Well it compiles, and tries to boot…. Sadly there is no adb or gdb support. How on earth did people debug this stuff then? I’m not sure where the crash location is, or what to do about it. But I thought this was really cool.
I’ve also tried to track down 4.4BSD encumbered, which was released around the same time as the 4.4BSD-Lite1 which was after the AT&T vs BSDi/CSRG thing.. Or even the release that parallels the Net/2 release…
Anyways, happy 2014!
I got passed a link to this new emulator, Virtual x86, a complete PC emulator in javascript. Â It is in it’s early phases, but it seems to emulate text mode and a single diskette or ISO ok. Â It can boot Linux or OpenBSD, but not any MS-DOS protected mode software I tried. Â And graphics don’t work…
But it’s 100% javascript! Â And open in that you can download the source (tarball,github) under a BSD style license! Â So naturally I made my own mirror…
I have to say, it’s really cool!
So there has been all this talk as of late with NSA and special USB cables that embed microprocessors and wireless transmitters that send out everything that passes through them. Â not to mention video cables, that can do the same thing.
Apparently another favorite thing to hit is the BIOS, as you can load whatever OS on there you want, and the firmware is still active. Â The best of the best must be hacking peripheral firmware. Â Namely storage.
Did you know you can actually load linux onto your hard disk? Â Or that various flash cards have embedded ARM processors on them?
What would this say for a network ‘offload’ mechanism to pass along packets to another host?
To those of you building “secure” systems (ie billing, medical, military) good luck.. It seems in this brave new world you cannot trust anything off the shelf.
I was thinking after rebuilding the Mach disk, that back in the say it was insinuated that the changes from Net/2 to 386BSD 0.0 were quite minimal. So I figured I should take a look. The first thing to do would be to clean up Net/2’s kernel to look more like 386 BSD’s. This was trivial as there wasn’t much of anything structure wise done. Running the patch was pretty easy:
$ diff -ruN ../../../../net.2/sys . > /tmp/net2-386bsd00.patch
The patch is about 1MB. Much larger than I expected! Applying the patch to Net/2 shows that a substantial amount of files changed:
$ patch -p0 < /tmp/net2-386bsd00.patch
patching file ./conf/files
patching file ./i386/conf/GENERIC.i386
patching file ./i386/conf/Makefile.i386
patching file ./i386/conf/devices.i386
patching file ./i386/conf/files.i386
patching file ./i386/i386/autoconf.c
patching file ./i386/i386/conf.c
patching file ./i386/i386/genassym.c
patching file ./i386/i386/locore.s
patching file ./i386/i386/machdep.c
patching file ./i386/i386/pmap.c
patching file ./i386/i386/symbols.raw
patching file ./i386/i386/trap.c
patching file ./i386/i386/vm_machdep.c
patching file ./i386/include/psl.h
patching file ./i386/isa/com.c
patching file ./i386/isa/fd.c
patching file ./i386/isa/isa.c
patching file ./i386/isa/npx.c
patching file ./i386/isa/pccons.c
patching file ./i386/isa/wd.c
patching file ./i386/isa/wt.c
patching file ./i386/stand/Makefile
patching file ./i386/stand/bmap.c
patching file ./i386/stand/boot.c
patching file ./i386/stand/bootxx.c
patching file ./i386/stand/breadxx.c
patching file ./i386/stand/cga.c
patching file ./i386/stand/conf.c
patching file ./i386/stand/confxx.c
patching file ./i386/stand/fd.c
patching file ./i386/stand/fdbootblk.c
patching file ./i386/stand/fs.c
patching file ./i386/stand/kbd.c
patching file ./i386/stand/libsa/Makefile
patching file ./i386/stand/libsmsa/Makefile
patching file ./i386/stand/prf.c
patching file ./i386/stand/saio.h
patching file ./i386/stand/srt0.c
patching file ./i386/stand/trimhd.c
patching file ./i386/stand/wd.c
patching file ./kern/Makefile
patching file ./kern/init_main.c
patching file ./kern/kern__physio.c
patching file ./kern/kern_descrip.c
patching file ./kern/kern_exec.c
patching file ./kern/kern_execve.c
patching file ./kern/kern_exit.c
patching file ./kern/kern_fork.c
patching file ./kern/kern_malloc.c
patching file ./kern/kern_physio.c
patching file ./kern/kern_proc.c
patching file ./kern/kern_sig.c
patching file ./kern/kern_subr.c
patching file ./kern/makesyscalls.sh
patching file ./kern/subr_rlist.c
patching file ./kern/subr_rmap.c
patching file ./kern/sys_process.c
patching file ./kern/syscalls.master
patching file ./kern/tty.c
patching file ./kern/tty_pty.c
patching file ./kern/tty_ring.c
patching file ./kern/tty_subr.c
patching file ./kern/uipc_mbuf.c
patching file ./kern/vfs__bio.c
patching file ./kern/vfs_bio.c
patching file ./net/af.h
patching file ./net/bpf.c
patching file ./net/bpf.h
patching file ./net/bpfdesc.h
patching file ./net/if.h
patching file ./net/if_arp.h
patching file ./net/if_dl.h
patching file ./net/if_llc.h
patching file ./net/if_sl.c
patching file ./net/if_slvar.h
patching file ./net/if_types.h
patching file ./net/netisr.h
patching file ./net/radix.h
patching file ./net/raw_cb.h
patching file ./net/route.h
patching file ./net/slcompress.h
patching file ./netinet/icmp_var.h
patching file ./netinet/if_ether.h
patching file ./netinet/in.h
patching file ./netinet/in_pcb.h
patching file ./netinet/in_proto.c
patching file ./netinet/in_systm.h
patching file ./netinet/in_var.h
patching file ./netinet/ip.h
patching file ./netinet/ip_icmp.h
patching file ./netinet/ip_var.h
patching file ./netinet/tcp.h
patching file ./netinet/tcp_debug.h
patching file ./netinet/tcp_fsm.h
patching file ./netinet/tcp_seq.h
patching file ./netinet/tcp_timer.h
patching file ./netinet/tcp_var.h
patching file ./netinet/tcpip.h
patching file ./netinet/udp.h
patching file ./netinet/udp_var.h
patching file ./nfs/nfs.h
patching file ./nfs/nfs_subs.c
patching file ./nfs/nfs_vnops.c
patching file ./nfs/nfscompress.h
patching file ./nfs/nfsdiskless.h
patching file ./nfs/nfsiom.h
patching file ./nfs/nfsm_subs.h
patching file ./nfs/nfsmount.h
patching file ./nfs/nfsnode.h
patching file ./nfs/nfsrvcache.h
patching file ./nfs/nfsv2.h
patching file ./nfs/rpcv2.h
patching file ./nfs/xdr_subs.h
patching file ./stand/printf.c
patching file ./stand/saerrno.h
patching file ./stand/saioctl.h
patching file ./sys/acct.h
patching file ./sys/buf.h
patching file ./sys/callout.h
patching file ./sys/cdefs.h
patching file ./sys/clist.h
patching file ./sys/conf.h
patching file ./sys/dir.h
patching file ./sys/disklabel.h
patching file ./sys/dkbad.h
patching file ./sys/dkstat.h
patching file ./sys/dmap.h
patching file ./sys/domain.h
patching file ./sys/errno.h
patching file ./sys/exec.h
patching file ./sys/fcntl.h
patching file ./sys/fifo.h
patching file ./sys/file.h
patching file ./sys/filedesc.h
patching file ./sys/gprof.h
patching file ./sys/ioctl.h
patching file ./sys/ioctl_compat.h
patching file ./sys/ipc.h
patching file ./sys/kernel.h
patching file ./sys/kinfo.h
patching file ./sys/kinfo_proc.h
patching file ./sys/ktrace.h
patching file ./sys/malloc.h
patching file ./sys/map.h
patching file ./sys/mapmem.h
patching file ./sys/mbuf.h
patching file ./sys/mman.h
patching file ./sys/mount.h
patching file ./sys/msgbuf.h
patching file ./sys/mtio.h
patching file ./sys/namei.h
patching file ./sys/param.h
patching file ./sys/proc.h
patching file ./sys/protosw.h
patching file ./sys/ptrace.h
patching file ./sys/reboot.h
patching file ./sys/resource.h
patching file ./sys/resourcevar.h
patching file ./sys/seg.h
patching file ./sys/shm.h
patching file ./sys/signal.h
patching file ./sys/signalvar.h
patching file ./sys/socket.h
patching file ./sys/socketvar.h
patching file ./sys/specdev.h
patching file ./sys/stat.h
patching file ./sys/syscall.h
patching file ./sys/syslimits.h
patching file ./sys/syslog.h
patching file ./sys/systm.h
patching file ./sys/tablet.h
patching file ./sys/termios.h
patching file ./sys/time.h
patching file ./sys/timeb.h
patching file ./sys/times.h
patching file ./sys/tprintf.h
patching file ./sys/trace.h
patching file ./sys/tty.h
patching file ./sys/ttychars.h
patching file ./sys/ttydefaults.h
patching file ./sys/ttydev.h
patching file ./sys/types.h
patching file ./sys/ucred.h
patching file ./sys/uio.h
patching file ./sys/un.h
patching file ./sys/unistd.h
patching file ./sys/unpcb.h
patching file ./sys/user.h
patching file ./sys/vadvise.h
patching file ./sys/vcmd.h
patching file ./sys/vlimit.h
patching file ./sys/vmmeter.h
patching file ./sys/vnode.h
patching file ./sys/vsio.h
patching file ./sys/vtimes.h
patching file ./sys/wait.h
patching file ./ufs/dinode.h
patching file ./ufs/dir.h
patching file ./ufs/fs.h
patching file ./ufs/inode.h
patching file ./ufs/lockf.h
patching file ./ufs/mfs_vnops.c
patching file ./ufs/mfsiom.h
patching file ./ufs/mfsnode.h
patching file ./ufs/quota.h
patching file ./ufs/ufsmount.h
patching file ./vm/device_pager.h
patching file ./vm/lock.h
patching file ./vm/pmap.h
patching file ./vm/queue.h
patching file ./vm/swap_pager.c
patching file ./vm/swap_pager.h
patching file ./vm/vm.h
patching file ./vm/vm_fault.c
patching file ./vm/vm_glue.c
patching file ./vm/vm_inherit.h
patching file ./vm/vm_kern.c
patching file ./vm/vm_kern.h
patching file ./vm/vm_map.h
patching file ./vm/vm_object.h
patching file ./vm/vm_page.h
patching file ./vm/vm_pageout.h
patching file ./vm/vm_pager.h
patching file ./vm/vm_param.h
patching file ./vm/vm_prot.h
patching file ./vm/vm_statistics.h
patching file ./vm/vm_swap.c
patching file ./vm/vm_user.h
patching file ./vm/vnode_pager.h
Clearly the move from Net/2 to 386BSD 0.0 was not trivial. Which I’ve always wondered, as quotes like this:
Make it sound like Bill spent six months on six files.
I guess the real question is can I find a so called encumbered 4.4 BSD, and compare that to the lite to see the magical “six files” and then check the drift into Net/2, to 386BSD 0.0 …
And I saw my old look at Mach+Lites. Â And of course there was a qcow disk image associated with some ancient version of Qemu which I can’t run on Wine on OS X. Â So I figured with a bit of fun I’d update the disk image to work with Qemu 1.7.0.
Luckily Qemu 0.15.1 works just fine for it’s qemu-img. Â So a quick
qemu-img convert -f qcow -O vmdk mach.img mach.vmdk
and I had my image. Â I’m not sure of what the NE2000 parameters that Mach can use to enable the network, but I do recall it was easier to just rebuild Qemu around them. Â However this time, I switched to the Mach kernel that utilized Linux device drivers to get a working network.
I updated the hard disk file here.
For the two or three people who care about BSD evolutionary dead ends.
Wow this year has been quite a personal ride for me. From a bad 2012, to a seeming uncertain 2013 where I not only found my love but also found a new home in a new continent.
Through it all I’ve kept the blog up and going. I’ve changed VPS providers a few times, to now living out the dream on dedicated hardware.
As this year draws to the end, Id like to thank regular users for sticking around just as I’d like to thank new users for taking a look at my mis-adventures through the years.
I’m really looking forward to next year, and the endless possibilities.
Jason
I stumbled across this page, which has installers & executables for Win64 based OS’es of Qemu!
Of course this is very exciting… considering I never could get a working build of Qemu for a Win64 platform, and more or less gave up.
From the brief guide on building, it looks like they use POSIX threading and cross build from Linux. Â Naturally I’ve been trying to use native tools & Win32 threading as I saw mentioned over here.
Maybe one day I’ll be able to get it working in a semi-consistent manner and put back in my lame fixes disabling screen resizing in a window, and control alt delete shortcuts.
New features include:
pretty cool!
You can find the source code, binaries, and some ROMs on Tom’s Page. Â I’ve got to say I really like PCem, it gives the full (slow and painful, like the real thing) retro PC experience!
I wanted to test something 64bit on my new Qemu build, and for the heck of it wen to check out AROS.
And much to my amazement, there is a working x86_64 in the nightly build, 20131104!
To me it’s very cool to see a 64bit AROS… It’s the kind of thing we’d only dream about back in 1993.