Skip to content

Filesystems and Ramfs #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8d46456
Add kernel.german.md
niklasmohrin May 30, 2021
0ce7b36
kernel crate: Extend basic kernel types to suit our needs
niklasmohrin May 30, 2021
9bf5e02
kernel crate: Add file system abstractions
niklasmohrin May 30, 2021
c6c55ab
kernel crate: Add vision for dentry and super_block wrappers
niklasmohrin May 30, 2021
ef8f780
bs2ramfs: Add mvp (squashed changes from mvp branch)
niklasmohrin May 30, 2021
1f1b1ff
add `b` and `scp_all` helper scripts
niklasmohrin May 30, 2021
b6bf865
kernel crate & bs2ramfs: Updates from rebase
niklasmohrin May 30, 2021
1123b52
update RUST_TOOLCHAIN in `b` script to recommended nightly
niklasmohrin May 30, 2021
76fc0b7
kernel crate: Use `error::from_kernel_err_ptr` instead of own method
niklasmohrin May 30, 2021
9b936ae
kernel crate: impl Dentry and some nice traits
niklasmohrin May 30, 2021
3e73b13
bs2ramfs: Use new Dentry wrappers and fix warnings
niklasmohrin May 30, 2021
5a972ce
Update kernel.german.md
niklasmohrin Jun 1, 2021
43dea90
bs2ramfs: Inline ramfs_fill_super_impl into fill_super from FileSyste…
niklasmohrin Jun 1, 2021
c0d2013
kernel and bs2ramfs: implement kill_superblock_raw in terms of kill_s…
niklasmohrin Jun 1, 2021
043e0b0
kernel crate: Add Inode wrapper type
niklasmohrin Jun 1, 2021
0ec99bb
kernel crate: Move dentry.rs into fs and use new Inode wrapper type
niklasmohrin Jun 1, 2021
bd13b18
kernel crate: derive PartialEq, Eq for Mode
niklasmohrin Jun 1, 2021
48c8ea4
bs2ramfs: Use new Inode wrapper
niklasmohrin Jun 1, 2021
d65b73f
kernel crate: Add `Error::parse_int`
niklasmohrin Jun 2, 2021
976b826
kernel crate: Add `SeekFrom::into_pos_and_whence`
niklasmohrin Jun 2, 2021
83bb30b
kernel crate: Add `fs::libfs_functions` module
niklasmohrin Jun 2, 2021
7eeb7db
kernel crate: Add `Inode::set_file_operations`
niklasmohrin Jun 2, 2021
61c0ac6
bs2ramfs: Use `Inode::set_file_operations`
niklasmohrin Jun 2, 2021
91fc3c4
kernel crate: Implement generic_read_iter and noop_fsync
bewee Jun 3, 2021
7c747ae
kernel crate: Add pretty simple Kiocb wrapper and fix typo in noop_fsync
bewee Jun 3, 2021
c0cd92d
kernel crate: Allow for custom `read_iter`
bewee Jun 4, 2021
573849b
kernel crate: Add remaining libfs_functions
bewee Jun 6, 2021
2a03342
rustfmt everything and put some underscores on some names
niklasmohrin Jun 6, 2021
84f2e9b
kernel crate: Add SuperOperations
bewee Jun 6, 2021
398ea6b
Add missing libfs functions. Now everything works fine again.
bewee Jun 8, 2021
47aba85
bs2ramfs: make "super" branch merge ready
niklasmohrin Jun 9, 2021
ad7473a
kernel crate: Remove `FileSystem` trait
niklasmohrin Jun 9, 2021
49ad502
kernel crate and bs2ramfs: Clean imports
niklasmohrin Jun 9, 2021
303d67d
bs2ramfs: use `and_then` like it is intended
niklasmohrin Jun 9, 2021
75b740a
kernel crate: use callback pattern instead of methods
niklasmohrin Jun 9, 2021
4051a09
kernel crate: Add InodeOperations
taminob Jun 10, 2021
87fca86
kernel crate: Add libfs functions for inode operations
taminob Jun 10, 2021
9bdd0de
bs2ramfs: Use InodeOperations
taminob Jun 10, 2021
7c014e1
kernel crate: move and delete things in fs.rs
niklasmohrin Jun 10, 2021
7bb81e7
changes needed after compiler settings changed with rebase
niklasmohrin Jun 10, 2021
93db68a
Update README.md
niklasmohrin Jun 12, 2021
24b2718
kernel crate: Adds `ExpectK` trait
niklasmohrin Jun 11, 2021
820536f
kernel crate: Use `expectk` instead of `expect`
niklasmohrin Jun 11, 2021
ecc51d4
kernel crate: add ability to use predefined vtables from kernel
niklasmohrin Jun 12, 2021
656aacd
kernel crate: Add `AddressSpaceOperations`
bewee Jun 16, 2021
2d803fc
kernel crate: Add `dbg` macro
niklasmohrin Jun 12, 2021
74bdb6f
Remove requirement SuperOperations: Default that is not required and …
niklasmohrin Jul 1, 2021
42b163f
bs2ramfs: remove nightly feature declaration
niklasmohrin Jun 23, 2021
8f584b2
Make set_suoer_operations return result
bewee Jul 8, 2021
136ed20
Include our fs/ files in rust-project.json
niklasmohrin Jun 30, 2021
33a5b86
Add AddressSpace wrapper
bewee Jul 8, 2021
aa991ed
Remove get_unmapped_area implementation
bewee Jul 8, 2021
fc6fcc8
Add inode.super_block_mut and use it in bs2ramfs
bewee Jul 8, 2021
fbf95a1
Add FileSystemFlags abstraction and rename bs2ramfs_name
bewee Jul 8, 2021
ae5e0ab
Remove emergency prints
bewee Jul 8, 2021
385e58f
Use impl_flag_methods for FileSystemFlags
niklasmohrin Jul 9, 2021
d87c6fd
clippy things I found
niklasmohrin Jul 9, 2021
d5c94d3
fix build as builtin
niklasmohrin Jul 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Rust for Linux
# Some Modules for Rust for Linux

