cd /tmp/plan9-loongson mkdir /sys/src/9/loongson dircp 9 /sys/src/9/loongson for(i in libc libmp libsec) { mkdir -p /sys/src/$i/spim dircp $i /sys/src/$i/spim } for(i in 9 ap mp sec) { mkdir -p /sys/src/ape/lib/$i/spim dircp ape/$i /sys/src/ape/lib/$i/spim } cp /sys/src/libthread/mips.c /sys/src/libthread/spim.c cp /sys/src/libthread/xincmips.s /sys/src/libthread/xincspim.s echo 'fsys main create /active/spim sys sys d775' >> /srv/fscons dircp spim /spim ed /opt/spim/sys/src/cmd/vl/asm.c < patch/vl_asm.c.patch ed /opt/spim/sys/src/libmach/vdb.c < patch/libmach_vdb.c.patch ed /opt/spim/sys/src/cmd/vc/swt.c < patch/vc_swt.c.patch emptydir=(\ /acme/bin/spim\ /spim/lib\ /spim/bin/ape\ /spim/bin/ape\ /spim/bin/auth\ /spim/bin/aux\ /spim/bin/bitsy\ /spim/bin/dial\ /spim/bin/disk\ /spim/bin/fossil\ /spim/bin/fs\ /spim/bin/games\ /spim/bin/ip\ /spim/bin/ip/httpd\ /spim/bin/ndb\ /spim/bin/replica\ /spim/bin/upas\ /spim/bin/usb\ /spim/bin/venti\ /spim/lib/ape\ ) for(i in $emptydir) { rm -rf $i mkdir $i } for(i in /sys/src/cmd/v?) {cd $i && mk install && mk clean} cd /sys/src && objtype=spim {mk nuke && mk install && mk clean} bind -ac /sys/src/9/loongson/2f /sys/src/9/loongson cd /sys/src/9/loongson && mk nuke && mk CONF'='ln2fcpu install && mk clean # boot PMON> ifaddr rtl0 192.168.0.91 PMON> load tftp://192.168.0.130//spim/9ln2fcpu PMON> g % echo ps2 > '#m'/mousectl # bflz cd /sys/lib/dist/cmd && mk install && mk clean mkdir /sys/lib/dist/bin/spim cd /sys/lib/dist/cmd && objtype=spim {mk install && mk clean} mkdir /sys/lib/dist/loongson dircp /tmp/plan9-loongson/dist /sys/lib/dist/loongson cd /sys/lib/dist/loongson && mk bind -ac /sys/src/9/loongson/2f /sys/src/9/loongson cd /sys/src/9/loongson && mk nuke && mk CONF'='ln2fbzroot install && mk clean PMON> load /dev/fs/ext2@wd0/boot/9ln2fbzroot