SlideShare une entreprise Scribd logo
1  sur  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!

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 

Dernier (20)

Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 

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. :-)