Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
It looks ok.
When you screw up in one way or another, failed to read or whatever, you should call "fdd_reset" and then "fdd_recalibrate".
The fdd_seek (or whatever you call it), should be called before issuing the read command.
Theres a bit you set, forgot which one off hand, for automatic seek or manual seek, from my test this (automatic seek) does not always work on all PC, so i did the manual seek on all PC (if needed)
just to make sure, i've heard many ppl here giving out values of SRA and SRB when talking about buggy floppy drivers, but reading the specs seems to reveal they're just "spy pins" registers which do not play any role in the driver programming ... or do they ?
i mean are they useful for something else than debugging purpose ?
Dex4u wrote:
Are they not PS/2 specific registers.
they are, but afaik our modern PCs look more like PS/2 than like PC-AT or "model something", no ? so i assumed they were available. Question is, what are they good for ? ...
IMHO they are all just for diagnostics, except for the WP (Write Protect) bit in SRA. The only other way to find out if a disk is write protected is to issue a "sense drive status" command (0x04), or issue a write (without checking) and see if you get an error.
BTW, the "Model 30" was the first computer in IBM's "PS/2" range, sporting a lovely 10 MHz 80286 and an (optional) 20 MB hard drive . It was the only PS/2 with an ISA bus (later models used MCA). Starting price for a model 30 was $2965 USD (512 KB of RAM, standard VGA video, no hard drive). Probably could've bought a new car for the same price back then .
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Could you by any chance be running that code before IRQ6 has been properly enabled at the PIC or in a code section where interrupts are disabled (i suppose that's why Tim had to tweak his code like this) ?
p.s. bubach, this is kinda like a c version of your fdc, it works on emulator but not on real computer, do you see a porblem ???
@GLneo, if your talking about the driver in BOS, that floppy driver is from "Dex4u" and writen by me, so if you are let me know and i will try and answer your ?.
@Pype.Clicker, didn't fix it but most likely help, thx
@Dex4u, that's a good driver ;D, i think my problem is in get & send byte, am i searching for the right number ???
As he said, that driver is from dex4u.
If it works in BOCHS the it's a almost always a timer issue. Can we have a look on you timer and IRQ (wasn't included) code?