SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Nachos filesystem 0.01
    Kang Zhang( jobo.zh@gmail.com )
             2008-12-04
Agenda
Agenda
• History
• Installation
• Your task
• Implementation details
• Hints
History of Nachos
    filesystem
History of Nachos
        filesystem

• Nachos in C++
• Nachos in java( initial version)
• Nachos 5.0j
Installation of
   phase 5
Installation of
     phase 5
1) Download the patch from our
             site.
nachos/
                                 
     filesys/
                                 
     
       Directory.java


  Installation of
                                 
     
       DirectoryEntry.java
                                 
     
       FileHeader.java
                                 
     
       RealOpenFile.java
                                 
     
       FilesysKernel.java


     phase 5                     
                                 
                                 
                                 
                                       
                                       
                                       
                                       
                                               RealFileSystem.java
                                               FilesysProcess.java
                                               RealFileSystemUtil.java
                                               BitMap.java
1) Download the patch from our   
                                 
                                       machine/
                                       
       Machine.java
             site.               
                                 
                                       
                                       
                                               Disk.java
                                               SynchDisk.java
                                 
     
       Lib.java
                                 
     proj5/
                                 
     
       nachos.conf
                                 
     
       Makefile
                                 test/
                                 
     hl.coff
                                 
     hl.c
nachos/
                                  
     filesys/
                                  
     
       Directory.java


  Installation of
                                  
     
       DirectoryEntry.java
                                  
     
       FileHeader.java
                                  
     
       RealOpenFile.java
                                  
     
       FilesysKernel.java


     phase 5                      
                                  
                                  
                                  
                                        
                                        
                                        
                                        
                                                RealFileSystem.java
                                                FilesysProcess.java
                                                RealFileSystemUtil.java
                                                BitMap.java
1) Download the patch from our    
                                  
                                        machine/
                                        
       Machine.java
             site.                
                                  
                                        
                                        
                                                Disk.java
                                                SynchDisk.java
2) Merge these code with yours.   
     
       Lib.java
                                  
     proj5/
                                  
     
       nachos.conf
                                  
     
       Makefile
                                  test/
                                  
     hl.coff
                                  
     hl.c
Installation of phase 5
Installation of phase 5
3) Choose a phase to start with.(e.g. Phase 2)
Installation of phase 5
3) Choose a phase to start with.(e.g. Phase 2)
4) Merge proj5/nachos.conf with proj2/nachos.conf.
Installation of phase 5
3) Choose a phase to start with.(e.g. Phase 2)
4) Merge proj5/nachos.conf with proj2/nachos.conf.
5) Modify FilesysProcess.java and FilesysKernel.java
Installation of phase 5
3) Choose a phase to start with.(e.g. Phase 2)
4) Merge proj5/nachos.conf with proj2/nachos.conf.
5) Modify FilesysProcess.java and FilesysKernel.java

     public class FilesysProcess extends UserProcess{
Installation of phase 5
3) Choose a phase to start with.(e.g. Phase 2)
4) Merge proj5/nachos.conf with proj2/nachos.conf.
5) Modify FilesysProcess.java and FilesysKernel.java

     public class FilesysProcess extends UserProcess{




6) Merge test/ directory with your test/
Installation of phase 5
3) Choose a phase to start with.(e.g. Phase 2)
4) Merge proj5/nachos.conf with proj2/nachos.conf.
5) Modify FilesysProcess.java and FilesysKernel.java

     public class FilesysProcess extends UserProcess{




6) Merge test/ directory with your test/
7) Run phase5 (win)
Installation of phase 5
 3) Choose a phase to start with.(e.g. Phase 2)
 4) Merge proj5/nachos.conf with proj2/nachos.conf.
 5) Modify FilesysProcess.java and FilesysKernel.java

       public class FilesysProcess extends UserProcess{




  6) Merge test/ directory with your test/
  7) Run phase5 (win)

$java nachos.machine.Machine -x hl.coff -[] nachosproj5nachos.conf
Installation of phase 5
Installation of phase 5
8) Done, it works!


