《 Operating Systems》
Module Practice Report
姓名、学号:
学院、班级:
2011 级计算机全英创新班
1.Module Practice Introduction
1 . 1 R e q u i r e m e n t s
1.Simulate a Unix file system on your Windows Platform
2.Understand the file system on Unix system, and the usage of i-nodes
3.Implement the function of sub-directory
4.The task needs to be completed using C++ or C
2.Data structure design
2 . 1 D i s k S t r u c t u r e
1 6 M
B o o t S u p e r D a t a b l o c k D a t a b l o c k s
B l o c k B l o c k b i t m a p
I _ n o d e
b i t m a p I _ n o d e B l o c k
Boot block:Keep record of the user information login ID and password and who is the current
user.
Super block:Store the keep parameter will be used in the running time.
Super block:
N u m b e r t o t a l d a t a b l o c k s
N u m b e r o f f r e e d a t a b l o c k s
P o i n t e r o f f i r s t d a t a b l o c k
P o i n t e r o f f i r s t I _ n o d e
P o i n t e r o f l a s t I _ n o d e
N u m b e r o f f r e e I _ n o d e s
P o i n t e r o f I _ n o d e b i t m a p
P o i n t e r o f d a t a b l o c k b i t m a p
S i z e o f t h e d a t a b l o c k
U s e r ’ s d i r e c t o r y
U s e r ’ s c u r r e n t w o r k i n g d i r e
I_node bit map:Use a boolean array to keep record of which i_node is free which one is
occupied.
Data block bit map:Use a boolean array to keep record of which data block is free which one
is occupied.
I_node: A structure used to store the file attribute and the data blocks address for the file.
Owner’s ID
Create time
Last access time
Last modification time
File type
File lock
Read only flag
Current size
Max size
10 direct addresses
2 indirect addresses
Soft link address
Offset in share directory
Data blocks:The uniform size of the data blocks is 1024 bytes and there are used to keep
record of the directory structure and the indirect address of the file block and the user file
content.
2.2 data structure definition codes:
2.2.1.The whole disk structure :
2.2.2Boot block:
2.2.3Super block:
2.2.4I_node structure:
Directory
2.2.5.Definition of data blocks:
User data
2.3Directory structure
Root
A
B
C
share
A
A
share
B
B
share
C
C
A
A
B
C
C
C
B
Root directory only
admin can access it
User directory
All the user except the admin can not access another’s
file ,but they can share file to other user by soft link