rust-kernel
Rustbelt: a hobby x86_64 kernel written in Rust
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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | #!/usr/bin/env bash
# Check Rustbelt's exFAT writes with the host's own tools (exfatprogs).
#
# 1. fsck.exfat the pristine images build.rs made (this checks the
# build-time populator, build/exfat_populate.rs).
# 2. Copy them to target/fsck/ and boot Rustbelt on the *writable* copies
# (no snapshot=on), so whatever it writes really lands in the files:
# - the shell self-test (cp B:/C: -> D:, cp D: -> C:, md, echo >)
# - the tests/exfat.rs kernel (create/write/append/truncate/unlink/
# rmdir, NoFatChain -> FAT chain, a directory grown to 200 files,
# root directory growth; 4 KiB and 512-byte clusters)
# 3. `fsck.exfat -n` every copy: -n = open read-only and answer "no" to
# every question (report, don't fix). It checks the boot checksum,
# bitmap vs. cluster chains, SetChecksums, name hashes... Any
# complaint means the driver wrote something inconsistent.
# 4. Show the self-test copy's root directory and one new file with
# dump.exfat, and read that file's bytes straight off the image.
#
# Usage: ./scripts/exfat-check.sh (after `cargo build` and
# `cargo test --test exfat`, which build the images and the kernels)
for; do
|| { ; ; }
done
status=0
for; do
done
for; do ; done
EXFAT_IMG=target/fsck/selftest-exfat.img &&
KERNEL=
[ || { ; ; }
code=
|
[ || { ; ; }
for; do
done
IMG=target/fsck/selftest-exfat.img
|
# (dump.exfat -s, a directory scan, rather than -d "/New Folder/Note.txt":
# exfatprogs 1.2.9's -d can't find files inside some directories, e.g.
# "NewFolder", even on images only mkfs + our populator ever touched.)
set_info=
| |
# Read the file's bytes straight from the image: cluster N starts at
# ClusterHeapOffset + (N - 2) * cluster size.
info=
heap=
spc=
first=
len=
|
[ && ||
|