Commit Graph

275 Commits

Author SHA1 Message Date
75c4f35e85 Kernel: Add possibiliity to create empty files on Ext2
Big rewrite for Ext2 for more easy and optimized code
2023-03-23 22:26:06 +02:00
633414bd20 Kernel: Remove block group descriptor cache from ext2fs
This will make improving the fs easier since we need to only update
the values on the disk
2023-03-23 18:52:58 +02:00
9b56801c3d Kernel: StorageDevice and Ext2 "support" writing 2023-03-23 13:04:13 +02:00
dbf7d9f19e Kernel: Ext2 directory functions now fail on invalid blocks
Invalid blocks should only happen while writing to a file and
I think in that case we should just bail out instead of giving
you incomlete inode list or search result.
2023-03-22 01:55:57 +02:00
337463ec16 Kernel: Ext2 can now read from non-block-size aligned offsets 2023-03-21 19:19:17 +02:00
072954480d Kernel: Remove obsolete Ext2FS::ext2_root_inode()
This was not used by anyone and the cast was wrong anyway
2023-03-21 18:19:48 +02:00
3652d11059 Kernel: Remove for_each_block from Ext2 2023-03-21 18:14:02 +02:00
e4bcd98904 Kernel: Add basic mounting to VFS. 2023-03-19 05:51:25 +02:00
3570764448 Kernel: Add comparison operator for inodes 2023-03-19 03:34:23 +02:00
8236598f9d Kernel: Optimize Ext2 disk reads
We used to read whole file until we reached the asked offset.
Now we can calculate the appropriate block and read just the asked data.
2023-03-18 03:47:59 +02:00
1a26a318a4 Kernel: Rework filesystem reading
We now read from a filesystem to user provided buffer.

Read sizes are determined by read call.

You should now get file descriptors and do reading through Process::current()
2023-03-17 21:18:41 +02:00
1f2ceeb329 Kernel: VFS caches currently open inodes 2023-03-16 15:31:33 +02:00
c012822d49 BAN: Rename StringView suffix from _sv to sv 2023-03-16 12:15:16 +02:00
8940ff8002 Kernel: You don't have to check whether VFS is initialized or not
VFS now returns Error when attempting to traverse inodes if it did
not find root partition
2023-03-09 02:31:24 +02:00
fc58baf54d Kernel: if VFS initialization does not find root, we fail 2023-03-09 02:17:42 +02:00
7458f68c38 BAN: Error can now be constructed from c_string or format string
If the resulting string would overflow, we just truncate it to fit
the error message buffer (128) bytes
2023-03-08 17:05:37 +02:00
23b3028e15 Kernel: Rename RefCounted -> RefPtr and implement RefCounted 2023-03-08 03:26:25 +02:00
a9acf1f6dc Kernel: PCIDevice is now class with getters and constructor 2023-03-08 02:41:44 +02:00
52aa98ba25 Kernel+LibC: Add some errno codes
Kernel now returns ENOMEM and other errnos, so we dont have to write
error messages
2023-03-02 21:10:44 +02:00
90a7268e5a BAN: Rewrite RefCounted to return ErrorOr 2023-03-02 12:30:11 +02:00
ee5d02aa70 Kernel: Rewrite basically all current disk io stuff
This is a big commit that was kinda hard to split to smaller ones.

Essentially we now look at all the mass storage devices from PCI
and initialize (P)ATA devices. This doesn't provide any more functionality
but better abstractions and everything doesn't have to be on its old
default port that might be different for modern computers.
2023-02-26 03:00:29 +02:00
5d31e89574 Kernel: Update ErrorOr API and add path find to VFS
These two are done on the same commit since Changes to Shell were
annoying to make work with only one change
2023-02-22 01:23:11 +02:00
038379274e Kernel: Inode can now return full mode value
Kernel::Inode::Mode is an union of bitmasked fields for every
possible bit
2023-02-20 21:39:24 +02:00
efaca469ee Kernel: Ext2Inode now supports indirect blocks through for_each_block() 2023-02-20 10:25:15 +02:00
80006ea137 Kernel: Initial work on filesystem
We support now ext2 directory listing. File reading is not yet supported.
2023-02-20 01:46:00 +02:00