Permalink
Browse files

Merge pull request #55 from eXeC64/master

Moved sector joins out of sectors into a new structure
  • Loading branch information...
2 parents 6b03626 + 3d0337f commit 71ca702ae16e5852a85157e296d60b18ed63a189 @0xabad1dea 0xabad1dea committed Apr 14, 2012
Showing with 132 additions and 118 deletions.
  1. +93 −93 FS/Draft_Harrys_Allocation_Table.txt
  2. +39 −25 FS/Draft_Harrys_Allocation_Table.xml
@@ -2,7 +2,7 @@
RFC (Draft-Fs) H. Jeffery, Ed.
- April 11, 2012
+ April 14, 2012
Harry's Allocation Table
@@ -24,25 +24,25 @@ Table of Contents
3.1.1.1. version . . . . . . . . . . . . . . . . . . . . . . 3
3.1.1.2. num_sectors . . . . . . . . . . . . . . . . . . . . 3
3.1.1.3. sector_map_start . . . . . . . . . . . . . . . . . 4
- 3.1.1.4. sector_start . . . . . . . . . . . . . . . . . . . 4
- 3.1.1.5. sector_size . . . . . . . . . . . . . . . . . . . . 4
- 3.1.1.6. sectors_used . . . . . . . . . . . . . . . . . . . 4
+ 3.1.1.4. sector_joins_start . . . . . . . . . . . . . . . . 4
+ 3.1.1.5. sector_start . . . . . . . . . . . . . . . . . . . 4
+ 3.1.1.6. sector_size . . . . . . . . . . . . . . . . . . . . 4
+ 3.1.1.7. sectors_used . . . . . . . . . . . . . . . . . . . 4
3.1.2. sector map . . . . . . . . . . . . . . . . . . . . . . 4
3.1.2.1. bitmap . . . . . . . . . . . . . . . . . . . . . . 4
- 3.1.3. sector . . . . . . . . . . . . . . . . . . . . . . . . 4
- 3.1.3.1. next_sector_index . . . . . . . . . . . . . . . . . 5
- 3.1.3.2. sector_data . . . . . . . . . . . . . . . . . . . . 5
+ 3.1.3. sector joins . . . . . . . . . . . . . . . . . . . . . 5
+ 3.1.4. sector . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2. Higher Layer . . . . . . . . . . . . . . . . . . . . . . . 5
3.2.1. inode . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2.1.1. type . . . . . . . . . . . . . . . . . . . . . . . 6
3.2.1.2. content_size . . . . . . . . . . . . . . . . . . . 6
3.2.1.3. link_count . . . . . . . . . . . . . . . . . . . . 6
3.2.2. link . . . . . . . . . . . . . . . . . . . . . . . . . 6
- 3.2.2.1. strip_start_sector . . . . . . . . . . . . . . . . 6
- 3.2.2.2. file_name . . . . . . . . . . . . . . . . . . . . . 6
+ 3.2.2.1. strip_start_sector . . . . . . . . . . . . . . . . 7
+ 3.2.2.2. file_name . . . . . . . . . . . . . . . . . . . . . 7
4. Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1. Constructing a HAT filesystem . . . . . . . . . . . . . . . 7
- 4.2. Finding a file's inode . . . . . . . . . . . . . . . . . . 7
+ 4.2. Finding a file's inode . . . . . . . . . . . . . . . . . . 8
4.3. Allocating sectors . . . . . . . . . . . . . . . . . . . . 8
5. Security Considerations . . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 8
@@ -115,16 +115,17 @@ Jeffery [Page 2]
3.1. Lower Layer
- +------------+
- | Section |
- +------------+
- | header |
- | sector map |
- | sector 0 |
- | sector 1 |
- | sector 2 |
- | ... |
- +------------+
+ +--------------+
+ | Section |
+ +--------------+
+ | header |
+ | sector map |
+ | sector joins |
+ | sector 0 |
+ | sector 1 |
+ | sector 2 |
+ | ... |
+ +--------------+
Table 1: Filesystem Structure
@@ -134,16 +135,17 @@ Jeffery [Page 2]
The total size of the header is 16 words.
- +------+------------------+
- | Size | Name |
- +------+------------------+
- | 1 | version |
- | 1 | num_sectors |
- | 2 | sector_map_start |
- | 2 | sector_start |
- | 1 | sector_size |
- | 1 | sectors_used |
- +------+------------------+
+ +------+--------------------+
+ | Size | Name |
+ +------+--------------------+
+ | 1 | version |
+ | 1 | num_sectors |
+ | 2 | sector_map_start |
+ | 2 | sector_joins_start |
+ | 2 | sector_start |
+ | 1 | sector_size |
+ | 1 | sectors_used |
+ +------+--------------------+
Table 2: Header Structure
@@ -162,8 +164,6 @@ Jeffery [Page 2]
-
-
Jeffery [Page 3]
HAT April 2012
@@ -173,21 +173,26 @@ Jeffery [Page 3]
This field contains the address of the start of the sector map.
-3.1.1.4. sector_start
+3.1.1.4. sector_joins_start
+
+ This field contains the address of the start of the array of sector
+ joins.
+
+3.1.1.5. sector_start
This field contains the address of the first sector on disk.
This is required because the first sector may not be positioned
immediately after the header. The first sector may be positioned to
provide alignment with the underlying disk's blocks.
-3.1.1.5. sector_size
+3.1.1.6. sector_size
This field contains the size of each sector in the filesystem.
This must be a power of 2, such as 128, 256 or 512.
-3.1.1.6. sectors_used
+3.1.1.7. sectors_used
This field contains the number of sectors that are currently in use.
@@ -213,40 +218,48 @@ Jeffery [Page 3]
Any spare bits at the end of the bitmap must be set to 1.
-3.1.3. sector
-
- The sector structure is used to store blocks of raw data. Each
- sector may point to another sector. The chain of sectors that forms
-
Jeffery [Page 4]
HAT April 2012
- is then provided to the higher layer in the form of a strip that
- masks the non-contiguous nature of the sectors.
+3.1.3. sector joins
- +-----------------+-------------------+
- | Size | Name |
- +-----------------+-------------------+
- | 1 | next_sector_index |
- | sector_size - 1 | sector_data |
- +-----------------+-------------------+
+ This section is an array of words, each word is used to join one
+ sector to another.
- Table 4: sector structure
+ +------+--------------+
+ | Size | Name |
+ +------+--------------+
+ | 1 | sector0_next |
+ | 1 | sector1_next |
+ | 1 | sector2_next |
+ | 1 | sector3_next |
+ | 1 | ... |
+ +------+--------------+
+
+ Table 4: sector links structure
-3.1.3.1. next_sector_index
+ Each entry joins the end of one sector to the start of another, if
+ there is no next sector the entry is set to 0.
- This field contains the index of the sector that follows this one.
- When there is no such sector this field's value is set to 0x0000.
+ For example, if there is a strip starting in sector 0, then
+ continuing in sector 2, then sector 1, then finishing in sector 3,
+ then the value of sector0_next will be 2, sector1_next will be 3,
+ sector2_next will be 1, sector3_next will be 0.
-3.1.3.2. sector_data
+ The total length of this section in words is the total number of
+ sectors in the filesystem.
- This field simply contains raw data.
+3.1.4. sector
- The size of this field is determined by the sector_size field in the
+ The sector structure is used to store blocks of raw data. Sectors
+ themselves are just raw blocks of data with no formatting or
+ wrapping.
+
+ Each sector has the size equal to the sector_size, as defined by the
header of the filesystem.
3.2. Higher Layer
@@ -255,19 +268,6 @@ Jeffery [Page 4]
The inode structure is used to store metadata about files.
- +------+--------------+
- | Size | Name |
- +------+--------------+
- | 1 | type |
- | 2 | content_size |
- | 1 | link_count |
- +------+--------------+
-
- Table 5: inode structure
-
-
-
-
@@ -281,6 +281,16 @@ Jeffery [Page 5]
HAT April 2012
+ +------+--------------+
+ | Size | Name |
+ +------+--------------+
+ | 1 | type |
+ | 2 | content_size |
+ | 1 | link_count |
+ +------+--------------+
+
+ Table 5: inode structure
+
3.2.1.1. type
+-------+----------------------+
@@ -319,6 +329,14 @@ Jeffery [Page 5]
Table 7: link structure
+
+
+
+Jeffery [Page 6]
+
+ HAT April 2012
+
+
3.2.2.1. strip_start_sector
This field contains the index of the start sector of the strip the
@@ -329,14 +347,6 @@ Jeffery [Page 5]
This field contains the file name to be associated with the inode
that is being linked. Only alphanumeric characters, periods(.) and
underscores(_) are allowed in the filename. The maximum length of
-
-
-
-Jeffery [Page 6]
-
- HAT April 2012
-
-
the filename is 15 characters, any unused characters at the end of
the filename must be set to 0x0000.
@@ -375,16 +385,6 @@ Jeffery [Page 6]
on. It is also highly advised to align the first sector to a block
to maximise io performance.
-4.2. Finding a file's inode
-
- To open a file is very simple. HAT is simply passed an absolute path
- to the file. The path is then broken up into a list of of
- directories. The list is traversed, starting at the root inode until
- the file's inode is found.
-
-
-
-
@@ -393,6 +393,13 @@ Jeffery [Page 7]
HAT April 2012
+4.2. Finding a file's inode
+
+ To open a file is very simple. HAT is simply passed an absolute path
+ to the file. The path is then broken up into a list of of
+ directories. The list is traversed, starting at the root inode until
+ the file's inode is found.
+
4.3. Allocating sectors
Unused sectors can be found very quickly using the sector map. By
@@ -437,12 +444,5 @@ Author's Address
-
-
-
-
-
-
-
Jeffery [Page 8]
Oops, something went wrong. Retry.

0 comments on commit 71ca702

Please sign in to comment.