From
Kirill Frolov
→
To
Dmitry Lomov
2 January 1999
Greetings, Dmitry!
It was 01 Jan 99 and 02:22:00, Dmitry Lomov wrote to Kirill Frolov
on the topic of programming the drive controller
Not seeing the moderator nearby, I decided to insert a word:
KF>> How can you determine whether the disk needs to be spinned up before
KF>> read/write
KF>> or not? (The disk may already be spinning)
DL> read register #1F. if the most significant bit =1 - it means not
DL> is spinning.
This means that the disk driver can work according to the following scheme:
1.Determination of the need for delay (7 bits #1F).
2. Read register #3F and write to #7F, command #18 - unwind.
3.Delay, depending on point 1.
4.Read or write.
The only question is - what if, at the time of execution of points 1 and 2, there will be
work previous command? Give interruption #D8 ?
I picked up the driver from the pros - after writing the command, there is first bit 0
register #1F expects the command to start running in an infinite loop. How much
is this necessary?
The 7th bit of register #1F is not checked anywhere, but the end of work is checked
auxiliary commands with 0 bits and a timeout of approximately 2 seconds. Why is this
necessary? :-/ Although it’s not difficult to imagine.
Well, now the most interesting question - the book says that reading a registerstate #1F will cause the command to terminate. Absolutely this
does not happen with auxiliary commands. Is this all wrong or
execution of sector/track read/write commands actually stops or
addresses?
With best wishes, Kirill Frolov.
From
Dmitry Lomov
→
To
Kirill Frolov
4 January 1999
Hi, Kirill!
KF> This means that the disk driver can work according to the following scheme:
KF> 1. Determination of the need for delay (7 bits #1F).
KF> 2. Read register #3F and write to #7F, command #18 - unwind.
KF> 3. Delay, depending on point 1.
KF> 4. Read or write.
truly so :)
KF> Just a question - what if at the time of execution of points 1 and 2 there will be
KF> work previous command? Give interruption #D8 ?
it never hurts at all. in the loaders that I wrote
Lately, #D0 has been stuck everywhere - it can't get any worse.
I somehow failed in STORM - a write command is given, but the disk
pulled out, it falls out to "NO DISK", you close the door, and
the team is still working and wiping out the sector.
strictly speaking, an interrupt should be given when the previous command
ended without setting INTRQ - for example, due to
DE program counter overflow.
KF> I picked out the driver from the pros - there, after writing the command, first there are 0 bits
KF> register #1F expects the command to start running in an infinite loop.
KF> How necessary is this?
IMHO, there’s no need for it - but there are possible options, such as from whichcount the time for one attempt.
KF> The 7th bit of register #1F is not checked anywhere, but the end of work is checked
KF> auxiliary commands with 0 bits and a timeout of approximately 2 seconds. Why
KF> is this necessary? :-/ Although it’s not difficult to imagine.
the zero bit in #1F is essentially like INTRQ.
KF> Well, now the most interesting question - the book says that reading
KF> of status register #1F will cause the command to abort.
IMHO, it's nonsense. read register #1F during execution
commands may produce incorrect contents of this register.
at any moment bit 0 is reliable, the rest are not always
reliable.
KF> Absolutely this
KF> does not occur with auxiliary commands. Is this all wrong or
KF> the execution of sector/track read/write commands actually stops
KF> or addresses ?
It would be great if you checked it ;-)
All the best.
Dmitry.
..LD..X-TRADE..
From
Kirill Frolov
→
To
Dmitry Lomov
5 January 1999
Greetings, Dmitry!
It was 04 Jan 99 and 01:05:00, Dmitry Lomov wrote to Kirill Frolov
on the topic of programming the drive controller
Not seeing the moderator nearby, I decided to insert a word:
DL> lately, #D0 has been stuck everywhere - it can't get any worse.
DL> I somehow failed in STORM - a write command is given, and the disk
DL> is pulled out, it falls out to "NO DISK", you close the door, and
DL> the command still continues to work and erases the sector.
:-( ) @#$%& !!! THIS SHOULD BE WRITTEN EVERYWHERE AND IN CAPITAL LETTERS!
DL> strictly speaking, an interrupt should be given when the previous command
DL> ended without setting INTRQ - for example, because
DL> DE program counter overflow.
Or maybe it’s always easier? You don't need many cycles.
KF>> I picked up the driver from the pros - there, after writing the command, first 0
KF>> bit of register #1F is expected to start the command in infinite
KF>> loop. How necessary is this?
DL> IMHO, there is no need - but there are possible options, such as from which one
DL> count the time for one attempt.
No, it's worse there. First the start of work is expected, and then the end, butwith timeouts. It is probably still possible that the VGshka does not immediately
will set bit 0 in the status register and the end of the command will not be expected.
But how safe is it to use an endless loop? :-/
DL> IMHO, nonsense. reading register #1F during execution
DL> commands may give incorrect contents of this register.
DL> at any moment bit 0 is reliable, the rest are not always
DL> are reliable.
That is Is the data there reliable if 0 bit = 0?
KF>> the execution of read/write commands of a sector/track or address is stopped
KF>> ?
DL> it would be great if you checked this ;-)
I looked more closely at the driver from the pros - everything is wrong, it doesn’t stop.
I have another strange question: if I gave the command to spin up the disk,
I waited until it was completed, and then I wanted to delay the promotion
disk - how long it should be in order for the disk to dial
speed 300 rpm ?
Or what happens if I give the command to record without delay? I think that
it is possible that the sector being written will cover the next sector or
sucks at recording.
And finally, why is E bit (3rd) needed in sector read/write commands?The book says that they provide a 15ms delay for promotion --
This is where I didn’t understand anything. When can this be used? How much is this
can it slow down?
How long is the delay required after moving the heads? Are there any
data from the documentation for the drives?
Are there any drives that, when connected on the same cable,
Other drives don't spin when they're running? I don't mean homemade
improvements and not faulty drives of course. Those. when going to work
With another disk, is it necessary to always delay the spin-up?
Here's also about the heads lowering onto the disk at the drive selection command
I remembered - what to do with them? :-( It turns out that the delay in choosing
another drive is necessary, or you need to set jumpers so that
the heads dropped when selecting any drive.
And it's not entirely clear how quickly they go down? That is if I
I will give the command to spin up the disk and wait until it spins up, the heads will already be there
installed and there will be no problems with recording due to their fluctuations?
Well, these seem to be all strange questions :-)
And I need all this just to write a disk driver...
How it works:
1. Interruption of execution by command #D8.
2. Determination of the readiness of the HFMD, if working with the new HFMD is not ready.
2.1.Setting the #FF BETA DISK register.3.Setting the current track of this drive in Prsec (do not touch it with your hands!)
5.Setting the required track in RgData.
6.Search with the 18hex command (and the book says that if V=0 there is no search :-/ )
7.Waiting for the end of the search work or timeout and error and _interruption_.
8. Delay for promotion only if the drive is not ready according to step 1.
9.Record the desired sector in Prsec.
10.Write sector read/write command, wait for PrgSost. bit 0 = 1.
10.1. Setting the E bit in the command if there was a delay in step 8
~~~ IS THIS NECESSARY?
11.Tr-dos programs #3fca/#3fef for reading/writing.
12.Interrupt, read PrSost, exit without errors or with write protection.
13.Decreasing the error counter and exiting if 0.
14.Command for track 0 #08
14. Waiting for the end or timeout and error and _interrupt_.
15. Cancellation of the delay at point 8, went to point 5.
This is how it will probably work _normal_? :-/
Here's a catch-up question: What is bit 5 in the status register after
execution of auxiliary commands???
And what is a0 - bit 0 in the sector write command???
And accordingly, bit 5 in PrgSost after reading the sector?
P.S. Just don’t recommend me a bunch of programs from TR-DOS.
I don’t need TR-DOS glitches and I need a driver that is independentfrom TR-DOS. And I can't contain any system variables,
It is even possible to enable TR-DOS ports when reading COPs in RAM.
I even had to PrgSost. read through Scorpov point #3FF3 in tr-dos :-(
With best wishes, Kirill Frolov.
From
Dmitry Lomov
→
To
Kirill Frolov
5 January 1999
Hi, Kirill!
DL>> lately, #D0 has been stuck everywhere - it can’t get any worse.
DL>> I somehow failed in STORM - a write command is given, and the disk
DL>> is pulled out, it falls out to "NO DISK", you close the door, and
DL>> the command still continues to work and erases the sector.
KF> :-( ) @#$%& !!! THIS SHOULD BE WRITTEN EVERYWHERE AND IN CAPITAL LETTERS!
yeah, let's start :)
you once started hellish propaganda #18 features #3D13 -
expand a similar one ;-)
DL>> strictly speaking, an interrupt should be given when the previous command
DL>> ended without setting INTRQ - for example, because
DL>> DE program counter overflow.
KF> Or maybe it’s always easier? You don't need many bars.
absolutely right. That's what I do.
KF> with timeouts. It’s probably still possible that the VGshka is not immediately available
KF> will set bit 0 in the status register and the end of the command will not be expected.
this is done in hardware, i.e. instantly.
By the way, about instantaneousness... when I made my terrible defense,
hehe :), I had time-critical pieces of code, so I
found that in some cases after the interrupt commandyou need to wait some time, and if you don’t wait,
command issued during this interval is ignored...
LD B,20:DJNZ $ was enough for me.
KF> Just how safe is it to use an endless loop? :-/
If the command is specified correctly, you don’t have to worry about it.
DL>> IMHO, nonsense. reading register #1F during execution
DL>> commands may give incorrect contents of this register.
DL>> at any moment bit 0 is reliable, the rest are not always
DL>> are reliable.
KF> That is. there the data is reliable if 0 bit = 0 ?
yes.
KF> I have another strange question: if I gave the spin command
KF> disk, waited until it was completed
if this is positioning on the current track - readiness will be
right away.
KF> and then I want to add a delay for promotion
KF> of the disk - what duration should it be for the disk to dial
KF> speed 300 rpm ?
it depends on the type of drive. on my Robotron (rulez, the most
fast disk drive!) a couple of revolutions for overclocking, on others it will be
differently, but 3.5 generally think a lot about themselves -
they track time inside and block it at the time of accelerationall signals including index.
KF> Or what will happen if I give the command to record without delay? I think that
KF> it is possible that the sector being written will cover the next sector or
KF> sucks at recording.
yes, there is such a possibility...
but here’s the detail - reading is performed before writing
sector header, i.e. the disc must be
readable if there is an evil PLL, it may turn out to be
underclocked.
KF> And finally, why is E bit (3rd) needed in sector read/write commands
KF> ? The book says that they provide a 15ms delay for promotion --
you set a beat, and there’s a delay automatically. however, I can’t guarantee that I won’t
checked. this is logic - time for post-step calming of the head
is normalized and amounts to ~those same 15 ms.
KF> How much delay is needed after moving the heads? Yes
KF> any data from the documentation for the drives?
I'll be looking for a book for 5350 for a long time... if I press it, I'll find it, it's there
interesting points.
KF> Are there such drives that, when connected on the same cable
KF> other drives do not spin when they are running?
I haven't met anyone like that. KF> improvements and not faulty drives of course. Those. when switching to
KF> working with another disk, is it necessary to always delay the spin-up?
I don't know. IMHO, it is enough to read the first one without error
hit sector (test reading) - and we can assume that everything
ready. Of course, the exception is formatting :-)
KF> Here's also about the heads lowering onto the disk at the drive selection command
KF> I remembered - what to do with them? :-(
throw it away :)
Place a Kalinka under the solenoid ;-))) so that it doesn’t spank with your lip.
KF> It turns out that the delay during selection
KF> another drive is needed, or you need to set jumpers like this
KF> so that the heads are lowered when selecting any drive.
yes. but very good (for a driver) - optional, feces
drives to push the user defined brakes.
KF> And it’s not entirely clear - how quickly do they fall?
This is the docks for 5305 you need to look at.
By the way, I dug up a simple description :)
acceleration - 400 ms.
from step to recording - 18 ms.
if the set of jumpers is closed, signal k.34 (ready) is supported
and becomes active no later than 800 ms from launch.
nothing is said about the lip... KF> I will give the command to spin up the disk and wait until it spins up, the heads are already
KF> will be installed and there will be no problems with recording due to their fluctuations?
but hesitation is a dark matter. who the hell knows.
KF> How it works:
KF> 1. Interruption of execution by command #D8.
or #D0 :)
KF> 2. Determination of the readiness of the HFMD, if working with the new HFMD is not ready.
optional.
KF> 2.1.Setting the #FF BETA DISK register.
KF> 3. Setting the current track of this drive in Prsec (do not use your hands
KF> touch!)
:)
KF> 5.Setting the required track in RgData.
KF> 6.Search with the 18hex command (and the book says that if V=0 there is no search :-/
KF> )
if V=0, then it's just positioning. if =1, then after
positioning it will try to match any header
for comparison. I don’t know what will happen if it’s not so. check
with your finger :-)
KF> 7.Waiting for the end of the search work or timeout and error and _interrupt_.
KF> 8. Delay for promotion, only if the drive is not ready according to step 1.
the value is user selectable. I'm confident in my drive -I’ll put 0. By the way, in STORM there is zero for writing and reading.
5% of users have glitches - their drives need brakes.
KF> 9.Write to Prsec of the desired sector.
KF> 10.Write sector read/write command, wait for PrgSost. bit 0 = 1.
to the bathhouse, although it is useful. don't even think about waiting for it where
execution can be instantaneous.
KF> 10.1. Setting the E bit in the command if there was a delay in step 8
KF> ~~~ IS THIS NEEDED?
no. This is a positioning delay. easier with your hands...
By the way, time cannot be counted as program counters.
Uncle Zonov did a terrible stupidity - with Dosa there is no turbo
turns off. I don’t know what he was doing there with the delays, I guess
Larchenko sat with his pens and recalculated the constants :)
KF> 11.Tr-dos programs #3fca/#3fef for reading/writing.
I don’t remember... these are the ones: LD B, #04 and away we go,
or without the possibility of early exit? the latter, IMHO, is not necessary -
Are you pleased that you can’t press break with the disc pulled out?
KF> 12. Interrupt, read PrgSost, exit without errors or with write protection.
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
on the contrary! interrupting him will kill him. or sector not found. KF> 13.Decreasing the error counter and exiting if 0.
KF> 14. Command for track 0 #08
I do this: every eighth (fourth, sixteenth...)
the attempt is accompanied by running away to zero and back.
KF> 14.Waiting for end or timeout and error and _interrupt_.
KF> 15. Cancellation of the delay in point 8, went to point 5.
KF> This is how it will probably work _normal_? :-/
if you write, drop it.
KF> Here's a catch-up question: What is bit 5 in the status register after
KF> execution of auxiliary commands ???
in the Spectrum it is always "1". in other controllers repeats bit 3 (H)
in the team itself.
KF> And what is a0 - bit 0 in the sector write command
KF> ???
I never found out what it was.
KF> And accordingly bit 5 in PrgSost after reading
KF> sectors ?
Apparently, it is the same as the previous one. try it.
KF> P.S. Just don’t recommend me a bunch of programs from TR-DOS.
I don’t like it myself.
Best wishes.
Dmitry.
..LD..X-TRADE..
From
Dmitry Lomov
→
To
Kirill Frolov
14 January 1999
Hi, Kirill!
KF>>> And the PLL is a beast, it counts any feces?
DL>> the calculation is that if this sector has been read, then move on to the next one
DL>> will definitely accelerate to normal.
KF> If overclocking obviously takes more than 30ms, then this is not so.
not for acceleration, but for additional acceleration. the sector is already being read, after 10 ms
it will be generally good.
KF>>> They require the presence of system variables - in the garden.
DL>> no. several cells.
KF> How much is a few? If within 16 - it's possible. Otherwise, go to the garden.
less.
KF>>> Not all bits are returned - to the garden.
DL>> you don't need more in loaders. exception - write protection
DL>> STORM writes "disk error."
KF> I am waiting for the command to be executed based on the status bit, checking _all_ errors,
KF> I determine the readiness of the disk. You even need an index impulse - I'll delay it
KF> I measure it (an alternative can only be 50hz int).
KF>>> You need to put the stack in the ROM - in the garden.
DL>> yes.
KF> So is it necessary or not?
to the garden. KF> Write a method that works not only on scorpions, or at least tell me where
KF> STSom search? Is this not the crap that was recommended in format 6?
I have no idea what was recommended in the Format. well I don't read
I like articles :-) with a mustache :)
;A-CURRENT CYLLINDER -> A-STATUS
TEST LD (SPP),SP,D,A
LD A,#C3,(#5CC3),A
LD HL,ARET,(#5CC4),HL
LD HL,#2740
JPTR PUSH HL:JP #3D2F
ARET LD A,#D8,C,#1F,HL,#2A53:CALL JPTR
LD A,#C9,(#5CC3),A
SPP EQU $+1:LD SP,0
LD A,(#5CCD):RET
DL>>>> #d8 puts readiness, #d0 does not, but if before #d0
DL>>>> there was readiness - it will remain.
KF>>> But I need readiness - I’ll write down the commands later?
DL>> when writing a command, readiness is reset, excluding #d0 itself.
KF> Why do I need this #D0 then???
just like that :) use #d8.
Best wishes.
Dmitry.
..LD..X-TRADE..
From
Valerij Kozhevnikoff
→
To
Dmitry Lomov
14 January 1999
Здравствуй, Dmitry !
09 Jan 99 at 04:39:00, Dmitry Lomov => Kirill Frolov:
DL> Hi, Kirill!
EP>>>> Оптимальный вариант - подключить 34 контакт дисковода. Он указывает,
EP>>>> что диск есть и раскручен до рабочей скорости.
DL>>> он реализован есть на ~50% дисководов, имхо.
Hа всех. 5305,5311,5313 - только что по схеме смотрел. Контакт 34 - /RDY,
активен в нуле, указывает на готовность накопителя.
Специальным джампером можно установить условие активности этого сигнала.
Hа teac и robotron - аналогично, тоже есть.
Джамперами можно установить 3 условия активизации:
1. обращение к накопителю (т.е. мгновенная готовность)
2. вставлен диск (юзается как датчик смены диска)
3. п.2 + диск крутится 300 об/сек. (натуральная готовность)
п.2 юзается на писюках по хитрому, и сигнал в этом случае называется не /RDY, а
DCD (disk change data). Ставил я как то свой флоп robotron 720/5.25 на писюк.
Поставил, включил, вставляю дискету - каталог прочитался. Ставлю другую дискету
- что за нафиг, каталог остался от прежней, ставлю третью, четвертую - все
равно прежний.
Поставил джампер как в п.2, и всё заработало.
Фишка в том, что писюк думает: "если контакт 34 флопа не менял своего
состояния, значит дисков не меняли, и FAT перечитывать не надо".
Hа разных флопах возможны варианты, возможно датчик смены диска есть не на
всех, но детектор готовности есть обязательно.
KF>> Т.е. ??? А в остальных что там ? Готов как пионер ?
DL> либо так, либо вообще никуда не идет.
Идет. А вот куда идет - джамперы для этого есть.
Есть у меня книжка "Ремонт дисководов", в ней всё подробно разжевано, что куда
идет и для чего предназначено.
2All:
ps утверждение "трдос привык к мнгновенной готовности" неверно. Работать будет
и с немгновенной.
Советую поставить в исдосе вот этот резидентик, и в левом верхнем углу экрана
понаблюдать содержимое регистра состояния ВГ в разных ситуациях.
После установки не забыть его инициализиравать: @vg.
По адресу #3ff3 в трдосе должно быть такое: in a,(c):ret.
Старт. адрес 50000.
===================== import file vg .u ==================
section 1 of 1 of file vg.res < iS-UUE 1.00 by MK >
begin 644 vg.res
M7L,``#[_(6S##A[7KG^_B@"&/"O&.@("````X?S:;#%@!?!A`A9,^`PY\n
MM]<.`]TA9,1`$#5W6X`W2,F`"DI*7S&/&<&"'X2(Q00^M$<#2#DKDAS_E
1PR]KG__T_#5L-NPW;#@L/#
`
end
sum -r/size 64179/173 section (from "begin" to "end")
sum -r/size 3533/107 entire input file
============================ import end =======================
WBR, Jason.