Coder Social home page Coder Social logo

aos_rvm's Introduction

aos_rvm

Project 4: Advanced Operating Systems (Lightweight Recoverable Virtual Memory)

Team Members: Rudra Purohit (rpurohit3) Kartikay Garg (kgarg40)

STEPS TO COMPILE AND RUN THE TESTCASES:

  1. Extract the contents of the .tar file into a directory.

  2. A makefile has been attached for proper compilation process and to resolve dependencies as per the directory structure explained. Run "make" to make the library as follows: $make

  3. This creates the file librvm.a

  4. Now, you can compile and run the testcases you want after placing the testcase.c file inside the testcases folder. The command to compile and run the basic.c testcase is as follows: $ g++ -o basic basic.c $ ./basic

  1. How log files are used to accomplish persistency and transaction semantics ?
  • In this project, accomplishing persistency is the primary objective which will make the system recoverable from crashes.
  • The redo log files for each segment on the disk in order to ensure persistency of data.
  • There is also an undo record created in memory, that has the original data at the location being modified. When a transaction commits successfully, the new memory value along with its offset is written to the redo log corresponding to that particular segment.
  • But if a transaction aborts or does not commit successfully, the original value from the undo record is written to the corresponding memory location which was being modified by the transaction in order to maintain persistency of data.
  1. What is written in them? How do the files get cleaned up, so that they do not expand indefinitely? The following is written inside the log file in the given order. a.segname_size ( The number of characters of filename ) b.segname ( The filename ) c.offset ( The number of bytes of offset before the changes need to be applied ) d.size ( The number of bytes of data which are actually modified ) e.data

Also, these changes are sequentially written and applied in the order of rvm_about_to_modify() calls in program to ensure consistency in order of changes in the program.

  • The programmer can explicitly call truncate_log() and flush all the changes in each redo log file on the disk to its corresponding data segment. Also, this leads to deletion/cleaning of existing log files after their updation to persistent disk segment files.
  • When map a previously unmapped segment from the file, we call truncate_log internally, to clean up logs, since we anyways have access the disk to fetch the file, thus opportunistically reducing the number of disk accesses.
  • We also call the truncate_log() function internally at time of rvm_init() in order to clean up the log files, ensuring the log files don't expand indefinately due to a previous run.

Directory Structure:

After extracting the contents of the .tar file, a directory named prj4 will be created. The following files and subdirectories should be present inside the prj4 directory:

testcases/ It includes the different testcases.c files which test the implementation of the recoverable virtual memory.

rvm_segments/ The testseg files on compilation are created inside it. This is a representation of the persistent disk storage space.

rvm.cpp - The implementation of recoverable virtual memory interfaces. rvm.h - It contains all the function declarations which are defined in rvm.cpp file. rvm_internal.h - It defines the data structures which are used for the rvm implementation. Makefile -

aos_rvm's People

Contributors

kartikaygarg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.