aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-24 16:38:29 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-24 16:38:29 +0100
commitfa8a840c6dfc9eb737ef5d777f066b05eb8d9544 (patch)
tree1b7b0accd02ef635065bf11d0f3502ba6aa4875c /src/kernel/fs
parentf2c07854463763ed82e00857ae6d9bcbc924e42c (diff)
downloadkogata-fa8a840c6dfc9eb737ef5d777f066b05eb8d9544.tar.gz
kogata-fa8a840c6dfc9eb737ef5d777f066b05eb8d9544.zip
More preparation for iso9660
Diffstat (limited to 'src/kernel/fs')
-rw-r--r--src/kernel/fs/iso9660.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/kernel/fs/iso9660.c b/src/kernel/fs/iso9660.c
index 8780c32..60e9a81 100644
--- a/src/kernel/fs/iso9660.c
+++ b/src/kernel/fs/iso9660.c
@@ -2,9 +2,38 @@
#include <fs/iso9660.h>
+static bool iso9660_make(fs_handle_t *source, const char* opts, fs_t *t);
+static bool iso9660_detect(fs_handle_t *source);
+
+static fs_driver_ops_t iso9660_driver_ops = {
+ .make = iso9660_make,
+ .detect = iso9660_detect,
+};
+
void register_iso9660_driver() {
- dbg_printf("Not implemented ISO9660.\n");
- // TODO
+ ASSERT(sizeof(iso9660_vdt_entry_t) == 2048);
+ ASSERT(sizeof(iso9660_dr_t) == 34);
+
+ register_fs_driver("iso9660", &iso9660_driver_ops);
+}
+
+// ============================== //
+// FILESYSTEM DETECTION AND SETUP //
+// ============================== //
+
+static bool iso9660_detect(fs_handle_t *source) {
+ stat_t st;
+ if (!file_stat(source, &st)) return false;
+ if ((st.type & FT_BLOCKDEV) != 0) return false;
+
+ uint32_t block_size = file_ioctl(source, IOCTL_BLOCKDEV_GET_BLOCK_SIZE, 0);
+ if (block_size != 2048) return false;
+
+ return false; // TODO
+}
+
+static bool iso9660_make(fs_handle_t *source, const char* opts, fs_t *t) {
+ return false; // TODO
}
/* vim: set ts=4 sw=4 tw=0 noet :*/