nachos 5.0j initializing... config interrupt timer processor console
user-check
grader
hello worldMachine halting!

Ticks: total 551314, kernel 551000, user 314
Disk I/O: reads 18, writes 0
Console I/O: reads 0, writes 11
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
Installation of phase 5
8) Done, it works!


nachos 5.0j initializing... config interrupt timer processor console
user-check
grader
hello worldMachine halting!

Ticks: total 551314, kernel 551000, user 314
Disk I/O: reads 18, writes 0
Console I/O: reads 0, writes 11
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
Limits
Limits

• unsafe for multiple processes
• has limited file size(4k)
• flat directory structure
Overview of nachos filesystem
Overview of nachos filesystem
                                          Nachos

              FileSystem




                                    OpenFile


     StubFileSystem                                           JVM Runtime



              RealFileSystem


                               RealOpenFile    StubOpenFile




           Disk,Directory
            SynchDisk ...
Overview of disk
Overview of disk

               Hard Disk Driver


             root
freemap                       filenodes
          directory
Overview of disk

               Hard Disk Driver


             root
freemap                       filenodes
          directory
Overview of disk

               Hard Disk Driver


             root
freemap                       filenodes
          directory
Overview of disk

               Hard Disk Driver


             root
freemap                       filenodes
          directory
Inside a file
Inside a file
 Helloworld.coff

 File info:

   File length, etc.


 File pointers:


    Sector 1       Sector 2     Sector 3




                    Sector k




   Sector n-2      Sector n-1   Sector n
                                           INode   FNode
Inside a file
 File info:

  File length, etc.


 File pointers:


   Sector 1       Sector 2   Sector 3




                     Sub
 Sector k-1
                   sectors




     Sub             Sub       Sub
   sectors         sectors   sectors
                                        INode   FNode
Directory
Directory

• Directory
 • Contains a list of directory entries
• DirectoryEntry
 • Stores basic info about a file
File
File
• FileHeader
 • Contains pointers to actual data on
   disk.
• SynchDisk
 • For concurrent access.
• RealOpenFile
Your task
Your task

• Remove restrictions on file size and enable
  user to create files as large as the DISK
• Synchronize file access by multiple
  processes to remove problems associated
  with multiprogramming /
  multiprocessing(Optional*)
Your task

• Remove restrictions on file size and enable
  user to create files as large as the DISK
• Synchronize file access by multiple
  processes to remove problems associated
  with multiprogramming /
  multiprocessing(Optional*)

       * : I’ve not designed testcase for it. You need provide testcase by yourself.
Your task ...
Your task ...

• Allow file size to be modified after creation
• Implement hierarchical directory structure
• Implement some sort of performance
  enhancement to your system (Optional)
Your task ...
•   Design the api (rmdir,ls,mkdir) to prove
    your implementation.
    •   ( You need modify syscall.h and start.s to support them, recompile the
        libnachos.a is needed)

    •   (-1 is reserved by our Nachos test framework, don’t define api using
        it)

    •   (be consistent with Unix style. E.g.Your file system should use / instead
        of  .)
Hints
Hints

1. Read the code before you start.
Hints

1. Read the code before you start.
2. Some functions need to be moved.
Hints

1. Read the code before you start.
2. Some functions need to be moved.
3. Take care of cross complier
Hints

1. Read the code before you start.
2. Some functions need to be moved.
3. Take care of cross complier
4. Be patient with the bugs. :-)
Questions ?
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

OSGi and Eclipse RCP
OSGi and Eclipse RCPOSGi and Eclipse RCP
OSGi and Eclipse RCPEric Jain
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Tomek Kaczanowski
 
Git Presentation - Purple Scout AB Malmö
Git Presentation - Purple Scout AB MalmöGit Presentation - Purple Scout AB Malmö
Git Presentation - Purple Scout AB MalmöEmil Erlandsson
 
Spring & Hibernate
Spring & HibernateSpring & Hibernate
Spring & HibernateJiayun Zhou
 

Was ist angesagt? (6)

