Skip to content

A Linux based memory driver, specifically focusing on updating its configuration and adding new functionalities for storing and retrieving files

Notifications You must be signed in to change notification settings

Janadhi14/FileSystemDriver

Repository files navigation

File system driver for Linux

Dev log

  • Initally I have added rules to the Makefile to create store-prog and retrieve-rpog from the store.c and retrieve.c source files which include the -g -W -Wall flalgs duign the compilation.
  • Starting with storing files,established the CLI argument with 2 arguments and if it's not 2 then we ar exiting with failure.
  • implementing the second CLI argument so that if we have -r we are going to call the' randomise flag
  • implemented the check to see if the MAXSIZE is larger than 4864 and then print out "truncated" if it is larger.
  • implemented reading a file and error handeling if we can't open the file.
  • implemented writing block directly
  • implementing indirect block writing
  • handled storing file data if there is an unfilled block at the end.(not sure if implemented properly tho)
  • implemented truncation, and randomisation with NDIRECT adressing
  • implemented the CLI arguments for both overwriting by asking y/n and also of the CLI argument usage is wrong
  • implemented the reading a file logic, to do this I have used the read_block to first to create a read inode method which will be used to ditermine the order of the blocks
  • Completed the direct blocks logic so we are able to read the data from the direct blocks(not truncated)If we are not in NDIRECT, i think i need to for loop through and check that we are not at the end of the inode, need to then read block by block of the direct and then write to the file, need to somehow keep track of how much of the file has been written of how much is left .
  • If there is a NDIRECT (could check using the reaminder) we need to go through the NDIRECT block adn read in the block numbers and then write them into the file aswell.
  • Competed working with direct addresses, need to check on NDIRECT
  • not working with ndirect so debugging (there were problems with the type, using int8_t insted of int, so has been fixed , wokring properly as i should in terminal, checking if it is working with writing to the file)
  • DONE! working sucessfully with writing to file

to do list:

In libmemdrv.h update BLOCK_SIZE and MAX_BID to 64 and 78.

  • update block size
  • max_bid
  • add rules to create store-prog and retrieve prog from the store.c and - - [x] retrieve.c source file and makeusr to include the flags -g -W -Wall during compilation

Store files

  • accept a file name as the first arg to be stored /dev/memdrv

  • accept a second argument -r to specify random block ordering

  • check if the file length exceeds 4864 bytes.

  • if exceeded, truncate the file and print “truncated” to /stderr/

  • store the file data in /dev/memdrv

  • if -r is provided, ensure the blocks are stored in a random order

  • testing (works accordingly)

Retrieve files

  • handles CL arguments

  • if no argument is provided output the retireved file

  • if an arg is provided, it should be considered as the output file name

  • if the file name exists promt the uer to confirm overwriting

  • data retrieval to ensure no assumption of data block seq

  • retrieve the dat blocs even if stored in a random order on the RAM

  • ensure file is identical to the origional

  • use a command like ./store-prog myfile.txt to store fiels according to indexed allocation

  • use diff to compare teh origional and retrieved files to check they are the same

  • testing

  • debugging

final

  • error handelling
  • final check

About

A Linux based memory driver, specifically focusing on updating its configuration and adding new functionalities for storing and retrieving files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published