This is the beginnings of a alternative version of the PDP-7 Unix
system which corresponds to a later development point, around mid-1971, where the system had lost the "dd" directory and gained . and .. entries. This is close to the system as described in http://www.tuhs.org/Archive/PDP-11/Distributions/research/McIlroy_v0/UnixEditionZero.txt except there are no pathnames. To use this version: cd build; make alt; make altrun
This commit is contained in:
+10
-3
@@ -57,7 +57,7 @@ use constant D_UNIQ => 5;
|
||||
use constant D_NUMWORDS => 8; # Eight words in a direntry
|
||||
|
||||
# Globals
|
||||
my $debug = 0;
|
||||
my ($debug, $no_dd) = (0,0);
|
||||
my @Block; # Array of blocks and words in each block
|
||||
my @Freelist; # List of free block numbers
|
||||
my @Usedlist; # List of in-use block numbers
|
||||
@@ -271,7 +271,10 @@ sub usage {
|
||||
|
||||
### MAIN PROGRAM
|
||||
|
||||
GetOptions( 'debug|d' => \$debug, )
|
||||
GetOptions(
|
||||
'debug|d' => \$debug,
|
||||
'no_dd|3' => \$no_dd,
|
||||
)
|
||||
or usage();
|
||||
|
||||
usage() if ( @ARGV < 1 );
|
||||
@@ -327,6 +330,10 @@ foreach my $inode ( 0 .. NUMINODEBLKS * INODESPERBLK - 1 ) {
|
||||
}
|
||||
|
||||
# Now check the directories. We start with dd at i-num 4.
|
||||
check_directory( 4, "dd" );
|
||||
if ($no_dd) {
|
||||
check_directory( 2, "" );
|
||||
} else {
|
||||
check_directory( 4, "dd" );
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
+7
-4
@@ -55,7 +55,7 @@ use constant D_UNIQ => 5;
|
||||
use constant D_NUMWORDS => 8; # Eight words in a direntry
|
||||
|
||||
# Globals
|
||||
my ($debug,$wantdot,$wantdotdot)=(0,0,0);
|
||||
my ($debug,$wantdot,$wantdotdot, $no_dd)=(0,0,0,0);
|
||||
my @Block; # Array of blocks and words in each block
|
||||
my @Freelist; # List of free block numbers
|
||||
my $nextinum = 1; # i-num 0 is never used
|
||||
@@ -353,9 +353,11 @@ sub make_dir {
|
||||
}
|
||||
|
||||
# Finally, add a "dd" entry to this directory. We get the
|
||||
# i-num from the first entry in the Dirstack
|
||||
add_direntry( "dd", $Dirstack[0]->[2] );
|
||||
dprintf("Added a dd entry to i-num %d\n", $Dirstack[0]->[2] );
|
||||
# i-num from the first entry in the Dirstack. Sorry for the dbl negative.
|
||||
if (!$no_dd) {
|
||||
add_direntry( "dd", $Dirstack[0]->[2] );
|
||||
dprintf("Added a dd entry to i-num %d\n", $Dirstack[0]->[2] );
|
||||
}
|
||||
|
||||
dprintf( "Made directory %s perms %06o uid %d in inum %d\n\n",
|
||||
$dirname, $perms, $uid, $inum );
|
||||
@@ -643,6 +645,7 @@ GetOptions(
|
||||
'debug|d' => \$debug,
|
||||
'dot|1' => \$wantdot,
|
||||
'dotdot|2' => \$wantdotdot,
|
||||
'no_dd|3' => \$no_dd,
|
||||
'format|f=s' => \$format,
|
||||
'output|o=s' => \$output,
|
||||
) or usage();
|
||||
|
||||
Reference in New Issue
Block a user