Changes for page API контроллеров AZ®
Last modified by Max on 2025/03/02 15:18
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -15,6 +15,7 @@ 15 15 * 177224 - Primary Boot Register (BOOT1) 16 16 * 177226 - Alternate Boot Register (BOOT2) 17 17 18 + 18 18 The CSR register accepts commands in bits D0-D5 and the interrupt enable bit in bit D6, all write only, always zero is read. In bit D7, the readiness bit is read. One in it means that the previous command has been executed and the controller is ready for exchange. Zero means that the controller is busy executing the previous operation, the other registers are disabled, access to any of them will cause Trap to 4. If the execution of the previous command caused an error, bit D15 is set simultaneously with bit D7. 19 19 \\Writing to registers is done only in words; byte writing is not allowed. 20 20 \\All data exchange is conducted via DR. For commands with a single-word argument, this argument should be sent to DR, and then the command should be sent to CSR. For commands exchanging with the controller buffer, on the contrary, the command should be issued and only after it a data block of a certain length should be received or transmitted. ... ... @@ -299,73 +299,73 @@ 299 299 {{/code}} 300 300 301 301 302 -== 007: Getdisksize==303 +== **007: Получить размер псевдодиска** == 303 303 304 - Therearetwocommandsforobtaining the size of a pseudo-disk,i.e.theAZnfile-imagemountedonthe selected pseudo-drive.305 -\\ IftheOSbeing used(oraprogramworkingwithdiskswithout an OS)canworkwithlarge(morethan32M)disks,youshouldusethecommand with thecode017.Thesequence of actions:resetthecontroller(command000),selectthedrive(p. 3.2)andsendthecode017to the CSR,andthen,withoutanywaiting,readfromDRfirstthe lower word,andthenthehigherwordofthesizeofthe selected drive(image file).306 -\\ IftheOSyouareusingcannotworkwithdiskslarger than32M(RT-11),youshouldusethe007command-getthepseudo-disksizewithalimit of up to32M.Thesteps are similar:resetthe controller,selectthe disk,sendthe007 code to theCSRandreadonewordofthe pseudo-disk size fromDR.Ifthesizeoftheimagefilemountedontheselectedpseudo-driveis larger than65534blocks,thecontrollerreturnsthenumber65534instead of this "large" size.Weremindyouthat the number65535isusedinsomeplacesforspecialpurposesandcannotbe the disk size.307 -\\ Wealsoremindyouthatiftheimagefileis not mounted on this drive,thesequenceofactionswill not work(command001selectdevice)andtheprogramexecutionwillsimplynotreachthis point.Therefore,thesecommandsdonotprovidefor errors.305 +Есть две команды получения размера псевдодиска, т.е. смонтированного на выбранный псевдопривод AZn файл-образа. 306 +\\Если используемая ОС (или программа, работающая с дисками без ОС) умеет работать с большими (больше 32М) дисками, следует пользоваться [[командой с кодом 017>>doc:||anchor="H017:A041F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A4302C43143E43B44C44843E439"]]. Последовательность действий: сбросить контроллер (команда 000), выбрать накопитель (п. 3.2) и переслать в CSR код 017, а затем, без каких-либо ожиданий, считать из DR сначала младшее, и следом за ним старшее слово размера выбранного накопителя (файл-образа). 307 +\\Если используемая ОС не умеет работать с дисками бОльшими, чем 32М (RT-11), следует пользоваться командой 007 - получить размер псевдодиска с ограничением до 32М. Действия похожие: сбрасываем контроллер, выбираем диск, посылаем в CSR код 007 и считываем из DR одно слово размера псевдодиска. Если размер файл-образа, смонтированного на выбранный псевдопривод, больше 65534 блоков, вместо этого "большого" размера, контроллер возвращает число 65534. Напоминаем, что число 65535 кое-где используется в специальных целях и не может быть размером диска. 308 +\\Также напоминаем, что если на этот накопитель не смонтирован файл-образ, последовательность действий не пройдет (команда 001 выбор устройства) и исполнение программы до этого места просто не дойдет. Поэтому ошибок у этих команд не предусмотрено. 308 308 309 - Exampleofaprogram with"small"disks310 +Пример программы с "малыми" дисками 310 310 311 311 {{code language="assembler"}} 312 312 ;...................................... 313 313 314 -GetSiz=007; Getthe"small"disksize315 +GetSiz=007; Получить "малый" размер диска 315 315 316 -; Fromfragment3.2 (diskselection)wehaveinR3317 -; DR address(177222)317 +; От фрагмента 3.2 (выбор диска) у нас в R3 остался 318 +; адрес DR (177222) 318 318 319 - MOV #GetSiz,-(R3); sendthe command320 - TST (R3)+; returntheaddress inR3backtoDR320 + MOV #GetSiz,-(R3); пошлем команду 321 + TST (R3)+; вернем адрес в R3 назад, на DR 321 321 MOV @R3,DskSiz 322 322 ;...................................... 323 323 {{/code}} 324 324 325 -== 010: Allownetworkoperation==326 +== **010: Разрешить работу сети** == 326 326 327 -Command code 010. Having completed the sequence of actions for transferring the next portion of data, and expecting that the next request will not follow immediately, you can "utilize" the processor time of the STM32 microcontroller, which is the basis of AZ - occupy it with servicing the network. In the same RT-11, this can be done before exiting the AZ driver, before the .DRFIN macro command, which completes the execution of the input-output request. 328 -\\Indeed, the I/O operation is completed, the CPU program in the system will prepare a new portion of data for output, or figure out (based on the previously read data) where it should read something else, or generally think about something of its own. smile.gif In other words, after the I/O request is completed, there is a fairly high probability that there will be a pause in working with the AZ disks. So, the time of this pause can be given to servicing the network. To do this, before executing the .DRFIN macro in RT-11 or its analogue in other OS, you should send code 110 (enable network plus enable interrupts) to the CSR. 328 +Код команды 010. Закончив последовательность действий по передаче очередной порции данных, и ожидая, что следующий запрос последует не сразу же, можно "утилизировать" процессорное время микроконтроллера STM32, составляющего основу AZ - занять его обслуживанием сети. В той же RT-11 это можно сделать перед выходом из драйвера AZ, перед макрокомандой .DRFIN, завершающей исполнение запроса ввода-вывода. 329 +\\Действительно, операция ввода-вывода завершена, программа ЦП в системе будет готовить новую порцию данных для вывода, или соображать (на основании предыдущих прочитанных данных), где ей еще что-то прочитать, или вообще размышлять о чем-то своём. [[image:https://forum.maxiol.com/style_emoticons/default/smile.gif||alt="smile.gif"]] Другими словами, после окончания запроса ввода-вывода, довольно высока вероятность того, что последует пауза в работе с дисками AZ. Вот, время этой паузы и можно отдать на обслуживание сети. Для этого, перед исполнением макрокоманды .DRFIN в RT-11 или ее аналога в других ОС следует отправить в CSR код 110 (разрешить сеть плюс разрешить прерывания). 330 +\\Прерывание в этом случае не произойдет, оно активируется только по завершении "длительных" операций, которые переводят контроллер в состояние "Думаю, прошу не мешать", а установленный в "1" триггер разрешения прерываний, кроме этого, разрешает еще и работу сети, если она активирована. При запуске следующей операции ввода-вывода действия в п. 3.1 (сброс контроллера) сбросят и этот триггер, после чего программа обслуживания сети, обнаружив сброс этого триггера, прекратит (приостановит) свою работу и вернет управление основной программе обслуживания дисков AZ. Максимум, что можно заметить со стороны ЦП - это небольшая (10-20 мкс) задержка исполнения команды сброса, но это вполне умеренная плата за сетевые возможности. 331 + 329 329 333 +== **011: Получить таблицу назначений приводов AZn** == 330 330 331 -In this case, the interrupt will not occur, it is activated only upon completion of "long" operations that transfer the controller to the "Thinking, please do not interfere" state, and the interrupt enable trigger set to "1" also enables network operation if it is activated. When the next input-output operation is started, the actions in paragraph 3.1 (controller reset) will also reset this trigger, after which the network service program, having detected the reset of this trigger, will stop (suspend) its work and return control to the main disk service program AZ. The maximum that can be noticed from the CPU side is a small (10-20 µs) delay in executing the reset command, but this is a very reasonable price for network capabilities. 335 +Код команды 011. Получив эту команду, контроллер переключается с буфера для блока на свою внутреннюю таблицу назначений (32 строки по 140 байт каждая)* . Перед выдачей этой команды следует сбросить контроллер. После выдачи этой команды следует выдать команду 015 (чтение буфера), но в этом случае будет читаться не буфер, а та самая таблица, последовательно, слово за словом. 336 +\\* начиная с версии v17, длина имени файла уже не 130 байт, а 386 байт (последнее слово - нулевое, для окончания строки) 332 332 333 - ==011:GetAZn driveassignmenttable==338 +[[**//пример утилиты AZSMNT//**>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59420]] 334 334 335 -Command code 011. Upon receiving this command, the controller switches from the block buffer to its internal assignment table (32 lines of 140 bytes each)*. Before issuing this command, the controller should be reset. After issuing this command, command 015 (read buffer) should be issued, but in this case it will not be the buffer that is read, but the same table, sequentially, word by word. 336 -\\* starting with v17, the file name length is no longer 130 bytes, but 386 bytes (the last word is zero, to end the line) 337 337 338 - [[AZSMNTutility example>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59420]]341 +Пример программы: 339 339 340 - 341 -Example program: 342 - 343 343 {{code language="assembler"}} 344 344 ;................................... 345 -AZ$CSR = 177220; C ontroller CSR346 -RdBuf = 012; Command"Readfromcontrollermemory"347 -RdTbl = 011; Command"Readassignmenttable"348 -TblSiz = 1120.; Tablelengthinbytes(decimal)345 +AZ$CSR = 177220; CSR контроллера 346 +RdBuf = 012; Команда "Читать из памяти контроллера" 347 +RdTbl = 011; Команда "Читать таблицу назначений" 348 +TblSiz = 1120.; Длина таблицы в байтах (десятичная) 349 349 350 -; We assume that R2 contains the address of the first word of the 351 -; memory area for the assignment table. We do not show the procedure for obtaining this address. 350 +; Считаем, что в R2 находится адрес первого слова 351 +; области памяти для таблицы назначений. Процедуру 352 +; получения этого адреса не показываем. 352 352 353 - MOV #AZ$CSR,R3; Preparingthe controllerCSR354 + MOV #AZ$CSR,R3; Готовим CSR контроллера 354 354 10$: CLR @R3; 355 - TSTB @R3; Resetthe controller356 + TSTB @R3; Сбросим контроллер 356 356 BPL 10$; 357 357 358 - MOV #RdTbl,@R3; Command"Transfer359 - ; table"359 + MOV #RdTbl,@R3; Команда "Передать 360 + ; таблицу" 360 360 361 - MOV #RdBuf,(R3+); Command"Readfrom362 -; controllermemory.Atthesametime,move the address inR3363 -; totheDRofthe controller(177222).362 + MOV #RdBuf,(R3+); Команда "Читать из 363 +; памяти контроллера. Одновременно передвинем адрес в R3 364 +; на DR контроллера (177222). 364 364 365 - MOV #TblSiz/2,R1; Preparetheword counter366 + MOV #TblSiz/2,R1; Готовим счетчик слов 366 366 367 -11$: MOV @R3,(R2)+; Sendthecurrent word368 -SOB R1,11$; andrepeat560times368 +11$: MOV @R3,(R2)+; Перешлем текущее слово 369 + SOB R1,11$; и повторим 560 раз 369 369 ;................................... 370 370 {{/code}} 371 371