OSGi and Eclipse RCP
OSGi and Eclipse RCPOSGi and Eclipse RCP
OSGi and Eclipse RCP
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Installing java, eclipse and maven
Installing java, eclipse and mavenInstalling java, eclipse and maven
Installing java, eclipse and maven
 
Git Presentation - Purple Scout AB Malmö
Git Presentation - Purple Scout AB MalmöGit Presentation - Purple Scout AB Malmö
Git Presentation - Purple Scout AB Malmö
 
What is play
What is playWhat is play
What is play
 
Spring & Hibernate
Spring & HibernateSpring & Hibernate
Spring & Hibernate
 

Andere mochten auch

Mesa a Great Destination Presentation
Mesa a Great Destination PresentationMesa a Great Destination Presentation
Mesa a Great Destination PresentationJames Tevault
 
Social media and WIMBN - Wollongong 16 Nov 2011
Social media and WIMBN - Wollongong 16 Nov 2011Social media and WIMBN - Wollongong 16 Nov 2011
Social media and WIMBN - Wollongong 16 Nov 2011Lee Hopkins
 
Taking it to the cloud version 3
Taking it to the cloud version 3Taking it to the cloud version 3
Taking it to the cloud version 3Cory Fowler
 
Visitor Information Centres - social media and digital technology report
Visitor Information Centres - social media and digital technology reportVisitor Information Centres - social media and digital technology report
Visitor Information Centres - social media and digital technology reportLee Hopkins
 
MFAA & Social media - Adelaide 20-03-2014
MFAA & Social media - Adelaide 20-03-2014MFAA & Social media - Adelaide 20-03-2014
MFAA & Social media - Adelaide 20-03-2014Lee Hopkins
 

Andere mochten auch (7)

Mesa a Great Destination Presentation
Mesa a Great Destination PresentationMesa a Great Destination Presentation
Mesa a Great Destination Presentation
 
Dental Wizard
Dental WizardDental Wizard
Dental Wizard
 
Social media and WIMBN - Wollongong 16 Nov 2011
Social media and WIMBN - Wollongong 16 Nov 2011Social media and WIMBN - Wollongong 16 Nov 2011
Social media and WIMBN - Wollongong 16 Nov 2011
 
Taking it to the cloud version 3
Taking it to the cloud version 3Taking it to the cloud version 3
Taking it to the cloud version 3
 
Case studies Social media
Case studies Social mediaCase studies Social media
Case studies Social media
 
Visitor Information Centres - social media and digital technology report
Visitor Information Centres - social media and digital technology reportVisitor Information Centres - social media and digital technology report
Visitor Information Centres - social media and digital technology report
 
MFAA & Social media - Adelaide 20-03-2014
MFAA & Social media - Adelaide 20-03-2014MFAA & Social media - Adelaide 20-03-2014
MFAA & Social media - Adelaide 20-03-2014
 

Ähnlich wie Nachos Filesystem

Con-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With JavassistCon-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With JavassistAnton Arhipov
 
Project Coinより小さなCoin
Project Coinより小さなCoinProject Coinより小さなCoin
Project Coinより小さなCoinKazuki YAMAMOTO
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machineNikhil Sharma
 
Java language: a gentle introduction
Java language: a gentle introductionJava language: a gentle introduction
Java language: a gentle introductionFabio Ferraguto
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDEShweta Oza
 
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-librariesbccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-librariesICS User Group
 
It pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_enIt pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_enGeorge Birbilis
 
java.nio.file for Remote Systems
java.nio.file for Remote Systemsjava.nio.file for Remote Systems
java.nio.file for Remote Systemsjeroen963976
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsSteve Keener
 
ElsassJUG - Le classpath n'est pas mort...
ElsassJUG - Le classpath n'est pas mort...ElsassJUG - Le classpath n'est pas mort...
ElsassJUG - Le classpath n'est pas mort...Alexis Hassler
 
201 core java interview questions oo ps interview questions - javatpoint
201 core java interview questions   oo ps interview questions - javatpoint201 core java interview questions   oo ps interview questions - javatpoint
201 core java interview questions oo ps interview questions - javatpointravi tyagi
 