The goal of this project is to add support for the Rust language to the Linux kernel. This repository contains the work that will be eventually submitted for review to the LKML.
This repository contains the [Rust-for-Linux/linux](https://github.com/Rust-for-Linux/linux) kernel with some additions.

Feel free to [contribute](https://github.com/Rust-for-Linux/linux/contribute)! To start, take a look at [`Documentation/rust`](https://github.com/Rust-for-Linux/linux/tree/rust/Documentation/rust).
- `fs/bs2ramfs`
- various additions to the kernel crate

General discussions, announcements, questions, etc. take place on the mailing list at [email protected] ([subscribe](mailto:[email protected]?body=subscribe%20rust-for-linux), [instructions](http://vger.kernel.org/majordomo-info.html), [archive](https://lore.kernel.org/rust-for-linux/)). For chat, help, quick questions, informal discussion, etc. you may want to join our Zulip at https://rust-for-linux.zulipchat.com ([request an invitation](https://lore.kernel.org/rust-for-linux/CANiq72kW07hWjuc+dyvYH9NxyXoHsQLCtgvtR+8LT-VaoN1J_w@mail.gmail.com/T/)).
For the actual work on the kernel, please refer to [Rust-for-Linux/linux](https://github.com/Rust-for-Linux/linux) and the instructions there.

All contributors to this effort are understood to have agreed to the Linux kernel development process as explained in the different files under [`Documentation/process`](https://www.kernel.org/doc/html/latest/process/index.html).
# Contributors

<!-- XXX: Only for GitHub -- do not commit into mainline -->
This project is part of the [Operating Systems 2 (german)](https://osm.hpi.de/bs2/2021/) lecture at HPI, Potsdam. Our working group consists of

- [Benedikt Weber](https://github.com/bewee)
- [Niklas Mohrin](https://github.com/niklasmohrin)
- [Nils Lißner](https://github.com/TheGrayStone)
- [Tamino Bauknecht](https://github.com/taminob)
8 changes: 8 additions & 0 deletions b
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -x
REPO_DIR=$(dirname $0)
MOD_DIR=$(realpath $REPO_DIR/_mod_inst)
BUILD_DIR=$(realpath $REPO_DIR/bs2build/)

RUSTUP_TOOLCHAIN="nightly-2021-05-29" make LLVM=1 ARCH=x86_64 INSTALL_MOD_PATH="$MOD_DIR" CLIPPY=1 $@
1 change: 1 addition & 0 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if BLOCK
config FS_IOMAP
bool

source "fs/bs2ramfs/Kconfig"
source "fs/ext2/Kconfig"
source "fs/ext4/Kconfig"
source "fs/jbd2/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ obj-$(CONFIG_NETFS_SUPPORT) += netfs/
obj-$(CONFIG_FSCACHE) += fscache/
obj-$(CONFIG_REISERFS_FS) += reiserfs/
obj-$(CONFIG_EXT4_FS) += ext4/
obj-$(CONFIG_BS2_RAMFS) += bs2ramfs/
# We place ext4 before ext2 so that clean ext3 root fs's do NOT mount using the
# ext2 driver, which doesn't know about journalling! Explicitly request ext2
# by giving the rootfstype= parameter.
Expand Down
6 changes: 6 additions & 0 deletions fs/bs2ramfs/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config BS2_RAMFS
tristate "BS2 ramfs"
depends on MMU && RUST
default n
help
Enables the rust implementation of ramfs.
1 change: 1 addition & 0 deletions fs/bs2ramfs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_BS2_RAMFS) += bs2ramfs.o
Loading