summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-13 23:26:47 +0200
committerMiguel <m.i@gmx.at>2018-09-13 23:26:47 +0200
commit1195ca0bd84693fd56f6d34a9f2de3107b9820bf (patch)
treefc73d628f194af903e8cae62ce0df5f240732f75 /fs
parent877c113518788babd6f633592c23f04f355bc30e (diff)
ext2 review
Diffstat (limited to 'fs')
-rw-r--r--fs/ext2.c25
-rw-r--r--fs/ext2.h6
2 files changed, 17 insertions, 14 deletions
diff --git a/fs/ext2.c b/fs/ext2.c
index b062973..d99fba7 100644
--- a/fs/ext2.c
+++ b/fs/ext2.c
@@ -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);
diff --git a/fs/ext2.h b/fs/ext2.h
index 066a769..8b9b76b 100644
--- a/fs/ext2.h
+++ b/fs/ext2.h
@@ -1,3 +1,9 @@
+/**
+ * @file
+// ext2 minidriver
+// based on osdev wiki article: http://wiki.osdev.org/Ext2
+*/
+
#include <stdint.h>
#include "fs.h"