Comments (16)
The Block I/O subsystem is a bit off-topic so the first goal would be writing ext2 reader/writer library.
from kerla.
Great! If I work on this topic I will:
- Survey how existing OS kernels implement file systems, block I/O subsystem, and how they cache file/disk contents.
- Write virtio-blk device driver.
- Write block IO and caching subsystem.
- Look for file system which is easy to implement: ext2 is a promising candidate. Newer feature-rich filesystems like btrfs and zfs would be too complicated for the first step.
- Add ext2 (or something) output support in
docker2initramfs.py
. You might want to usevirt-make-fs
to do this task. - Implement filesystem reader/writer no_std library: it will depends on a simple
Disk
trait like:
trait Disk {
fn read_block(&mut self, lba: usize, buf: &mut [u8]) -> Result<usize /* # of bytes actually read */, DiskError>;
fn write_block(&mut self, lba: usize, buf: &[u8]) -> Result<usize /* # of bytes actually written */, DiskError>;
}
- Integrate the library into Kerla.
- Attach the disk to QEMU (
-device virtio-blk-pci,...
).
First, I recommend you to learn how file I/O works in major operating systems like Linux and FreeBSD. I think this book is a good start point to learn the internals.
from kerla.
You don't need to say that! Please feel free to ask me anything even if the question is trivial. It also helps me to write docs 👍
from kerla.
There is an updated fork https://github.com/rcore-os/ext2-rs which is in better shape than original
from kerla.
@pi-pi3 the original author of that crate is my countryman, but it seems he abandoned GitHub after Microsoft bought it. His profile on GitLab is private, so we cannot count on his contribution.
I wonder if @jiegec would like to contribute.
from kerla.
I am more animalistic about implementing a file system.
But I can only start with some simple tasks, Can we first determine the specific plan and then list the task list?
from kerla.
A great plan, thanks, I will first understand the implementation of the linux file system by reading this book.
Are we sure to implement the ex2 file system?
from kerla.
Are we sure to implement the ex2 file system?
Yes. I agree ext2 is the best for the first file system implementation because ext2 and its descendants ext3/ext4 are popular and well-known: there're good articles, sample implementations, and tools.
from kerla.
Can I suggest starting from simpler filesystem, potentially some FAT derivative might be easier for start.
from kerla.
Of course! Other file system implementations are also welcome. That said, I think FAT is a good for us because:
- It's not designed for UNIX-like operating systems: it lacks attributes such as permissions.
- Part of the spec is protected by Microsoft's patent.
Perhaps minixfs could be interesting.
from kerla.
That might be interesting, maybe we should have a VFS?
from kerla.
Kerla already has a sort of file system abstraction 😃 You can mount an arbitrary file system here:
Line 42 in 00f9c96
from kerla.
cool,It seems that I did not understand kerla carefully,That's not great
from kerla.
That said, I think FAT is a good for us because:
- It's not designed for UNIX-like operating systems: it lacks attributes such as permissions.
- Part of the spec is protected by Microsoft's patent.
While it's not designed for UNIX, it's very simple to implement - and I suggest that as starting point and test thing. Keep in mind to use SD Cards you pretty often need FAT and/or exFAT support as this filesystem in part of the SD Card specification. Moreover, (FAT is already implemented in Rust](https://github.com/rafalh/rust-fatfs). Metadata can be mapped via hidden files.
Most FAT patents expired already, potentially there are some for exFAT.
from kerla.
Makes sense. We need to support FAT anyway in the future to support some boards like Raspberry Pi.
from kerla.
I see https://github.com/pi-pi3/ext2-rs which could be a starting point but not sure how usable it is for this purpose
from kerla.
Related Issues (20)
- Eliminate O(n) loops in the TCP/IP stack
- Implement eventfd(2)
- Implement block I/O layer
- `RootFs` need to be cloneable, so the whole state can be copies instead of inherit a reference on `fork()`/`clone()` HOT 3
- `OpenedFileTable` needs to be shareable HOT 1
- `SignalDelivery` needs to be shareable HOT 1
- Compress symbol table HOT 3
- help needed HOT 1
- Change license to Mozilla public license version 2 for Linux kernel compatibility HOT 1
- building error HOT 6
- Replace `kerla_utils::bitmap` with `bitvec::array::BitArray`
- Add lifetime to `PAddr` and `VAddr`
- Bumped `bitvec` don't pass build invoked with `make check`
- Implement Virtio Block Driver HOT 3
- panic when make run HOT 4
- Make log messages less verbose
- Start implementation of `clone` syscall HOT 1
- Make dependencies broken
- exec `make` have a rpc receive error HOT 9
- Amendment to licensing contract ( Refer to Issue #5 and PR #100 for more info ) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kerla.