bkw777 / pdd.sh

TPDD client implemented in bash
GNU General Public License v3.0
23 stars 1 forks source link

probably timing problems on mac #2

Open bkw777 opened 7 months ago

bkw777 commented 7 months ago

Bash 5.2 from macports, Monterey 12.7.3, Early 2015 macbook air, FTDI usb-serial adapter

fdc-mode read operations fail, ie rh/read_header rl/read_logical hang on trying to read after sending the command.

opr-mode commands mostly work but they're not 100% either. loading a small file works but larger files hang around 3.8k

ls mostly works, the dirent() commands work to display all the files, but the end of ls() does an fdc-mode command to get the disk write-protect status at the end and that fails.

bkw777 commented 6 months ago

Maybe logic / bash behavior and not timing. LS works all the way until the condition() at the end, even on a full disk with over 30 files. But always fails with a simple rl 2 2 read one logical sector 2 from physical sector 2, which is just a short 64 bytes on a normal filesystem disk.

Recording the same example rl 2 2 command using the same disk and the same usb-serial adapter on both linux and mac, one difference is on mac it tried to send the opr-mode command for "switch to fdc mode" first when it probably wasn't needed. If I reset the drive and manually give the fdc command seperately before giving the rl command, the rl command works perfectly, and works as many times as I want to re-run it.

So probably it's another bash behavior difference like the one that broke help(). I need to trace every step that should be changing the state of ${operation_mode} and find some situation where it's failing to change, or changing when it shouldn't, or maybe merely failing to be interpreted as whatever state it actually is, ie maybe the variable is correct but some logic that reads it is reading it wrong.

This is probably the same for freebsd too, just like the help() problem was the same on both.