You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+105-8
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
-
# Disk Image Creator
1
+
# 💡 Dimmer - The Disk Imager
2
2
3
-
The Disk Image Creator is a tool that uses a simple textual description of a disk image to create actual images.
3
+
> *Realize bright ideas with less energy!*
4
4
5
-
This tool is incredibly valuable when implementing your own operating system or deployments.
5
+
Dimmer is a tool that uses a simple textual description of a disk image to create actual images.
6
+
7
+
This tool is incredibly valuable when implementing your own operating system, embedded systems or other kinds of deployment.
6
8
7
9
## Example
8
10
@@ -12,10 +14,6 @@ This tool is incredibly valuable when implementing your own operating system or
12
14
13
15
## Available Content Types
14
16
15
-
```plain
16
-
17
-
```
18
-
19
17
### Empty Content (`empty`)
20
18
21
19
This type of content does not change its range at all and keeps it empty. No bytes will be emitted.
@@ -45,23 +43,122 @@ paste-file <path>
45
43
### MBR Partition Table (`mbr-part`)
46
44
47
45
```plain
46
+
mbr-part
47
+
[bootloader <content>]
48
+
[part <…> | ignore] # partition 1
49
+
[part <…> | ignore] # partition 2
50
+
[part <…> | ignore] # partition 3
51
+
[part <…> | ignore] # partition 4
52
+
```
48
53
54
+
```plain
55
+
part
56
+
type <type-id>
57
+
[bootable]
58
+
[size <bytes>]
59
+
[offset <bytes>]
60
+
contains <content>
61
+
endpart
49
62
```
50
63
64
+
If `bootloader <content>` is given, will copy the `<content>` into the boot block, setting the boot code.
65
+
66
+
The `mbr-part` component will end after all 4 partitions are specified.
67
+
68
+
- Each partition must specify the `<type-id>` (see table below) to mark the partition type as well as `contains <content>` which defines what's stored in the partition.
69
+
- If `bootable` is present, the partition is marked as bootable.
70
+
-`size <bytes>` is required for all but the last partition and defines the size in bytes. It can use disk-size specifiers.
71
+
-`offset <bytes>` is required for either all or no partition and defines the disk offset for the partitions. This can be used to explicitly place the partitions.
A complete list can be [found on Wikipedia](https://en.wikipedia.org/wiki/Partition_type), but [we do not support that yet](https://github.com/zig-osdev/disk-image-step/issues/8).
|`<type>`|`fat12`, `fat16`, `fat32`| Selects the type of FAT filesystem that is created |
111
+
|`<fatcount>`|`one`, `two`| Number of FAT count. Select between small and safe. |
112
+
|`<fs-label>`| ascii string <= 11 chars | Display name of the volume. |
113
+
|`<count>`| integers <= 32768 | Number of entries in the root directory. |
114
+
|`<align>`| power of two >= 1 and <= 32768 | Specifies alignment of the volume data area (file allocation pool, usually erase block boundary of flash memory media) in unit of sector. The valid value for this member is between 1 and 32768 inclusive in power of 2. If a zero (the default value) or any invalid value is given, the function obtains the block size from lower layer with disk_ioctl function. |
115
+
|`<size>`| powers of two | Specifies size of the allocation unit (cluter) in unit of byte. |
60
116
117
+
## Standard Filesystem Operations
118
+
119
+
All `<path>` values use an absolute unix-style path, starting with a `/` and using `/` as a file separator.
120
+
121
+
All operations do create the parent directories if necessary.
122
+
123
+
### Create Directory (`mkdir`)
124
+
125
+
```plain
126
+
mkdir <path>
61
127
```
62
128
129
+
Creates a directory.
130
+
131
+
### Create File (`create-file`)
132
+
133
+
```plain
134
+
create-file <path> <size> <content>
135
+
```
136
+
137
+
Creates a file in the file system with `<size>` bytes (can use sized spec) and embeds another `<content>` element.
138
+
139
+
This can be used to construct special or nested files ad-hoc.
140
+
141
+
### Copy File (`copy-file`)
142
+
143
+
```plain
144
+
copy-file <path> <host-path>
145
+
```
146
+
147
+
Copies a file from `<host-path>` (relative to the current file) into the filesystem at `<path>`.
148
+
149
+
### Copy Directory (`copy-dir`)
150
+
151
+
```plain
152
+
copy-file <path> <host-path>
153
+
```
154
+
155
+
Copies a directory from `<host-path>` (relative to the current file) *recursively* into the filesystem at `<path>`.
0 commit comments