summaryrefslogtreecommitdiff
path: root/core/fs/ntfs/ntfs.h
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2011-07-07 21:28:05 +0000
committerPaulo Alcantara <pcacjr@gmail.com>2011-09-07 07:19:06 +0000
commit045bc5cd1118fee51b19d89dc316038c8a93e5bf (patch)
tree92e8008767611b08ee9b3a6289c7a32c77634697 /core/fs/ntfs/ntfs.h
parentb0ac906b283b428ba1c7f35fe1e71a84b3d3d9c6 (diff)
downloadsyslinux-045bc5cd1118fee51b19d89dc316038c8a93e5bf.tar.gz
Initial NTFS readonly support code to Syslinux
Basically add the NTFS filesystem structures and also implement ntfs_fs_init() to only initialize the filesystem metadata and return the block size in bits. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
Diffstat (limited to 'core/fs/ntfs/ntfs.h')
-rw-r--r--core/fs/ntfs/ntfs.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/core/fs/ntfs/ntfs.h b/core/fs/ntfs/ntfs.h
new file mode 100644
index 00000000..b5919a3e
--- /dev/null
+++ b/core/fs/ntfs/ntfs.h
@@ -0,0 +1,64 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2011 Paulo Alcantara <pcacjr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+/*
+ * ntfs.h - The NTFS filesystem structures
+ */
+
+#ifndef _NTFS_H_
+#define _NTFS_H_
+
+struct ntfs_bpb {
+ uint8_t jmp_boot[3];
+ char oem_name[8];
+ uint16_t sector_size;
+ uint8_t sec_per_clust;
+ uint16_t res_sectors;
+ uint8_t zero_0[3];
+ uint16_t zero_1;
+ uint8_t media;
+ uint16_t zero_2;
+ uint16_t unused_0;
+ uint16_t unused_1;
+ uint32_t unused_2;
+ uint32_t zero_3;
+ uint32_t unused_3;
+ uint64_t total_sectors;
+ uint64_t mft_lclust;
+ uint64_t mft_mirr_lclust;
+ uint8_t clust_per_mft_record;
+ uint8_t unused_4[3];
+ uint8_t clust_per_idx_buf;
+ uint8_t unused_5[3];
+ uint64_t vol_serial;
+ uint32_t unused_6;
+
+ uint8_t pad[428]; /* padding to a sector boundary (512 bytes) */
+} __attribute__((packed));
+
+struct ntfs_sb_info {
+ sector_t mft; /* The MFT region */
+ sector_t root; /* The root dir region */
+
+ unsigned mft_size; /* The MFT size in sectors */
+ unsigned mft_record_size; /* MFT record size in bytes */
+
+ unsigned long long clusters; /* Total number of clusters */
+
+ unsigned clust_shift; /* Based on sectors */
+ unsigned clust_byte_shift; /* Based on bytes */
+ unsigned clust_mask;
+ unsigned clust_size;
+
+} __attribute__((packed));
+
+#endif /* _NTFS_H_ */