Changed the filesystem proto file and enhanced the mkfs7 tool based on
Phi's analysis of the filesystem.
This commit is contained in:
@@ -47,6 +47,8 @@ use constant I_OWNERWRITE => 0000004;
|
|||||||
use constant I_WORLDREAD => 0000010;
|
use constant I_WORLDREAD => 0000010;
|
||||||
use constant I_WORLDWRITE => 0000004;
|
use constant I_WORLDWRITE => 0000004;
|
||||||
|
|
||||||
|
use constant I_LINK => 0000001; # Never used in an i-node: just internal use
|
||||||
|
|
||||||
# Directory field offsets
|
# Directory field offsets
|
||||||
use constant D_INUM => 0;
|
use constant D_INUM => 0;
|
||||||
use constant D_NAME => 1;
|
use constant D_NAME => 1;
|
||||||
@@ -388,6 +390,7 @@ sub parse_perms {
|
|||||||
|
|
||||||
$filetype = I_DIRECTORY if ( $permstring =~ m{^d} );
|
$filetype = I_DIRECTORY if ( $permstring =~ m{^d} );
|
||||||
$filetype = I_SPECIAL if ( $permstring =~ m{^i} );
|
$filetype = I_SPECIAL if ( $permstring =~ m{^i} );
|
||||||
|
$filetype = I_LINK if ( $permstring =~ m{^l} );
|
||||||
|
|
||||||
$perms |= I_OWNERREAD if ( $permstring =~ m{^.r} );
|
$perms |= I_OWNERREAD if ( $permstring =~ m{^.r} );
|
||||||
$perms |= I_OWNERWRITE if ( $permstring =~ m{^..w} );
|
$perms |= I_OWNERWRITE if ( $permstring =~ m{^..w} );
|
||||||
@@ -439,6 +442,12 @@ sub parse_proto_file {
|
|||||||
add_special( $name, $perms, $uid, $inum );
|
add_special( $name, $perms, $uid, $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
if ( $type eq I_LINK ) {
|
||||||
|
my ( $name, $permstr, $inum ) = @words;
|
||||||
|
dprint("Adding link in curdir to $name inum $inum\n");
|
||||||
|
add_direntry( $name, $inum );
|
||||||
|
next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
close($IN);
|
close($IN);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -4,6 +4,7 @@
|
|||||||
# filename f[r-][w-][r-][r-] uid local_file_to_insert
|
# filename f[r-][w-][r-][r-] uid local_file_to_insert
|
||||||
# dirname d[r-][w-][r-][r-] uid [inumber]
|
# dirname d[r-][w-][r-][r-] uid [inumber]
|
||||||
# device i[r-][w-][r-][r-] uid inumber
|
# device i[r-][w-][r-][r-] uid inumber
|
||||||
|
# link l---- inumber
|
||||||
#
|
#
|
||||||
# The top directory's name is ignored
|
# The top directory's name is ignored
|
||||||
# Numeric values are in decimal
|
# Numeric values are in decimal
|
||||||
@@ -13,13 +14,15 @@
|
|||||||
dd drw-- -1 2
|
dd drw-- -1 2
|
||||||
system drw-- -1 3
|
system drw-- -1 3
|
||||||
init frwr- -1 ../bin/init
|
init frwr- -1 ../bin/init
|
||||||
$
|
|
||||||
ttyin irwr- -1 6
|
ttyin irwr- -1 6
|
||||||
keyboard irwr- -1 7
|
keyboard irwr- -1 7
|
||||||
pptin irwr- -1 8
|
pptin irwr- -1 8
|
||||||
ttyout irwr- -1 10
|
ttyout irwr- -1 10
|
||||||
display irwr- -1 11
|
display irwr- -1 11
|
||||||
pptout irwr- -1 12
|
pptout irwr- -1 12
|
||||||
|
sh frwr- -1 ../bin/sh
|
||||||
|
$
|
||||||
|
|
||||||
as frwr- -1 ../bin/as
|
as frwr- -1 ../bin/as
|
||||||
cat frwr- -1 ../bin/cat
|
cat frwr- -1 ../bin/cat
|
||||||
chmod frwr- -1 ../bin/chmod
|
chmod frwr- -1 ../bin/chmod
|
||||||
@@ -31,9 +34,10 @@ dd drw-- -1 2
|
|||||||
ln frwr- -1 ../bin/ln
|
ln frwr- -1 ../bin/ln
|
||||||
ls frwr- -1 ../bin/ls
|
ls frwr- -1 ../bin/ls
|
||||||
mv frwr- -1 ../bin/mv
|
mv frwr- -1 ../bin/mv
|
||||||
sh frwr- -1 ../bin/sh
|
|
||||||
stat frwr- -1 ../bin/stat
|
stat frwr- -1 ../bin/stat
|
||||||
ken drwr- 10
|
ken drwr- 10
|
||||||
|
system l---- 3
|
||||||
$
|
$
|
||||||
dmr drwr- 12
|
dmr drwr- 12
|
||||||
|
system l---- 3
|
||||||
$
|
$
|
||||||
|
|||||||
Reference in New Issue
Block a user