documentation/kernel/drivers/fs/ustar.h.md

42 lines
2.5 KiB
Markdown
Raw Normal View History

2023-05-28 17:16:43 +00:00
# ustar.h
Specific driver for USTAR.
**Warning:** This is a filesystem specific driver, by this it should only be accessed by the VFS.
The USTAR '_filesystem_' is probably more common known as **tar**-archive.
It is a really simple concept, where a file consists of a header block followed by data blocks.
These blocks are aligned at 512 bytes.
OSDev Wiki: [USTAR](https://wiki.osdev.org/USTAR)
# `ustar_type_E` - enum
The types an entry can have:
- **File**
- **Hardlink**
- **Symlink**
- **Char Device**
- **Block Device**
- **Directory**
- **Pipe**
# `ustar_header_T` - struct [packed / 512B aligned]
| Name | Type | Description |
|-------------------|-----------|---------------------------------------------------------------------------|
| name | char[100] | The name of the entry |
| mode | uint64_t | file mode (permissions, etc) |
| owner_id | uint64_t | The owners ID |
| group_id | uint64_t | The groups ID |
| size | char[12] | The size of the entry, represented as a string of an octal number (dafuq) |
| last_modification | char[12] | The unix-timestamp, when the entry was modified the last time |
| checksum | uint64_t | I think this is a weird checksum of the header |
| type | uint8_t | The ustar_type_E of the entry, represented as ascii numbers (dafuq) |
| name_linked | char[100] | The path to the linked entry, if this is a link-entry |
| indicator | char[6] | This needs to be `ustar` |
| version | uint16_t | The version of the **tar** command, that created the archive |
| owner_user_name | char[32] | The name of the file owner |
| owner_group_name | char[32] | The name of the file group |
| device_major | uint64_t | The devices major number |
| device_minor | uint64_t | The devices minor number |
| name_prefix | char[155] | If this is not null, this acts as a prefix for _name_ |