Giter VIP home page Giter VIP logo

lwext4_rust's Introduction

lwext4 in Rust

To provide the rust interface, lwext4 is abstracted in Rust language.

lwext4 is an ext2/ext3/ext4 filesystem library in C for microcontrollers

Supported features

  • lwext4_rust for x86_64, riscv64 and aarch64 on Rust OS is supported
  • File system mount and unmount operations
  • Filetypes: regular, directories, softlinks
  • Journal recovery & transactions
  • memory as Block Cache

Quick start on Rust OS

rust on arceos/starry

Wrap up the file operations

Wrap up the file operation struct Ext4File. It can provide the file system interfaces for the upper layer of Rust OS.

For the specific code, please refer to ext4fs.rs

Ext4File operations include: file_read, file_write, file_seek, file_open, file_close, file_rename, lwext4_dir_entries ...

Implement interface for disk operations

These operate the physical disk through the interface of disk driver.

impl KernelDevOp for Disk {
    type DevType = Disk;
    fn read() {}
    fn write() {}
    fn seek() {}
    fn flush() {}
}

Create a file system object

New a file system object, initialize and mount the ext4 file system.

let ext4fs = 
Ext4BlockWrapper::<Disk>::new(disk).expect("failed to initialize EXT4 filesystem");

Compile lwext4_rust separately

cargo build -vv --target x86_64-unknown-none | riscv64gc-unknown-none-elf | aarch64-unknown-none-softfloat

OR If you need to compile the lwext4 in C separately,

please run make musl-generic -C c/lwext4 ARCH=<x86_64|riscv64|aarch64>

Dependencies

Reference

lwext4_rust's People

Contributors

elliott10 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.