Last modified by Max on 2025/03/02 15:18

From version 2.14
edited by Max
on 2025/02/25 12:56
Change comment: (Autosaved)
To version 2.2
edited by Max
on 2025/02/25 11:56
Change comment: (Autosaved)

Summary

Details

Page properties
Content
... ... @@ -311,77 +311,74 @@
311 311  {{code language="assembler"}}
312 312  ;......................................
313 313  
314 -GetSiz=007; Get the "small" disk size
314 +GetSiz=007; Получить "малый" размер диска
315 315  
316 -; From fragment 3.2 (disk selection) we have in R3
317 -; DR address (177222)
316 +; От фрагмента 3.2 (выбор диска) у нас в R3 остался
317 +; адрес DR (177222)
318 318  
319 - MOV #GetSiz,-(R3); send the command
320 - TST (R3)+; return the address in R3 back to DR
319 + MOV #GetSiz,-(R3); пошлем команду
320 + TST (R3)+; вернем адрес в R3 назад, на DR
321 321   MOV @R3,DskSiz
322 322  ;......................................
323 323  {{/code}}
324 324  
325 -== 010: Allow network operation ==
325 +== **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.
327 +Код команды 010. Закончив последовательность действий по передаче очередной порции данных, и ожидая, что следующий запрос последует не сразу же, можно "утилизировать" процессорное время микроконтроллера STM32, составляющего основу AZ - занять его обслуживанием сети. В той же RT-11 это можно сделать перед выходом из драйвера AZ, перед макрокомандой .DRFIN, завершающей исполнение запроса ввода-вывода.
328 +\\Действительно, операция ввода-вывода завершена, программа ЦП в системе будет готовить новую порцию данных для вывода, или соображать (на основании предыдущих прочитанных данных), где ей еще что-то прочитать, или вообще размышлять о чем-то своём. [[image:https://forum.maxiol.com/style_emoticons/default/smile.gif||alt="smile.gif"]] Другими словами, после окончания запроса ввода-вывода, довольно высока вероятность того, что последует пауза в работе с дисками AZ. Вот, время этой паузы и можно отдать на обслуживание сети. Для этого, перед исполнением макрокоманды .DRFIN в RT-11 или ее аналога в других ОС следует отправить в CSR код 110 (разрешить сеть плюс разрешить прерывания).
329 +\\Прерывание в этом случае не произойдет, оно активируется только по завершении "длительных" операций, которые переводят контроллер в состояние "Думаю, прошу не мешать", а установленный в "1" триггер разрешения прерываний, кроме этого, разрешает еще и работу сети, если она активирована. При запуске следующей операции ввода-вывода действия в п. 3.1 (сброс контроллера) сбросят и этот триггер, после чего программа обслуживания сети, обнаружив сброс этого триггера, прекратит (приостановит) свою работу и вернет управление основной программе обслуживания дисков AZ. Максимум, что можно заметить со стороны ЦП - это небольшая (10-20 мкс) задержка исполнения команды сброса, но это вполне умеренная плата за сетевые возможности.
330 +
329 329  
332 +== **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.
334 +Код команды 011. Получив эту команду, контроллер переключается с буфера для блока на свою внутреннюю таблицу назначений (32 строки по 140 байт каждая)* . Перед выдачей этой команды следует сбросить контроллер. После выдачи этой команды следует выдать команду 015 (чтение буфера), но в этом случае будет читаться не буфер, а та самая таблица, последовательно, слово за словом.
335 +\\* начиная с версии v17, длина имени файла уже не 130 байт, а 386 байт (последнее слово - нулевое, для окончания строки)
332 332  
333 -== 011: Get AZn drive assignment table ==
337 +[[**//пример утилиты 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 -[[AZSMNT utility example>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59420]]
340 +Пример программы:
339 339  
340 -
341 -Example program:
342 -
343 343  {{code language="assembler"}}
344 344  ;...................................
345 -AZ$CSR = 177220; Controller CSR
346 -RdBuf = 012; Command "Read from controller memory"
347 -RdTbl = 011; Command "Read assignment table"
348 -TblSiz = 1120.; Table length in bytes (decimal)
344 +AZ$CSR = 177220; CSR контроллера
345 +RdBuf = 012; Команда "Читать из памяти контроллера"
346 +RdTbl = 011; Команда "Читать таблицу назначений"
347 +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.
349 +; Считаем, что в R2 находится адрес первого слова
350 +; области памяти для таблицы назначений. Процедуру
351 +; получения этого адреса не показываем.
352 352  
353 - MOV #AZ$CSR,R3; Preparing the controller CSR
353 + MOV #AZ$CSR,R3; Готовим CSR контроллера
354 354  10$: CLR @R3;
355 - TSTB @R3; Reset the controller
355 + TSTB @R3; Сбросим контроллер
356 356   BPL 10$;
357 357  
358 - MOV #RdTbl,@R3;Command "Transfer
359 - ; table"
358 + MOV #RdTbl,@R3; Команда "Передать
359 + ; таблицу"
360 360  
361 - MOV #RdBuf,(R3+); Command "Read from
362 -; controller memory. At the same time, move the address in R3
363 -; to the DR of the controller (177222).
361 + MOV #RdBuf,(R3+); Команда "Читать из
362 +; памяти контроллера. Одновременно передвинем адрес в R3
363 +; на DR контроллера (177222).
364 364  
365 - MOV #TblSiz/2,R1; Prepare the word counter
365 + MOV #TblSiz/2,R1; Готовим счетчик слов
366 366  
367 -11$: MOV @R3,(R2)+; Send the current word
368 -SOB R1,11$; and repeat 560 times
367 +11$: MOV @R3,(R2)+; Перешлем текущее слово
368 + SOB R1,11$; и повторим 560 раз
369 369  ;...................................
370 370  {{/code}}
371 371  
372 -== 012: Setting the block number, block number high bits ==
372 +== **012: Установка номера блока, старшие биты номера блока** ==
373 373  
374 -The controller provides the machine with MPI as disks AZ0 - AZ7 file-images of the DSK type on the micro-SD card. The size of these file-images and, accordingly, pseudo-disks, can be any, up to 4G each. Addressing on these pseudo-disks is direct - the block number obtained by QBUS, after shifting, is used as an offset from the beginning of the corresponding file-image. In fact, this is something like LBA on a PC.
374 +Контроллер предоставляет машинке с МПИ в качестве дисков AZ0 - AZ7 файл-образы типа DSK на карточке микро-SD. Размер этих файл-образов и, соответственно, псевдодисков, может быть любым, вплоть до 4Г каждый. Адресация на этих псевдодисках прямая - полученный по МПИ номер блока, после сдвига, используется в качестве смещения от начала соответствующего файл-образа. Фактически, это нечто, вроде LBA на PC.
375 +\\Существуют операционные системы PDP-11, поддерживающие такие диски - RSX-11, ДИАМС, еще что-то. Однако, самая распространенная ОС - RT-11 - использует для номера блока СЛОВО (16 бит), причем код 0177777 кое-где используется в специальных целях и как размер диска не годится, поэтому для RT-11 могут быть использованы диски с максимальным числом блоков 0177776, т.е. 65534 блока (33553408 байт или 32767 К байт). Поэтому команды установки номера блока две: установить младшие биты номера блока - код 002 и установить старшие биты номера блока - код 012. Если номер блока помещается в 16 разрядов (для RT-11 - всегда), достаточно использовать команду установки младших битов номера блока, старшие биты при этом очищаются. Если номер не помещается в 16 разрядов, то сначала надо выдавать младшие биты, а потом старшие. Если попытаться сразу передать старшие биты без предварительной передачи младших, выдается ошибка. Если переданный адрес выходит за границу файл-образа, также выдается ошибка, не важно, на каком этапе - хоть при передаче младших 16 битов номера блока, хоть при передаче старших.
376 +\\Для выполнения этих действий следует переслать требуемую часть битов номера блока в DR и затем переслать в CSR код команды, после чего следует проверить на ошибку. Команды мгновенные, т.е. выполняются за один цикл обращения по МПИ.
377 +
375 375  
379 +== **013: Прочитать запись оглавления HFS** ==
376 376  
377 -There are PDP-11 operating systems that support such disks - RSX-11, DIAMS, and some others. However, the most common OS - RT-11 - uses a WORD (16 bits) for the block number, and the code 0177777 is used in some places for special purposes and is not suitable as a disk size, so disks with a maximum number of blocks of 0177776, i.e. 65534 blocks (33553408 bytes or 32767 K bytes), can be used for RT-11. Therefore, there are two commands for setting the block number: to set the low-order bits of the block number - code 002 and to set the high-order bits of the block number - code 012. If the block number fits into 16 bits (for RT-11 - always), it is enough to use the command to set the low-order bits of the block number, the high-order bits are cleared. If the number does not fit into 16 digits, then first the lower bits must be output, and then the higher ones. If you try to immediately transmit the higher bits without first transmitting the lower ones, an error is returned. If the transmitted address goes beyond the file-image boundary, an error is also returned, no matter at what stage - either when transmitting the lower 16 bits of the block number, or when transmitting the higher ones.
378 -\\To perform these actions, you should send the required part of the block number bits to DR and then send the command code to CSR, after which you should check for an error. The commands are instantaneous, i.e. they are executed in one cycle of access via MPI.
379 -
380 -== 013: Read HFS TOC entry ==
381 -
382 -Command code 013, the command reads the TOC record into the internal memory area and switches the pointer to it for data transfer via DR. The TOC must be open before this.
383 -
384 -The procedure is as follows:
381 +Код команды 013, команда читает запись оглавления во внутреннюю область памяти и переключает на нее указатель для передачи данных через DR. Оглавление перед этим должно быть открыто. Порядок действий следующий:
385 385  • Сбросить контроллер.
386 386  • Выдать в CSR команду "Прочитать запись оглавления" и дождаться ее окончания.
387 387  • Выдать в CSR команду "Прочитать из памяти контроллера"