Commit Graph

30 Commits

Author SHA1 Message Date
Bananymous e209ca7c82 Kernel: Rewrite directory listing so it can be integrated to libc 2023-06-11 00:17:18 +03:00
Bananymous 232fdcb82c Kernel: add basic support for symlinks 2023-06-01 00:24:45 +03:00
Bananymous 8d6db168d6 Kernel: remove message from BAN::Error
We don't store the error message anymore in BAN::Error.
Instead we store a error code that can be mapped into a string.
This allows BAN::Error to only take 4 bytes instead of 128.

We should also make some kernel initialization just panic instead
of returning errors since they are required for succesfull boot
anyway.
2023-04-11 23:25:21 +03:00
Bananymous 79090c2648 Kernel: cleanup includes
I went quickly went through all files since I found some weird
includes :D
2023-04-01 02:14:49 +03:00
Bananymous 5da801d12b Kernel: fix ext2 failed creation memory leak 2023-04-01 00:22:03 +03:00
Bananymous 5b3a00c64f Kernel: Inode::Mode is now a struct so we can have functions in it 2023-03-30 14:41:15 +03:00
Bananymous 06ce1f0667 Kernel: Rewrite mounting code 2023-03-29 21:34:48 +03:00
Bananymous 1fb8c211f0 Kernel: Move Partition out of StorageDevice and rename functions 2023-03-29 13:23:01 +03:00
Bananymous f8a2c60c8d Kernel/BAN: move unix time conversion to BAN and add stat to Shell 2023-03-27 00:49:58 +03:00
Bananymous 770f7716a0 Kernel: Rework processes and VFS so we don't expose inodes
Everything is now done through a file descriptor.
2023-03-26 04:30:57 +03:00
Bananymous 7d2ab53baa Kernel: Ext2FS now does allocations better
We only have to allocate at the beginning of the all functions and
can properly exit before any disk reads if we run out of memory.

This makes development little bit 'harder' since the {read,write}_block
user must allocate a buffer of atleast block_size bytes.

I also made disk access to cause kernel panic on error since the error
handling during file write is something I don't want to think now.
The filesystem can easily corrupt so, I feel like when disk io starts
to fail I'll come back to this.
2023-03-23 23:22:31 +02:00
Bananymous 2152b8b95f 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
Bananymous 4fd21bc303 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
Bananymous 6ed9651176 Kernel: StorageDevice and Ext2 "support" writing 2023-03-23 13:04:13 +02:00
Bananymous a8e3ee6f19 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
Bananymous 9b500842a0 Kernel: Ext2 can now read from non-block-size aligned offsets 2023-03-21 19:19:17 +02:00
Bananymous b21348379f 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
Bananymous 633055293e Kernel: Remove for_each_block from Ext2 2023-03-21 18:14:02 +02:00
Bananymous 39b560fde3 Kernel: Add basic mounting to VFS. 2023-03-19 05:51:25 +02:00
Bananymous 76d5364a55 Kernel: Add comparison operator for inodes 2023-03-19 03:34:23 +02:00
Bananymous 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
Bananymous 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
Bananymous 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
Bananymous 23b3028e15 Kernel: Rename RefCounted -> RefPtr and implement RefCounted 2023-03-08 03:26:25 +02:00
Bananymous 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
Bananymous 90a7268e5a BAN: Rewrite RefCounted to return ErrorOr 2023-03-02 12:30:11 +02:00
Bananymous 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
Bananymous 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
Bananymous efaca469ee Kernel: Ext2Inode now supports indirect blocks through for_each_block() 2023-02-20 10:25:15 +02:00
Bananymous 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