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
-
... ... @@ -75,9 +75,9 @@ 75 75 Note on the reset command. In fact, it is instantaneous - if the controller is not busy executing an operation that cannot be interrupted, specifically - SD data exchange. While the SD data exchange is in progress, the controller does not accept any commands and the reset command can be skipped. Therefore, if the controller is busy (bit D7 is zero), the reset command is issued again. This happens quite rarely (for example, double-clicking Ctrl/C when rewriting), usually, during normal operations, the wait for writing or reading is performed in a special place and, upon completion of this operation, not a reset is performed, but completely different actions. 76 76 77 77 78 -== **001:Выборустройства**==78 +== 001: Select device == 79 79 80 - Контроллерподдерживаетдо32хпсевдодисков.Команда"выборустройства"выбираетдляработыодинизних.Кодкоманды001.Длявыбораустройстваследуетпереслатьврегистрданных(177222)номернакопителя,скоторымсобираемсяработатьизатемпослать вCSRкод001.Командавыполняетсямгновенно,т.е.завремя,покаЦПпересылаеткод"выборустройства".ПРипопыткевыбратьдискAZ,которомуненазначенфайл-образ,вбитеD15регистраCSRвозвращается ошибка.80 +The controller supports up to 32 pseudo disks. The "device selection" command selects one of them for operation. Command code 001. To select a device, you should send the number of the drive you are going to work with to the data register (177222) and then send the code 001 to the CSR. The command is executed instantly, i.e. during the time the CPU sends the "device selection" code. When attempting to select an AZ disk that is not assigned an image file, an error is returned in bit D15 of the CSR register. 81 81 82 82 Пример программы: 83 83 ... ... @@ -84,24 +84,22 @@ 84 84 {{code language="assembler"}} 85 85 ;....................... 86 86 87 -SetUni = 001; Символическоенаименованиекоманды88 - ; " Выборустройства"87 +SetUni = 001; Symbolic name of the command 88 + ; "Device selection" 89 89 90 -; Отпредыдущегофрагмента в R3 остался адресCSR+2=DR90 +; The address CSR+2=DR remained in R3 from the previous fragment 91 91 92 -; Считаем, что в R0 в битах 0-3 находится номер 93 -; устройства, остальные биты - нули, процедура 94 -; вычисления этого номера не показана. 92 +; We assume that in R0 in bits 0-3 there is the number of the 93 +; device, the remaining bits are zeros, the procedure for ;calculating this number is not shown. 95 95 96 - MOV R0,@R3; ПерешлемвDRномердискаAZ,с97 - ; скоторымсобираемсяработать95 + MOV R0,@R3; Let's send to DR the number of disk AZ, with 96 + ; which we are going to work with 98 98 99 - MOV #SetUni,-(R3); и пошлем команду "Выбор 100 -; накопителя", с исправлением адреса в R3, который 101 -; теперь снова указывает на CSR. 98 + MOV #SetUni,-(R3); and send the command "Drive selection", with the correction of the address in R3, which 99 +; now points to CSR again. 102 102 103 - TST (R3)+; Проверимнаошибкуиопять104 - ; передвинемадресвR3наDR101 + TST (R3)+; Let's check for an error and again 102 + ; move the address in R3 to DR 105 105 BMI ERR2 106 106 107 107 ;........................ ... ... @@ -108,13 +108,15 @@ 108 108 {{/code}} 109 109 110 110 111 -== **002:Установканомераблока,младшиебитыномераблока**==109 +== 002: Set block number, low bits of block number == 112 112 113 -Контроллер предоставляет машинке с МПИ в качестве дисков AZ0 - AZ7 файл-образы типа DSK на карточке микро-SD. Размер этих файл-образов и, соответственно, псевдодисков, может быть любым, вплоть до 4Г каждый. Адресация на этих псевдодисках прямая - полученный по МПИ номер блока, после сдвига, используется в качестве смещения от начала соответствующего файл-образа. Фактически, это нечто, вроде LBA на PC. 114 -\\Существуют операционные системы PDP-11, поддерживающие такие диски - RSX-11, ДИАМС, еще что-то. Однако, самая распространенная ОС - RT-11 - использует для номера блока СЛОВО (16 бит), причем код 0177777 кое-где используется в специальных целях и как размер диска не годится, поэтому для RT-11 могут быть использованы диски с максимальным числом блоков 0177776, т.е. 65534 блока (33553408 байт или 32767 К байт). Поэтому команды установки номера блока две: установить младшие биты номера блока - код 002 и установить старшие биты номера блока - код 012. Если номер блока помещается в 16 разрядов (для RT-11 - всегда), достаточно использовать команду установки младших битов номера блока, старшие биты при этом очищаются. Если номер не помещается в 16 разрядов, то сначала надо выдавать младшие биты, а потом старшие. Если попытаться сразу передать старшие биты без предварительной передачи младших, выдается ошибка. Если переданный адрес выходит за границу файл-образа, также выдается ошибка, не важно, на каком этапе - хоть при передаче младших 16 битов номера блока, хоть при передаче старших. 115 -\\Для выполнения этих действий следует переслать требуемую часть битов номера блока в DR и затем переслать в CSR код команды, после чего следует проверить на ошибку. Команды мгновенные, т.е. выполняются за один цикл обращения по МПИ. 116 -\\Пример программы в 16-разрядном варианте: 111 +The controller provides the machine with QBUS 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 received via 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. 112 +\\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. 117 117 114 + 115 +To perform these actions, you must send the required part of the block number bits to DR and then send the command code to CSR, after which you must check for an error. The commands are instantaneous, i.e. they are executed in one QBUS access cycle. 116 +\\Example of a program - 16-bit version : 117 + 118 118 {{code language="assembler"}} 119 119 ;....................................... 120 120