Skip to content

Commit fd05fff

Browse files
author
Felix Queißner
committed
Adds way more implementation
1 parent 6579def commit fd05fff

19 files changed

+493
-239
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.zig-cache/
22
zig-out/
3+
.vscode/

README.md

+67-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,67 @@
1-
# disk-image-step
1+
# Disk Image Creator
2+
3+
The Disk Image Creator is a tool that uses a simple textual description of a disk image to create actual images.
4+
5+
This tool is incredibly valuable when implementing your own operating system or deployments.
6+
7+
## Example
8+
9+
```plain
10+
11+
```
12+
13+
## Available Content Types
14+
15+
```plain
16+
17+
```
18+
19+
### Empty Content (`empty`)
20+
21+
This type of content does not change its range at all and keeps it empty. No bytes will be emitted.
22+
23+
```plain
24+
empty
25+
```
26+
27+
### Fill (`fill`)
28+
29+
The *Fill* type will fill the remaining size in its space with the given `<byte>` value.
30+
31+
```plain
32+
fill <byte>
33+
```
34+
35+
### Raw Binary Content (`raw`)
36+
37+
The *Raw* type will include the file at `<path>` verbatim and will error, if not enough space is available.
38+
39+
`<path>` is relative to the current file.
40+
41+
```plain
42+
raw <path>
43+
```
44+
45+
### MBR Partition Table (`mbr-part`)
46+
47+
```plain
48+
49+
```
50+
51+
### GPT Partition Table (`gpt-part`)
52+
53+
```plain
54+
55+
```
56+
57+
### FAT File System (`fat`)
58+
59+
```plain
60+
61+
```
62+
63+
## Compiling
64+
65+
- Install [Zig 0.14.0](https://ziglang.org/download/).
66+
- Invoke `zig build -Drelease` in the repository root.
67+
- Execute `./zig-out/bin/dim --help` to verify your compilation worked.

flake.lock

-147
This file was deleted.

flake.nix

-49
This file was deleted.

justfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
zig:="zig-0.14.0"
3+
4+
default: install test
5+
6+
install:
7+
{{zig}} build install
8+
9+
test: unit-test behaviour-tests
10+
11+
unit-test:
12+
{{zig}} build test
13+
14+
behaviour-tests: \
15+
(behaviour-test "tests/basic/empty.dis") \
16+
(behaviour-test "tests/basic/fill-0x00.dis") \
17+
(behaviour-test "tests/basic/fill-0xAA.dis") \
18+
(behaviour-test "tests/basic/fill-0xFF.dis") \
19+
(behaviour-test "tests/basic/raw.dis") \
20+
(behaviour-test "tests/part/mbr/minimal.dis")
21+
22+
behaviour-test script:
23+
{{zig}} build install
24+
25+
./zig-out/bin/dim --output .zig-cache/disk.img --script "{{script}}"
26+
./zig-out/bin/dim --output .zig-cache/disk.img --size 30M --script "{{script}}"
27+
28+
29+
fuzz:
30+
{{zig}} build install test --fuzz --port 35991

0 commit comments

Comments
 (0)