Jpf model checking
Jpf model checkingJpf model checking
Jpf model checkingthought444
 

Ähnlich wie Nachos Filesystem (20)

Con-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With JavassistCon-FESS 2015 - Having Fun With Javassist
Con-FESS 2015 - Having Fun With Javassist
 
Project Coinより小さなCoin
Project Coinより小さなCoinProject Coinより小さなCoin
Project Coinより小さなCoin
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Java Intro
Java IntroJava Intro
Java Intro
 
Java language: a gentle introduction
Java language: a gentle introductionJava language: a gentle introduction
Java language: a gentle introduction
 
Maven2交流
Maven2交流Maven2交流
Maven2交流
 
Core Java
Core JavaCore Java
Core Java
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDE
 
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-librariesbccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
bccon-2014 dev02 xpages-coffe-from-a-friend-using-third-party-java-libraries
 
It pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_enIt pro dev_birbilis_20101127_en
It pro dev_birbilis_20101127_en
 
Javabeans .pdf
Javabeans .pdfJavabeans .pdf
Javabeans .pdf
 
java.nio.file for Remote Systems
java.nio.file for Remote Systemsjava.nio.file for Remote Systems
java.nio.file for Remote Systems
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
Maven
MavenMaven
Maven
 
Jvm
JvmJvm
Jvm
 
Basic Java I
Basic Java IBasic Java I
Basic Java I
 
ElsassJUG - Le classpath n'est pas mort...
ElsassJUG - Le classpath n'est pas mort...ElsassJUG - Le classpath n'est pas mort...
ElsassJUG - Le classpath n'est pas mort...
 
201 core java interview questions oo ps interview questions - javatpoint
201 core java interview questions   oo ps interview questions - javatpoint201 core java interview questions   oo ps interview questions - javatpoint
201 core java interview questions oo ps interview questions - javatpoint
 
Jpf model checking
Jpf model checkingJpf model checking
Jpf model checking
 

