From 7daa5f7a6425129cc58b80de4551b69276f3e232 Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Thu, 10 Mar 2016 16:36:45 +1000 Subject: [PATCH] Get mkfs7 to write 8000 empty blocks to fill the bottom half before the real filesystem in the top half. --- tools/mkfs7 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/mkfs7 b/tools/mkfs7 index b99b200..c3f96f5 100755 --- a/tools/mkfs7 +++ b/tools/mkfs7 @@ -480,7 +480,7 @@ sub dump_image { my ( $format, $output ) = @_; open( my $OUT, ">", $output ) || die("Can't write to $output: $!\n"); - # list: Octal output with block comments + # list: Octal output with block comments. We don't dump the first 8K blocks if ( $format eq "list" ) { foreach my $blocknum ( 0 .. NUMBLOCKS - 1 ) { printf( $OUT "Block %d (%06o)\n", $blocknum, $blocknum ); @@ -506,6 +506,14 @@ sub dump_image { # ptr: Each word into three bytes, a sixbit in each one if ( $format eq "ptr" ) { + # Dump 8000 empty blocks first + foreach my $blocknum ( 0 .. NUMBLOCKS - 1 ) { + foreach my $offset ( 0 .. WORDSPERBLK ) { + print( $OUT word2three( 0 ) ); + } + } + + # Now the real blocks foreach my $blocknum ( 0 .. NUMBLOCKS - 1 ) { foreach my $offset ( 0 .. WORDSPERBLK ) { print( $OUT word2three( $Block[$blocknum][$offset] || 0 ) ); @@ -515,6 +523,14 @@ sub dump_image { # simh: Each word into four bytes, little endian if ( $format eq "simh" ) { + # Dump 8000 empty blocks first + foreach my $blocknum ( 0 .. NUMBLOCKS - 1 ) { + foreach my $offset ( 0 .. WORDSPERBLK ) { + print( $OUT pack( "CCCC", 0,0,0,0)); + } + } + + # Now the real blocks foreach my $blocknum ( 0 .. NUMBLOCKS - 1 ) { foreach my $offset ( 0 .. WORDSPERBLK ) { my $word = $Block[$blocknum][$offset] || 0;