comparison scripts/bundi @ 1875:298e596aa143

New method of creating BUNDIs
author boisy
date Thu, 11 Aug 2005 13:06:24 +0000
parents 9db5440eef21
children 38899e05f2f3
comparison
equal deleted inserted replaced
1874:9db5440eef21 1875:298e596aa143
9 # The first drive of the HDB-DOS partition is the HDB-DOS distribution 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. 10 # diskette. The last drive is the NitrOS-9 boot disk.
11 # 11 #
12 # Size of image is 90,624 256-byte sectors, which fits in 12 # Size of image is 90,624 256-byte sectors, which fits in
13 # $00B100 OS-9 Offset in HDB-DOS 13 # $00B100 OS-9 Offset in HDB-DOS
14
15 use IO::File;
16 use POSIX qw(tmpnam);
17
14 # 18 #
15 # ATTENTION! Set the HDB-DOS offset in your HDB-DOS ROM here! (must be in decimal) 19 # ATTENTION! Set the HDB-DOS offset in your HDB-DOS ROM here! (must be in decimal)
16 $hdbdos_offset = 45312; # 0x00B100 20 $hdbdos_offset = 45312; # 0x00B100
17 # ATTENTION! Set the number of HDB-DOS virtual disks (must be in decimal) 21 # ATTENTION! Set the number of HDB-DOS virtual disks (must be in decimal)
18 $num_hdbdos_disks = 128; 22 $num_hdbdos_disks = 128;
19 $NITROS9DIR = $ENV{'NITROS9DIR'}; 23 $NITROS9DIR = $ENV{'NITROS9DIR'};
20 $CLOUD9DIR = $ENV{'CLOUD9DIR'}; 24 $CLOUD9DIR = $ENV{'CLOUD9DIR'};
25 $DISTRO = "6809l2";
21 26
22 27
23 # Check for proper number of arguments 28 # Check for proper number of arguments
24 $numargs = $#ARGV + 1; 29 $numargs = $#ARGV + 1;
25 if ($numargs != 2) 30 if ($numargs != 3)
26 { 31 {
27 print "Usage: bundi <bootscript> <diskname>\n"; 32 print "Usage: bundi <bootlist> <tracklist> <diskname>\n";
28 exit; 33 exit;
29 } 34 }
30 35
31 $scriptname = $ARGV[0]; 36 $bootlist = $ARGV[0];
32 $diskname = $ARGV[1]; 37 $tracklist = $ARGV[1];
38 $diskname = $ARGV[2];
33 39
34 40
35 $multiplier = 2; 41 $multiplier = 2;
36 $os9_sectors = $hdbdos_offset * $multiplier; 42 $os9_sectors = $hdbdos_offset * $multiplier;
37 printf("Number of sectors: %d\n", $os9_sectors); 43 printf("Number of sectors: %d\n", $os9_sectors);
58 print "# #\n"; 64 print "# #\n";
59 print "#############################\n\n"; 65 print "#############################\n\n";
60 66
61 print "Step 1 - Format the disk and make the boot disk\n"; 67 print "Step 1 - Format the disk and make the boot disk\n";
62 system("os9 format -qe -l$os9_sectors tmp.dsk"); 68 system("os9 format -qe -l$os9_sectors tmp.dsk");
63 system("./$scriptname>&/dev/null"); 69
64 system("os9 gen -b=bootfile -t=boottrack tmp.dsk>&/dev/null"); 70
65 system("os9 copy -o=0 $NITROS9DIR/6309l2/modules/sysgo_dd tmp.dsk,sysgo"); 71 # Read bootlist file and expand any variables
72 open(FILE, "$bootlist") or die ("Unable to open $bootlist");
73 @bootarray = <FILE>;
74 close(FILE);
75 foreach $element (@bootarray)
76 {
77 if ($element =~ /^#/)
78 {
79 $element = "";
80 }
81 else
82 {
83 $element =~ s/\$(\w+)/${$1}/g;
84 $element =~ s/\s+$//;
85 }
86 }
87
88
89
90 $bls = "@bootarray";
91 system("cat $bls>bootfile");
92
93 # Read tracklist file and expand any variables
94 open(FILE, "$tracklist") or die ("Unable to open $tracklist");
95 @trackarray = <FILE>;
96 close(FILE);
97 foreach $element (@trackarray)
98 {
99 if ($element =~ /^#/)
100 {
101 $element = "";
102 }
103 else
104 {
105 $element =~ s/\$(\w+)/${$1}/g;
106 $element =~ s/\s+$//;
107 }
108 }
109
110 $tls = "@trackarray";
111 system("cat $tls>trackfile");
112
113 system("os9 gen -b=bootfile -t=trackfile tmp.dsk>&/dev/null");
114 system("os9 copy -o=0 $NITROS9DIR/$DISTRO/modules/sysgo_dd tmp.dsk,sysgo");
66 system("os9 attr tmp.dsk,sysgo -epepr"); 115 system("os9 attr tmp.dsk,sysgo -epepr");
67 system("os9 dsave -e $NITROS9DIR/6309l2/nos96309l2_80d.dsk, tmp.dsk, >&/dev/null"); 116 system("os9 dsave -e $NITROS9DIR/$DISTRO/nos9$DISTRO_80d.dsk, tmp.dsk, >&/dev/null");
68 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/uucpbb/uucpbb21_6309.dsk, tmp.dsk, >&/dev/null"); 117 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"); 118 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"); 119 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"); 120 system("os9 dsave -e $CLOUD9DIR/Products/Ved/Software/ved.dsk, tmp.dsk, >&/dev/null");
72 system("os9 format -qe -ss -dd boot.dsk"); 121 system("os9 format -qe -ss -dd boot.dsk");
73 system("os9 gen -b=bootfile -t=boottrack boot.dsk>&/dev/null"); 122 system("os9 gen -b=bootfile -t=trackfile boot.dsk>&/dev/null");
74 system("rm bootfile boottrack");
75 123
76 print "Step 2 - Build the HDB-DOS drives\n"; 124 print "Step 2 - Build the HDB-DOS drives\n";
77 system("rm hdbdrives.dsk"); 125 system("rm hdbdrives.dsk");
78 system("decb dskini -h$hdb_drives hdbdrives.dsk"); 126 system("decb dskini -h$hdb_drives hdbdrives.dsk");
79 system("rm hdbdrives2.dsk"); 127 system("rm hdbdrives2.dsk");