</$objtype/mkfile
BIN=/386
-TARG=\
- 9load\
- 9loadask\
- 9loaddebug\
- 9loadlite\
- 9loadlitedebug\
- 9loadusb\
- 9pxeload\
- 9pxeloaddebug\
- mbr\
- pbs\
- pbslba\
-
-CORE=\
- alarm.$O\
- cga.$O\
- clock.$O\
- console.$O\
- dosboot.$O\
- devfloppy.$O\
- dma.$O\
- fs.$O\
- ilock.$O\
- kbd.$O\
- kfsboot.$O\
- print.$O\
- queue.$O\
- trap.$O\
-
-LOAD=\
- 8250.$O\
- apm.$O\
- boot.$O\
- cis.$O\
- conf.$O\
- devbios.$O\
- devi82365.$O\
- devpccard.$O\
- devsd.$O\
- inflate.$O\
- load.$O\
- memory.$O\
- part.$O\
- pci.$O\
- sdata.$O\
- sdmylex.$O\
- sd53c8xx.$O\
- sdiahci.$O\
- sdscsi.$O\
- sdaoe.$O\
- sdbios.$O\
-
-ETHER=\
- bootp.$O\
- ether.$O\
- ether2114x.$O\
- ether2000.$O\
- ether589.$O\
- ether79c970.$O\
- ether8003.$O\
- ether8139.$O\
- ether8169.$O\
- ether82563.$O\
- ether82557.$O\
- ether83815.$O\
- ether8390.$O\
- etherec2t.$O\
- etherelnk3.$O\
- etherigbe.$O\
- ethermii.$O\
- etherrhine.$O\
- etherdp83820.$O\
-
-BCOM=\
- bcom.$O\
- bootld.$O\
- devsd.$O\
- memory.$O\
- part.$O\
- pci.$O\
- sdata.$O\
- sdscsi.$O\
-
-HFILES=\
- lib.h\
- mem.h\
- dat.h\
- fns.h\
- io.h\
- aoe.h\
-
-CFLAGS=-FTVw -I.
-
-all:V: $TARG
-
-9load: l.$O $CORE $LOAD $ETHER nobiosload.$O
- $LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
- ls -l $target
-
-9pxeload: lpxe.$O $CORE $LOAD $ETHER nobiosload.$O
- $LD -o $target -H3 -T0x80007C00 -l $prereq -lflate -lc -lip
- ls -l $target
+TARG=9bootiso 9bootpxe 9bootfat mbr pbs
-9loaddebug: l.$O $CORE $LOAD $ETHER nobiosload.$O
- $LD -o $target -T0x80010000 -l $prereq -lflate -lc -lip
- ls -l $target
- # acid $target
- # map({"text", 0x80010000, 0x80090000, 0x00000020})
+HFILES=mem.h fns.h x16.h
-9pxeloaddebug: lpxe.$O $CORE $LOAD $ETHER nobiosload.$O
- $LD -o $target -T0x80007C00 -l $prereq -lflate -lc -lip
- ls -l $target
- # acid $target
- # map({"text", 0x80010000, 0x80090000, 0x00000020})
-
-9loadlite: l.$O $CORE $LOAD noether.$O nobiosload.$O
- $LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc
- ls -l $target
-
-9loadlitedebug: l.$O $CORE $LOAD noether.$O nobiosload.$O
- $LD -o $target -T0x80010000 -l $prereq -lflate -lc
- ls -l $target
- # acid $target
- # map({"text", 0x80010000, 0x80090000, 0x00000020})
-
-9loadusb: l.$O $CORE $LOAD $ETHER biosload.$O
- $LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
- ls -l $target
-
-9loadask: l.$O $CORE $LOAD $ETHER askbiosload.$O
- $LD -o $target -H3 -T0x80010000 -l $prereq -lflate -lc -lip
- ls -l $target
-
-ld.com: ld.$O $CORE $BCOM
- $LD -o $target -H3 -T0x80080100 -l $prereq -lc
- ls -l $target
-
-lddebug: ld.$O $CORE $BCOM
- $LD -o $target -T0x80080100 -l $prereq -lc
- ls -l $target
- # acid $target
- # map({"text", 0x80080100, 0x800B0000, 0x00000020})
-
-ld.$O: l.s
- $AS -DDOTCOM -o $target l.s
+all: 9bootiso 9bootpxe 9bootfat mbr pbs
+
+clean:V:
+ rm -rf $TARG *.$O test.* tmp
-l.$O: l.s
- $AS -DVGA -o $target l.s
+liso.$O: l.s
+ $AS -DISO -o $target l.s
lpxe.$O: l.s
- $AS -DPXE -DVGA -o $target l.s
-
-lnovga.$O: l.s
- $AS -o $target l.s
-
-lpxenovga.$O: l.s
$AS -DPXE -o $target l.s
-loadverb.$O: load.c
- $CC -o $target $CFLAGS '-DVERBOSE=1' load.c
+lfat.$O: l.s
+ $AS -DFAT -o $target l.s
%.$O: %.s
$AS $stem.s
%.$O: $HFILES
-l.$O pbs.$O pbslba.$O mbr.$O: x16.h
-
-clock.$O floppy.$O trap.$O: ureg.h
-bcom.$O conf.$O devfloppy.$O devsd.$O dosboot.$O fs.$O \
- kfsboot.$O load.$O part.$O: dosfs.h fs.h kfs.h
-ether.$O etherelnk3.$O: etherif.h
-devsd.$O part.$O sdata.$O sdscsi.$O: sd.h
-bootp.$O: ip.h
-
mbr: mbr.$O
$LD -o $target -H3 -T0x0600 -l $prereq
ls -l $target
-pbs&: pbs%.$O
- $LD -o $target -H3 -T0x7C00 -l $prereq
+pbs: pbs.$O
+ $LD -o $target -H3 -T0x0800 -l $prereq
ls -l $target
-pbs&.debug: pbs%.$O
- $LD -o $target -T0x7C00 -l $prereq
+9boot&: l%.$O %.$O sub.$O apm.$O e820.$O a20.$O
+ $LD -o $target -H3 -T0x7c00 -l $prereq
ls -l $target
- # acid $target
- # map({"text", 0x7C00, 0x7E00, 0x00000020})
-
-clean:
- rm -f *.[$OS] [$OS].out y.tab.? y.debug y.output $TARG 9loaddebug lddebug
install:V:
for (i in $TARG)
mk $MKFLAGS $i.install
%.install:V: $BIN/%
-# for (fs in $EXTRACOPIES)
-# 9fs $fs && cp $prereq /n/$fs/$prereq
- ;
+
$BIN/%: %
cp $stem $BIN/$stem
-UPDATE=\
- mkfile\
- ${CORE:%.$O=%.c}\
- ${LOAD:%.$O=%.c}\
- ${BCOM:%.$O=%.c}\
- ${ETHER:%.$O=%.c}\
- $HFILES\
- l.s\
- noether.c\
- pbs.s\
- pbslba.s\
- mbr.s\
- x16.h\
- ureg.h\
- dosfs.h\
- fs.h\
- kfs.h\
- etherif.h\
- sd.h\
- ip.h\
- devfloppy.h\
- ${TARG:%=/386/%}\
-
-update:V:
- update $UPDATEFLAGS $UPDATE
+test.iso: 9bootiso
+ rm -fr tmp $target
+ mkdir tmp
+ mkdir tmp/386
+ mkdir tmp/cfg
+ cp 9bootiso tmp/386
+ cp /386/9pcf tmp/386
+ cp /sys/lib/dist/cfg/plan9.ini tmp/cfg/plan9.ini
+ echo wait >>tmp/cfg/plan9.ini
+ disk/mk9660 -B 386/9bootiso -p /sys/lib/sysconfig/proto/allproto -s tmp $target
+ rm -fr tmp
+
+test.dsk: 9bootfat mbr pbs test.iso
+ rm -fr tmp $target
+ mkdir tmp
+ cp test.iso 9bootfat tmp
+ mkdir tmp/386
+ cp /386/9pcf tmp/386
+ echo 'bootfile=/386/9pcf' >tmp/plan9.ini
+ dd -if /dev/zero -of $target -bs 512 -count 32768
+ disk/partfs -m /n/$target $target
+ disk=/n/$target/sdXX
+ disk/mbr -m mbr $disk/data
+ disk/fdisk -baw $disk/data
+ disk/prep -bw -a 9fat $disk/plan9
+ disk/format -b pbs -d -r 2 $disk/9fat
+ s=$target.dos
+ m=/n/$target.9fat
+ rm -f /srv/$s
+ dossrv -f $disk/9fat $s
+ mount -c /srv/$s $m
+ @{cd tmp; tar c .} | @{cd $m; tar xv}
+ unmount $m
+ rm -f /srv/$s
+ unmount /n/$target
+ rm -fr tmp