annotate scripts/bundi @ 3027:32a23a8c3332

Fix for all ide rbsuper descripters being set for drive 0
author chawks4
date Fri, 12 Dec 2014 20:48:42 -0600
parents 1e312b144f4d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
1 #!/usr/bin/perl
1765
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
2 #
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
3 # BUNDI - Build the Ultimate NitrOS-9 Disk Image
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
4 #
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
5 # This script builds the ULTIMATE NitrOS-9 disk image,
1765
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
6 # complete with HDB-DOS drives!
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
7 #
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
8 # The resulting image has a NitrOS-9 partition and an HDB-DOS partition.
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
9 # The first drive of the HDB-DOS partition is the HDB-DOS distribution
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
10 # diskette. The last drive is the NitrOS-9 boot disk.
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
11 #
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
12 # Size of image is 90,624 256-byte sectors, which fits in
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
13 # $00B100 OS-9 Offset in HDB-DOS
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
14
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
15 use IO::File;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
16 use POSIX qw(tmpnam);
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
17
1765
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
18 #
1770
fd154c8337f3 added makeboot script
boisy
parents: 1765
diff changeset
19 # ATTENTION! Set the HDB-DOS offset in your HDB-DOS ROM here! (must be in decimal)
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
20 $hdbdos_offset = 45312; # 0x00B100
1770
fd154c8337f3 added makeboot script
boisy
parents: 1765
diff changeset
21 # ATTENTION! Set the number of HDB-DOS virtual disks (must be in decimal)
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
22 $num_hdbdos_disks = 128;
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
23 $NITROS9DIR = $ENV{'NITROS9DIR'};
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
24 $CLOUD9DIR = $ENV{'CLOUD9DIR'};
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
25 $DISTRO = "6809l2";
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
26
1770
fd154c8337f3 added makeboot script
boisy
parents: 1765
diff changeset
27
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
28 # Check for proper number of arguments
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
29 $numargs = $#ARGV + 1;
1880
48ca15748d4e Added Level 1 support
boisy
parents: 1878
diff changeset
30 if ($numargs != 4)
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
31 {
1880
48ca15748d4e Added Level 1 support
boisy
parents: 1878
diff changeset
32 print "Usage: bundi <bootlist> <tracklist> <diskname> <distro>\n";
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
33 exit;
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
34 }
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
35
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
36 $bootlist = $ARGV[0];
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
37 $tracklist = $ARGV[1];
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
38 $diskname = $ARGV[2];
1880
48ca15748d4e Added Level 1 support
boisy
parents: 1878
diff changeset
39 $DISTRO = $ARGV[3];
1770
fd154c8337f3 added makeboot script
boisy
parents: 1765
diff changeset
40
1878
5050142536af Fixed a few problems
boisy
parents: 1876
diff changeset
41 printf("Building '%s' distribution onto '%s'\n", $DISTRO, $diskname);
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
42
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
43 $multiplier = 2;
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
44 $os9_sectors = $hdbdos_offset * $multiplier;
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
45 printf("Number of sectors: %d\n", $os9_sectors);
1933
1e312b144f4d Major changes:
boisy
parents: 1880
diff changeset
46 $hdb_drives = $num_hdbdos_disks - 3;
1765
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
47
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
48 print "########## PART I ##########\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
49 print "# #\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
50 print "# Assemble EVERYTHING! #\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
51 print "# #\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
52 print "#############################\n\n";
1765
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
53
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
54 print "Step 1 - Making the ENTIRE NitrOS-9 Project (could take a while)...\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
55 #system("cd $NITROS9DIR; make dsk>&/dev/null");
1779
c37b7bb2b116 Parameterized the script.... still needs more work
boisy
parents: 1771
diff changeset
56
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
57 print "Step 2 - Making the HDB-DOS Product...\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
58 system("cd $CLOUD9DIR/Products/HDB-DOS/Software; make dsk>&/dev/null");
1765
1512ce78364d New 'bundi' script
boisy
parents:
diff changeset
59
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
60 print "Step 3 - Making the Ved Product...\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
61 system("cd $ENV{'CLOUD9DIR'}/Products/Ved/Software; make dsk>&/dev/null");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
62
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
63 print "########## PART II ##########\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
64 print "# #\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
65 print "# Prepare the Disk Image #\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
66 print "# #\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
67 print "#############################\n\n";
1779
c37b7bb2b116 Parameterized the script.... still needs more work
boisy
parents: 1771
diff changeset
68
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
69 print "Step 1 - Format the disk and make the boot disk\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
70 system("os9 format -qe -l$os9_sectors tmp.dsk");
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
71
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
72
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
73 # Read bootlist file and expand any variables
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
74 open(FILE, "$bootlist") or die ("Unable to open $bootlist");
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
75 @bootarray = <FILE>;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
76 close(FILE);
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
77 foreach $element (@bootarray)
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
78 {
1876
38899e05f2f3 Streamlining how bundi works
boisy
parents: 1875
diff changeset
79 if (($element =~ /^#/) || ($element =~ /^\*/))
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
80 {
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
81 $element = "";
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
82 }
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
83 else
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
84 {
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
85 $element =~ s/\$(\w+)/${$1}/g;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
86 $element =~ s/\s+$//;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
87 }
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
88 }
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
89
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
90 $bls = "@bootarray";
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
91 system("cat $bls>bootfile");
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
92
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
93 # Read tracklist file and expand any variables
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
94 open(FILE, "$tracklist") or die ("Unable to open $tracklist");
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
95 @trackarray = <FILE>;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
96 close(FILE);
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
97 foreach $element (@trackarray)
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
98 {
1876
38899e05f2f3 Streamlining how bundi works
boisy
parents: 1875
diff changeset
99 if (($element =~ /^#/) || ($element =~ /^\*/))
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
100 {
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
101 $element = "";
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
102 }
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
103 else
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
104 {
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
105 $element =~ s/\$(\w+)/${$1}/g;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
106 $element =~ s/\s+$//;
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
107 }
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
108 }
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
109
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
110 $tls = "@trackarray";
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
111 system("cat $tls>trackfile");
1880
48ca15748d4e Added Level 1 support
boisy
parents: 1878
diff changeset
112 system("os9 padrom 4608 trackfile");
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
113
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
114 system("os9 gen -b=bootfile -t=trackfile tmp.dsk>&/dev/null");
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
115 system("os9 copy -o=0 $NITROS9DIR/$DISTRO/modules/sysgo_dd tmp.dsk,sysgo");
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
116 system("os9 attr tmp.dsk,sysgo -epepr");
1878
5050142536af Fixed a few problems
boisy
parents: 1876
diff changeset
117 system("os9 dsave -e $NITROS9DIR/$DISTRO/nos9"."$DISTRO"."_80d.dsk, tmp.dsk, >&/dev/null");
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
118 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/uucpbb/uucpbb21_6309.dsk, tmp.dsk, >&/dev/null");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
119 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/cc/cc.dsk, tmp.dsk, >&/dev/null");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
120 system("os9 dsave -e $NITROS9DIR/3rdparty/packages/basic09/basic09v010100.dsk, tmp.dsk, >&/dev/null");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
121 system("os9 dsave -e $CLOUD9DIR/Products/Ved/Software/ved.dsk, tmp.dsk, >&/dev/null");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
122 system("os9 format -qe -ss -dd boot.dsk");
1875
298e596aa143 New method of creating BUNDIs
boisy
parents: 1874
diff changeset
123 system("os9 gen -b=bootfile -t=trackfile boot.dsk>&/dev/null");
1779
c37b7bb2b116 Parameterized the script.... still needs more work
boisy
parents: 1771
diff changeset
124
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
125 print "Step 2 - Build the HDB-DOS drives\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
126 system("rm hdbdrives.dsk");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
127 system("decb dskini -h$hdb_drives hdbdrives.dsk");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
128 system("rm hdbdrives2.dsk");
1933
1e312b144f4d Major changes:
boisy
parents: 1880
diff changeset
129 system("cat $CLOUD9DIR/Products/HDB-DOS/Software/hdbdos.dsk hdbdrives.dsk $CLOUD9DIR/Products/SuperIDE/Distributions/v1.0/superide.dsk boot.dsk>hdbdrives2.dsk");
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
130 system("rm hdbdrives.dsk boot.dsk");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
131 system("decb hdbconv hdbdrives2.dsk hdbdrives.dsk");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
132 system("rm hdbdrives2.dsk");
1779
c37b7bb2b116 Parameterized the script.... still needs more work
boisy
parents: 1771
diff changeset
133
1874
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
134 print "Step 3 - Put it all together\n";
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
135 system("rm $diskname");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
136 system("cat tmp.dsk hdbdrives.dsk>$diskname");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
137 system("rm tmp.dsk hdbdrives.dsk");
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
138
9db5440eef21 Converted to perl scripts
boisy
parents: 1873
diff changeset
139 print "Ok, we're done! The file $diskname is now a fresh disk image.\n";