Worked on formatting

This commit is contained in:
Leeland Heins 2019-03-11 13:43:45 -05:00 committed by GitHub
parent 2f55ae0c56
commit 3ebf237e7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 9 deletions

View File

@ -1081,7 +1081,26 @@ sub write_key_vol_dir_blk {
return 1; return 1;
} }
#
# Write Volume Directory Block
#
sub write_vol_dir_blk {
my ($pofile, $vol_dir_blk, $prv_vol_dir_blk, $nxt_vol_dir_blk, $dir_ents) = @_;
my $buf = pack $vol_dir_blk_tmpl, ($prv_vol_dir_blk, $nxt_vol_dir_blk, $dir_ents);
if (!write_blk($pofile, $vol_dir_blk, \$buf)) {
print "I/O Error writing block $vol_dir_blk\n";
return 0;
}
return 1;
}
#
# Parse Volume Directory Block # Parse Volume Directory Block
#
sub parse_vol_dir_blk { sub parse_vol_dir_blk {
my ($buf, $mode, $dbg) = @_; my ($buf, $mode, $dbg) = @_;
@ -3054,10 +3073,18 @@ sub format_volume {
write_key_vol_dir_blk($pofile, 0x00, 0x03, 0xf0 | length($volume_name), $volume_name, $creation_ymd, $creation_hm, 0x00, 0x00, 0xc3, 0x27, 0x0d, 0, 0x06, $total_blocks, $dir_ents); write_key_vol_dir_blk($pofile, 0x00, 0x03, 0xf0 | length($volume_name), $volume_name, $creation_ymd, $creation_hm, 0x00, 0x00, 0xc3, 0x27, 0x0d, 0, 0x06, $total_blocks, $dir_ents);
# Write the rest of the Volume Directory blocks. # Write the rest of the Volume Directory blocks.
my $prv_vol_dir_blk = $key_vol_dir_blk;
my $nxt_vol_dir_blk;
for (my $i = $key_vol_dir_blk + 1; $i < 0x06; $i++) { for (my $i = $key_vol_dir_blk + 1; $i < 0x06; $i++) {
#write_vol_dir_blk($i); if ($i == 0x05) {
##FIXME $nxt_vol_dir_blk = 0x00;
} else {
$nxt_vol_dir_blk = $i + 1;
}
write_vol_dir_blk($pofile, $i, $prv_vol_dir_blk, $nxt_vol_dir_blk, $dir_ents);
$prv_vol_dir_blk++;
} }
# Write Volume Bit Map blocks. # Write Volume Bit Map blocks.
my @bitmaps = (); my @bitmaps = ();
$bitmaps[0] = 0x01; ##FIXME -- this assumes a 5.25 floppy. $bitmaps[0] = 0x01; ##FIXME -- this assumes a 5.25 floppy.

14
README
View File

@ -1,16 +1,16 @@
TODO: TODO:
prozap.pl -- partially working prozap.pl -- mostly working
procat.pl -- partially working procat.pl -- mostly working
profree.pl -- mostly working profree.pl -- mostly working
proread.pl -- partially working proread.pl -- partially working
prowrite.pl -- partially working prowrite.pl -- partially working
prorename.pl -- partially working prorename.pl -- mostly working
prodelete.pl -- partially working prodelete.pl -- mostly working
prolock.pl -- partially working prolock.pl -- mostly working
prounlock.pl -- partially working prounlock.pl -- mostly working
procopy.pl -- started procopy.pl -- started
procreate.pl -- partially working procreate.pl -- partially working
proundelete.pl -- started proundelete.pl -- started
proformat.pl -- started proformat.pl -- mostly working