summaryrefslogtreecommitdiff
path: root/kd/oap-0005.md
blob: 97d298e58079f358ede2c694bd0da8dceed88ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
stand_alone: true
ipr: none
cat: std
status: draft
area: Systems Engineering
wg: OSMORA Standards Group

docname: OAP-0005

title: OSMORA Archive Format
abbrev: OMAR
lang: en
kw:
  - omar
author:
- role: editor
  name: Ian M. Moffett
  org: OSMORA
  city: Washington, DC
  region: Southeast
  code: 20020
  email: ian@osmora.org

--- abstract

The OSMORA Archive (OMAR) format is a minimalist replacement for CPIO and TAR perfect
for use in in-memory filesystems and general usage.

--- middle

# Introduction

OMAR is a simple archive format designed to be minimal and useful for general usage
as well as for use in in-memory filesystems.

## Purpose

While CPIO and TAR can also get the job done (in too many different ways, that is),
OMAR simply gets it done while keeping the implementation small and minimal.

# Requirements Language

{::boilerplate bcp14-tagged}

# OMAR header

Before the contents of each file, there MUST be a header that
describes the file contents. This header contains things such as its
magic (for validation), file type, length of the filename and the
length of the file. The file path goes directly after the header
and its length is denoted by the header filename length field. The
actual file contents are directly after the filename, if the total
length of the file is not a multiple of the block size (512) it MUST
be padded to the nearest 512 byte boundary with zeros. All directories
are to be padded with 512 bytes where data would be for regular files.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--------------------+
|   Magic ("OMAR")   |  - Signature (4 bytes)
|--------------------|
|   Type             |  - File type (1 byte)
|--------------------|
|   Namelen          |  - Length of name (1 byte)
|--------------------|
|   Len              |  - Length of file (4 bytes)
+--------------------+
\/\/\/\/\/\/\/\/\/\/\/
        DATA
   00 00 00 00 00 00
   00 00 00 00 00 00
   00 00 00 00 00 00
     ... padding
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~