Kürzlich hochgeladen

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Kürzlich hochgeladen (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Nachos Filesystem

  • 1. Nachos filesystem 0.01 Kang Zhang( jobo.zh@gmail.com ) 2008-12-04
  • 3. Agenda • History • Installation • Your task • Implementation details • Hints
  • 4. History of Nachos filesystem
  • 5. History of Nachos filesystem • Nachos in C++ • Nachos in java( initial version) • Nachos 5.0j
  • 6. Installation of phase 5
  • 7. Installation of phase 5 1) Download the patch from our site.
  • 8. nachos/ filesys/ Directory.java Installation of DirectoryEntry.java FileHeader.java RealOpenFile.java FilesysKernel.java phase 5 RealFileSystem.java FilesysProcess.java RealFileSystemUtil.java BitMap.java 1) Download the patch from our machine/ Machine.java site. Disk.java SynchDisk.java Lib.java proj5/ nachos.conf Makefile test/ hl.coff hl.c
  • 9. nachos/ filesys/ Directory.java Installation of DirectoryEntry.java FileHeader.java RealOpenFile.java FilesysKernel.java phase 5 RealFileSystem.java FilesysProcess.java RealFileSystemUtil.java BitMap.java 1) Download the patch from our machine/ Machine.java site. Disk.java SynchDisk.java 2) Merge these code with yours. Lib.java proj5/ nachos.conf Makefile test/ hl.coff hl.c
  • 11. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2)
  • 12. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2) 4) Merge proj5/nachos.conf with proj2/nachos.conf.
  • 13. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2) 4) Merge proj5/nachos.conf with proj2/nachos.conf. 5) Modify FilesysProcess.java and FilesysKernel.java
  • 14. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2) 4) Merge proj5/nachos.conf with proj2/nachos.conf. 5) Modify FilesysProcess.java and FilesysKernel.java public class FilesysProcess extends UserProcess{
  • 15. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2) 4) Merge proj5/nachos.conf with proj2/nachos.conf. 5) Modify FilesysProcess.java and FilesysKernel.java public class FilesysProcess extends UserProcess{ 6) Merge test/ directory with your test/
  • 16. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2) 4) Merge proj5/nachos.conf with proj2/nachos.conf. 5) Modify FilesysProcess.java and FilesysKernel.java public class FilesysProcess extends UserProcess{ 6) Merge test/ directory with your test/ 7) Run phase5 (win)
  • 17. Installation of phase 5 3) Choose a phase to start with.(e.g. Phase 2) 4) Merge proj5/nachos.conf with proj2/nachos.conf. 5) Modify FilesysProcess.java and FilesysKernel.java public class FilesysProcess extends UserProcess{ 6) Merge test/ directory with your test/ 7) Run phase5 (win) $java nachos.machine.Machine -x hl.coff -[] nachosproj5nachos.conf
  • 19. Installation of phase 5 8) Done, it works! nachos 5.0j initializing... config interrupt timer processor console user-check grader hello worldMachine halting! Ticks: total 551314, kernel 551000, user 314 Disk I/O: reads 18, writes 0 Console I/O: reads 0, writes 11 Paging: page faults 0, TLB misses 0 Network I/O: received 0, sent 0
  • 20. Installation of phase 5 8) Done, it works! nachos 5.0j initializing... config interrupt timer processor console user-check grader hello worldMachine halting! Ticks: total 551314, kernel 551000, user 314 Disk I/O: reads 18, writes 0 Console I/O: reads 0, writes 11 Paging: page faults 0, TLB misses 0 Network I/O: received 0, sent 0
  • 22. Limits • unsafe for multiple processes • has limited file size(4k) • flat directory structure
  • 23. Overview of nachos filesystem
  • 24. Overview of nachos filesystem Nachos FileSystem OpenFile StubFileSystem JVM Runtime RealFileSystem RealOpenFile StubOpenFile Disk,Directory SynchDisk ...
  • 26. Overview of disk Hard Disk Driver root freemap filenodes directory
  • 27. Overview of disk Hard Disk Driver root freemap filenodes directory
  • 28. Overview of disk Hard Disk Driver root freemap filenodes directory
  • 29. Overview of disk Hard Disk Driver root freemap filenodes directory
  • 31. Inside a file Helloworld.coff File info: File length, etc. File pointers: Sector 1 Sector 2 Sector 3 Sector k Sector n-2 Sector n-1 Sector n INode FNode
  • 32. Inside a file File info: File length, etc. File pointers: Sector 1 Sector 2 Sector 3 Sub Sector k-1 sectors Sub Sub Sub sectors sectors sectors INode FNode
  • 34. Directory • Directory • Contains a list of directory entries • DirectoryEntry • Stores basic info about a file
  • 35. File
  • 36. File • FileHeader • Contains pointers to actual data on disk. • SynchDisk • For concurrent access. • RealOpenFile
  • 38. Your task • Remove restrictions on file size and enable user to create files as large as the DISK • Synchronize file access by multiple processes to remove problems associated with multiprogramming / multiprocessing(Optional*)
  • 39. Your task • Remove restrictions on file size and enable user to create files as large as the DISK • Synchronize file access by multiple processes to remove problems associated with multiprogramming / multiprocessing(Optional*) * : I’ve not designed testcase for it. You need provide testcase by yourself.
  • 41. Your task ... • Allow file size to be modified after creation • Implement hierarchical directory structure • Implement some sort of performance enhancement to your system (Optional)
  • 42. Your task ... • Design the api (rmdir,ls,mkdir) to prove your implementation. • ( You need modify syscall.h and start.s to support them, recompile the libnachos.a is needed) • (-1 is reserved by our Nachos test framework, don’t define api using it) • (be consistent with Unix style. E.g.Your file system should use / instead of .)
  • 43. Hints
  • 44. Hints 1. Read the code before you start.
  • 45. Hints 1. Read the code before you start. 2. Some functions need to be moved.
  • 46. Hints 1. Read the code before you start. 2. Some functions need to be moved. 3. Take care of cross complier
  • 47. Hints 1. Read the code before you start. 2. Some functions need to be moved. 3. Take care of cross complier 4. Be patient with the bugs. :-)