Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ZenFS Backends and Emulation of Linux

Built with Ona KDE Eco Blue Angel

Caution

This is still being developed and the API is not completely stable yet.

This package serves as a best-effort emulation of Linux-specific behavior for ZenFS.

Kernel modules

The foundational part of @zenfs/linux is it's kernel module API.

Modules are loaded with init and unloaded with dispose. Unlike Linux, both are async, since a module may need to do something asynchronous before it is ready. While init runs, the module is in the init state (Linux calls this COMING).

import { Module } from '@zenfs/linux';

const mod = new Module({
	name: 'example',
	version: '1.0.0',
	license: 'GPL',
	params: {
		debug: { value: false, changed: value => console.log('debug is now', value) },
	},
	init() {
		if (this.param('debug')) console.log('loading');
	},
	exit() {
		// clean up
	},
});

await mod.init();

await mod.dispose();

Modules can depend on each other using their use method, which takes a reference on the target and adds a link in its holders directory. A module that is still referenced can't be unloaded without forcing, which taints it with F.

Filesystems

The following filesystems are (will be) provided:

  • sysfs (/sys)
  • debugfs (/sys/kernel/debug)
  • configfs (/sys/kernel/config)
  • procfs (/proc)
  • devtmpfs (/dev)

License

@zenfs/linux is licensed under the LGPL 3.0 or later and COPYING.md. Copyright © James Prevett and other ZenFS contributors.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages