diff options
| author | Miguel <m.i@gmx.at> | 2018-09-13 23:26:47 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-13 23:26:47 +0200 |
| commit | 1195ca0bd84693fd56f6d34a9f2de3107b9820bf (patch) | |
| tree | fc73d628f194af903e8cae62ce0df5f240732f75 /fs/ext2.c | |
| parent | 877c113518788babd6f633592c23f04f355bc30e (diff) | |
ext2 review
Diffstat (limited to 'fs/ext2.c')
| -rw-r--r-- | fs/ext2.c | 25 |
1 files changed, 11 insertions, 14 deletions
@@ -1,18 +1,14 @@ -#include "kernel/kernel.h" -#include "log.h" -// ext2 minidriver -// based on osdev wiki article: http://wiki.osdev.org/Ext2 -// -// -#include "lib/string/string.h" +#include <stdbool.h> +#include <stdint.h> +#include "kernel.h" +#include "ext2.h" +#include "log.h" -#include <stdbool.h> -#include <stdint.h> +#include "lib/string/string.h" #include "fs.h" -#include "ext2.h" typedef struct ext2_superblock_struct { @@ -27,18 +23,19 @@ typedef struct ext2_superblock_struct uint32_t blocks_per_group; uint32_t fragments_per_group; uint32_t inodes_per_group; - uint8_t skip[12]; // maybe we will look at these fields later... + uint8_t skip[12]; // last mount time, last written time, numer of times mounted, number of mounts before checking. uint16_t ext2_sig; // 0xef5 uint16_t fs_state; uint16_t error_handle; uint16_t version_minor; - uint8_t skip2[8]; // maybe we will look at these fields later... + uint8_t skip2[8]; // last check, check interval uint32_t os_id; uint32_t version_major; uint16_t uid_reserved; uint16_t gid_reserved; }ext2_superblock; +/* we dont use this yet typedef struct ext2_superblock_ext_struct { uint32_t first_inode; @@ -62,6 +59,7 @@ typedef struct ext2_superblock_ext_struct uint32_t orpan_head; }ext2_superblock_ext; +*/ typedef struct ext2_blockgroup_desc_struct { @@ -112,13 +110,12 @@ void ram_read(char *in,char *out,int size, int count) { out[i]=in[i]; } - } int ext2_check(uint8_t *ram) { ext2_superblock super; - ext2_superblock_ext super_ext; +// ext2_superblock_ext super_ext; uint8_t *ptr=ram+1024; ram_read((char*)ptr,&super,sizeof(super),1); |
