1874
|
1 #!/usr/bin/perl
|
1765
|
2 #
|
|
3 # BUNDI - Build the Ultimate NitrOS-9 Disk Image
|
|
4 #
|
1874
|
5 # This script builds the ULTIMATE NitrOS-9 disk image,
|
1765
|
6 # complete with HDB-DOS drives!
|
|
7 #
|
|
8 # The resulting image has a NitrOS-9 partition and an HDB-DOS partition.
|
|
9 # The first drive of the HDB-DOS partition is the HDB-DOS distribution
|
|
10 # diskette. The last drive is the NitrOS-9 boot disk.
|
|
11 #
|
|
12 # Size of image is 90,624 256-byte sectors, which fits in
|
|
13 # $00B100 OS-9 Offset in HDB-DOS
|
|
14 #
|
1770
|
15 # ATTENTION! Set the HDB-DOS offset in your HDB-DOS ROM here! (must be in decimal)
|
1874
|
16 $hdbdos_offset = 45312; # 0x00B100
|
1770
|
17 # ATTENTION! Set the number of HDB-DOS virtual disks (must be in decimal)
|
1874
|
18 $num_hdbdos_disks = 128;
|
|
19 $NITROS9DIR = $ENV{'NITROS9DIR'};
|
|
20 $CLOUD9DIR = $ENV{'CLOUD9DIR'};
|
|
21
|
1770
|
22
|
1874
|
23 # Check for proper number of arguments
|
|
24 $numargs = $#ARGV + 1;
|
|
25 if ($numargs != 2)
|
|
26 {
|
|
27 print "Usage: bundi <bootscript> <diskname>\n";
|
|
28 exit;
|
|
29 }
|
|
30
|
|
31 $scriptname = $ARGV[0];
|
|
32 $diskname = $ARGV[1];
|
1770
|
33
|
1874
|
34
|
|
35 $multiplier = 2;
|
|
36 $os9_sectors = $hdbdos_offset * $multiplier;
|
|
37 printf("Number of sectors: %d\n", $os9_sectors);
|
|
38 $hdb_drives = $num_hdbdos_disks - 2;
|
1765
|
39
|
1874
|
40 print "########## PART I ##########\n";
|
|
41 print "# #\n";
|
|
42 print "# Assemble EVERYTHING! #\n";
|
|
43 print "# #\n";
|
|
44 print "#############################\n\n";
|
1765
|
45
|
1874
|
46 print "Step 1 - Making the ENTIRE NitrOS-9 Project (could take a while)...\n";
|
|
47 #system("cd $NITROS9DIR; make dsk>&/dev/null");
|
1779
|
48
|
1874
|
49 print "Step 2 - Making the HDB-DOS Product...\n";
|
|
50 system("cd $CLOUD9DIR/Products/HDB-DOS/Software; make dsk>&/dev/null");
|
1765
|
51
|
1874
|
52 print "Step 3 - Making the Ved Product...\n";
|
|
53 system("cd $ENV{'CLOUD9DIR'}/Products/Ved/Software; make dsk>&/dev/null");
|
|
54
|
|
55 print "########## PART II ##########\n";
|
|
56 print "# #\n";
|
|
57 print "# Prepare the Disk Image #\n";
|
|
58 print "# #\n";
|
|
59 print "#############################\n\n";
|
1779
|
60
|
1874
|
61 print "Step 1 - Format the disk and make the boot disk\n";
|
|
62 system("os9 format -qe -l$os9_sectors tmp.dsk");
|
|
63 system("./$scriptname>&/dev/null");
|
|
64 system("os9 gen -b=bootfile -t=boottrack tmp.dsk>&/dev/null");
|
|
65 system("os9 copy -o=0 $NITROS9DIR/6309l2/modules/sysgo_dd tmp.dsk,sysgo");
|
|
66 system("os9 attr tmp.dsk,sysgo -epepr");
|
|
67 system("os9 dsave -e $NITROS9DIR/6309l2/nos96309l2_80d.dsk, tmp.dsk, >&/dev/null");
|
|
68 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/uucpbb/uucpbb21_6309.dsk, tmp.dsk, >&/dev/null");
|
|
69 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/cc/cc.dsk, tmp.dsk, >&/dev/null");
|
|
70 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/basic09/basic09v010100.dsk, tmp.dsk, >&/dev/null");
|
|
71 system("os9 dsave -e $CLOUD9DIR/Products/Ved/Software/ved.dsk, tmp.dsk, >&/dev/null");
|
|
72 system("os9 format -qe -ss -dd boot.dsk");
|
|
73 system("os9 gen -b=bootfile -t=boottrack boot.dsk>&/dev/null");
|
|
74 system("rm bootfile boottrack");
|
1779
|
75
|
1874
|
76 print "Step 2 - Build the HDB-DOS drives\n";
|
|
77 system("rm hdbdrives.dsk");
|
|
78 system("decb dskini -h$hdb_drives hdbdrives.dsk");
|
|
79 system("rm hdbdrives2.dsk");
|
|
80 system("cat $CLOUD9DIR/Products/HDB-DOS/Software/hdbdos.dsk hdbdrives.dsk boot.dsk>hdbdrives2.dsk");
|
|
81 system("rm hdbdrives.dsk boot.dsk");
|
|
82 system("decb hdbconv hdbdrives2.dsk hdbdrives.dsk");
|
|
83 system("rm hdbdrives2.dsk");
|
1779
|
84
|
1874
|
85 print "Step 3 - Put it all together\n";
|
|
86 system("rm $diskname");
|
|
87 system("cat tmp.dsk hdbdrives.dsk>$diskname");
|
|
88 system("rm tmp.dsk hdbdrives.dsk");
|
|
89
|
|
90 print "Ok, we're done! The file $diskname is now a fresh disk image.\n";
|