AltraMayor / AltraMayor/f3

f3probe writes multiple MiB of data

Đang mở
#147 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Documentation
Ngôn ngữ chính
C
Star
3.4k
Fork
177
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
2

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.