AltraMayor / AltraMayor/f3

f3probe writes multiple MiB of data

Offen
#147 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Documentation
Vorherrschende Sprache
C
Sterne
3.4k
Forks
177
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
2

Beschreibung

Adding diagnostic output to `write_blocks()` and also simply looking at an I/O monitor, there clearly is a lot of data being written to the flash disk while running `f3probe`. The readme says it is the "fastest" and "only writes what's necessary". I'd think the following procedure would suffice. What would be wrong with this approach, assuming like `f3probe` that fake flash simply discards one or more top address bits?

1. Write 1 block with unique contents to the last block of the fake disk, i.e. at position `fake_size_in_blocks - 1`. Assign this position to `a`.
2. Since we assume that fake flash has at least 1 block of real storage we do not need to test that the block can be read back at position `a`. It will, unless there is some other damage and we are not interested in testing for this here.
3. Set `n = log_2(floor(a))`.
4. Read at position `a - 2^n`, i.e. clearing the top non-zero address bit.
5. If our special block comes back record that address bit `n` is not connected.
6. If `a` is not `2^(n+1) - 1`, write our unique contents also to position `2^n - 1`.
7. Set `a = 2^n - 1`, i.e. the last block of the next smaller power of 2 fake drive size.
8. Go to step 3 if `a` is not 0 (or above some other reasonable threshold, e.g. 2048 if assuming there is at least 1 MiB of real storage)
9. Report fake flash if at least 1 bit is not connected
10. Report useable size as `block_size * 2^m` where `m` is the lowest address bit not connected

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.