-
Notifications
You must be signed in to change notification settings - Fork 1
/
Notes.txt
85 lines (59 loc) · 4.1 KB
/
Notes.txt
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
https://ferrous-systems.com/blog/test-embedded-app/
https://rtic.rs/stable/api/heapless/index.html#
http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node018F.html
https://en.wikipedia.org/wiki/Write_precompensation
http://info-coach.fr/atari/hardware/FD-Hard.php#WD1772
https://www-user.tu-chemnitz.de/~heha/basteln/PC/usbfloppy/floppy.chm/
Interesting for floppy signals:
https://retrocmp.de/fdd/general/floppy-bus.htm
Notes about the disk change signal:
Checked with 3.5" drive:
Stays high if no disk is changed while the drive is selected.
Transitions to low if disk is ejected while the drive is selected.
Doesn't transition to high if disk is inserted while the drive is selected.
Transitions to high if head is stepped while disk is inserted.
Also Transitions to high if head is stepped out when on track 0 and nothing happens. This useful as it doesn't makes a sound!
Checked with 5.25" drive:
Stays high if no disk is ejected while the drive is selected.
Stays high if the knob is turned while the drive is selected.
Transitions to low if disk is pulled out while the drive is selected.
Doesn't transition to high if disk is inserted while the drive is selected.
Doesn't transition to high if the knob is turned while the drive is selected and a disk is inside.
Transitions to high if head is stepped while disk is inserted.
Also Transitions to high if head is stepped out when on track 0 and nothing happens. This useful as it doesn't makes a sound!
Timers are counting with 84 MHz / 11.9 ns period
HD Disk MFM cell size is 1 us which is 84 in raw counter value.
HD Disk Minimum Duration between two pulses is 2 us which is 168 in raw counter values.
DD Disk MFM cell size is 2 us which is 168 in raw counter value.
DD Disk Minimum Duration between two pulses is 4 us which is 336 in raw counter value.
C64 Times for the 1541 because of different speed zones:
7692 bytes of raw cell size, 3.25 us per cell, 227 raw counter value
7142 bytes of raw cell size, 3.50 us per cell, 245 raw counter value
6666 bytes of raw cell size, 3.75 us per cell, 262 raw counter value
6250 bytes of raw cell size, 4.00 us per cell, 280 raw counter value
How a track is written and verified:
Transfer a track as flux cells from PC to Controller. (This only works with constant cell size)
Flux cell data is a more efficient way of storing flux changes than transfering actual timing data.
The easy part is writing: Wait for the index pulse and write the track as raw cells converted to flux durations.
Now verify:
Start reading the track on the next index pulse for the verification process.
Now things get ugly as we can't rely on sync words to synchronize on the data stream
as some copy protections use non standard sync words.
While the track is read via DMA, the CPU tries to match the read data with our expectations.
The index pulse is not exact so this can vary. A window of groundtruth data is shifted over the read data.
This is a folding operation. The window must be large enough to have significant data pulse duration changes inside.
Lots of MFM Cells like 0xAA will not do here. The window must at least contain variation to allow proper synchronisation.
As soon as a match is found, full verification can be performed without relying on faulty checksums (Amiga) or unknown sync markers (copy protections).
It would be cool if this whole process can be completed by using only 2 revolutions per track. But the CPU must hurry for this.
Unit Testing with code coverage:
https://blog.rng0.io/how-to-do-code-coverage-in-rust
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test
grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage_html
firefox target/coverage_html/index.html
http://www.os2museum.com/wp/detecting-floppy-drives-and-media/
https://computer-masters.de/laufwerksgroessen/
Usage of rtthost to connect to my stlink:
rtthost -c stm32f407VGTx
https://github.com/pbatard/libwdi/wiki/WCID-Devices
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags