Commit graph

7 commits

Author SHA1 Message Date
Franciszek Pindel e13d1b47c6 fs: ext2: Fix calculating fs_memory in ext2_format
First sector starts at CONFIG_EXT2_DISK_STARTING_SECTOR.
This commit fixes calculating free space, based on that value.

Signed-off-by: Franciszek Pindel <fpindel@antmicro.com>
2024-04-11 09:07:43 +02:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Franciszek Zdobylak 1eb104795e fs: ext2: Use disk structs to access data on disk
This commits changes how data on the disk is accessed. There are disk
structures which are packed and their fields are stored in little endian
byte order. To use data in the program structures it has to be translated
from little endian to cpu endianness.

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-08-03 12:22:01 -04:00
Franciszek Zdobylak 1f62d99e7e fs: ext2: Update memory writes
Fix the behavior when data should be written to storage device. Now all
writes are done directly to disk_access layer (where it might possibly
be cached).

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-08-03 12:22:01 -04:00
Franciszek Zdobylak b814246764 fs: ext2: create correct file system in mkfs
Changes:
  - Add fs::sync function
  - Make correct file system in mkfs
  - Add few assertions to ensure that all assumptions are correct

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-08-03 12:22:01 -04:00
Franciszek Zdobylak 64da407ea5 fs: ext2: create dir and file operations
Introduced functions:
  - open
  - close
  - mkdir

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-08-03 12:22:01 -04:00
Franciszek Zdobylak 1eccf55102 fs: ext2: Implementation of basic operations
Included operations:
  - mount
  - unmount
  - mkfs
  - statvfs

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-08-03 12:22:01 -04:00