Skip to main content

Read and write xv6 file system disk images; mount them with FUSE on Linux.

Project description

xv6 Filesystem Reader

Tool to read and write disk images of the xv6 file system. Mount the image with FUSE on Linux, extract its contents to disk, or edit files inside the image.


Academic context

This project is used in the Operating Systems course at FaMAF – UNC (Facultad de Matemática, Astronomía, Física y Computación, Universidad Nacional de Córdoba).

It lets you inspect and modify xv6 disk images (e.g. fs.img) from Linux without running xv6: mount the file system, list directories, read and edit files, and save changes back to the image.


Features

  • Read: list directories, read files and device nodes from the xv6 file system.
  • Write: modify existing files; changes are persisted to the image when using the --write option when mounting.
  • FUSE mount: use the image as a directory on Linux (ls, cat, editors, etc.).
  • Extract: dump the entire file system contents to a local directory (./root/).
  • Easy install: install via pip or pipx; two commands: xv6fs (mount) and xv6fs-extract (extract).

Requirements

  • Python 3.7 or newer.
  • libfuse (to mount the file system).
    On Debian/Ubuntu:
    sudo apt install libfuse-dev
    

Installation

With pipx (recommended)

From the project directory:

pipx install .

The commands xv6fs and xv6fs-extract will be available on your PATH.

With pip (virtualenv or development)

pip install -e .

To include publish dependencies (build, twine) as well:

pip install -e ".[dev]"

Usage

Mount the image (FUSE)

Mount the image as a directory. You can use ls, cat, editors, etc.

# Read-only (default)
xv6fs fs.img /mnt/xv6

# Read and write (changes are saved to the image)
xv6fs fs.img /mnt/xv6 --write

The mount point must exist; create it if needed:

mkdir -p /mnt/xv6
xv6fs fs.img /mnt/xv6 --write

To unmount:

fusermount -u /mnt/xv6

Extract to disk

Extract the full file system contents into the current directory under ./root/:

xv6fs-extract fs.img

This creates the directory tree and files under ./root/ (e.g. ./root/init, ./root/etc/hostname, etc.).


Publishing to PyPI

To publish the package to PyPI (project maintainers):

  1. Install publish dependencies:

    pip install -e ".[dev]"
    
  2. Configure PyPI credentials (token at pypi.org/manage/account/token/) in ~/.pypirc or via environment variables.

  3. Run the script from the project root (with your venv activated if you use one):

    chmod +x scripts/publish_to_pypi.sh
    ./scripts/publish_to_pypi.sh           # publish to PyPI
    ./scripts/publish_to_pypi.sh --test    # publish to Test PyPI
    ./scripts/publish_to_pypi.sh --build-only   # only build dist/, do not upload
    

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xv6_filesystem_reader-0.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xv6_filesystem_reader-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file xv6_filesystem_reader-0.2.0.tar.gz.

File metadata

  • Download URL: xv6_filesystem_reader-0.2.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xv6_filesystem_reader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 70c9a031fbc9fd12f30de5da751b0d143df1f56dc443c055f48e2134e3065508
MD5 c122a3fe6f6d12ef50e23e1a214be40e
BLAKE2b-256 a96c0b46219df066939db48a5e80d81fa4f5058e5314508f9a1690c264b32145

See more details on using hashes here.

File details

Details for the file xv6_filesystem_reader-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xv6_filesystem_reader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbd9ffe607f065845f07f8c3d55cbd26281b2c6f26d40f80e3d4ae8c93535f1c
MD5 6312ba98456073ff1ac78ca8326739c5
BLAKE2b-256 4aad394e283e3cc5b228c1ac670c1750dda2f85cdb30186965e814968129672b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page