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

From version 1.5
edited by Max
on 2025/02/25 11:06
Change comment: (Autosaved)
To version 1.1
edited by Max
on 2025/02/25 10:46
Change comment: There is no comment for this version

Summary

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: Select device ==
78 +== **001: Выбор устройства** ==
79 79  
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.
80 +Контроллер поддерживает до 32х псевдодисков. Команда "выбор устройства" выбирает для работы один из них. Код команды 001. Для выбора устройства следует переслать в регистр данных (177222) номер накопителя, с которым собираемся работать и затем послать в CSR код 001. Команда выполняется мгновенно, т.е. за время, пока ЦП пересылает код "выбор устройства". ПРи попытке выбрать диск AZ, которому не назначен файл-образ, в бите D15 регистра CSR возвращается ошибка.
81 81  
82 82  Пример программы:
83 83  
... ... @@ -84,22 +84,24 @@
84 84  {{code language="assembler"}}
85 85  ;.......................
86 86  
87 -SetUni = 001; Symbolic name of the command
88 - ; "Device selection"
87 +SetUni = 001; Символическое наименование команды
88 + ; "Выбор устройства"
89 89  
90 -; The address CSR+2=DR remained in R3 from the previous fragment
90 +; От предыдущего фрагмента в R3 остался адрес CSR+2=DR
91 91  
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.
92 +; Считаем, что в R0 в битах 0-3 находится номер
93 +; устройства, остальные биты - нули, процедура
94 +; вычисления этого номера не показана.
94 94  
95 - MOV R0,@R3; Let's send to DR the number of disk AZ, with
96 - ; which we are going to work with
96 + MOV R0,@R3; Перешлем в DR номер диска AZ, с
97 + ; с которым собираемся работать
97 97  
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.
99 + MOV #SetUni,-(R3); и пошлем команду "Выбор
100 +; накопителя", с исправлением адреса в R3, который
101 +; теперь снова указывает на CSR.
100 100  
101 - TST (R3)+; Let's check for an error and again
102 - ; move the address in R3 to DR
103 + TST (R3)+; Проверим на ошибку и опять
104 + ; передвинем адрес в R3 на DR
103 103   BMI ERR2
104 104  
105 105  ;........................
... ... @@ -106,67 +106,64 @@
106 106  {{/code}}
107 107  
108 108  
109 -== 002: Set block number, low bits of block number ==
111 +== **002: Установка номера блока, младшие биты номера блока** ==
110 110  
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.
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-разрядном варианте:
113 113  
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 block number:
117 -
118 118  {{code language="assembler"}}
119 119  ;.......................................
120 120  
121 -SetBlk=002; Symbolic name of the command
122 -; "Set the lower 16 bits of the block number"
121 +SetBlk=002; Символическое наименование команды
122 +; "Установить младшие 16 разрядов номера блока"
123 123  
124 -; The address DR
125 -; (177222) remained in R3 from the previous fragment
126 -; We assume that the cell labeled BLCUR contains the 16-
127 -; bit disk address (the block number to be
128 -; input or output). The procedure for obtaining this number is not
129 -; shown
124 +; От предыдущего фрагмента в R3 остался адрес DR
125 +; (177222)
126 +; Считаем, что в ячейке с меткой BLCUR находится 16-
127 +; разрядный дисковый адрес (номер блока, подлежащего
128 +; вводу или выводу). Процедура получения этого номера не
129 +; показана
130 130  
131 - MOV BLCUR,@R3;We place the block number to be exchanged in DR.
132 -
131 + MOV BLCUR,@R3; Помещаем в DR номер блока,
132 + ; подлежащего обмену.
133 133  
134 - MOV #SetBlk,-(R3); We send the command to the CSR
135 -; do not forget that the address in R3 will decrease by
136 -; 2 before sending and will remain so
134 + MOV #SetBlk,-(R3); Посылаем команду в CSR
135 +; не забываем, адрес в R3 перед пересылкой уменьшится на
136 +; 2 и таким останется
137 137  
138 - TST @R3; We check for an error
138 + TST @R3; Проверяем на ошибку
139 139  
140 140   BMI ERR3
141 141  
142 -; In the 32-bit version, the same actions should be
143 -; repeat for the senior 16 bits (actually,
144 -; senior 7, the rest should be zeros, because the maximum
145 -; size of a pseudo disk is 4G) of the disk address.
142 +; В 32-разрядном варианте те же действия следует
143 +; повторить для старших 16 разрядов (на самом деле,
144 +; старших 7, остальные должны быть нулями, ибо максимум
145 +; размера псевдодиска - 4Г) дискового адреса.
146 146  
147 -; Note that in R3 the CSR address remains, and not
148 -; DR, as in the two previous fragments. This is done
149 -; on purpose.
147 +; Обратите внимание, что в R3 остался адрес CSR, а не
148 +; DR, как в двух предыдущих фрагментах. Это сделано
149 +; специально.
150 150  
151 151  ;.......................................
152 152  {{/code}}
153 153  
154 154  
155 -== 003: Open HFS Table of Contents ==
155 +== **003: Открыть оглавление HFS** ==
156 156  
157 -Sequence of actions:
157 +Последовательность действий
158 +\\• [[сбросить контроллер>>doc:||anchor="H000:A042143144043E44143A43E43D44244043E43B43B435440430"]]
159 +• подать в CSR команду "Принять блок данных в буфер" и передать пословно всю строку с полным текстом пути (Full Path) к требуемому оглавлению. Строка должна завершаться нулевым байтом (0х00) и быть не длиннее 384 байт (192 слов).
160 +• переслать в CSR код команды "Открыть оглавление"
161 +• дождаться ее окончания (команда длительная)
162 +• проверить на ошибку
158 158  
159 -• reset the controller
160 -• send the command "Accept data block to buffer" to the CSR and transmit the entire line with the full path text (Full Path) to the required table of contents word by word. The line must end with a zero byte (0x00) and be no longer than 384 bytes (192 words).
161 -• send the "Open table of contents" command code to the CSR
162 -• wait for it to finish (the command is long)
163 -• check for errors
164 +[[**//Пример утилиты - AZDIR//**>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59418]]
164 164  
165 -[[Example utility - AZDIR>>url:https://forum.maxiol.com/index.php?s=&showtopic=5605&view=findpost&p=59418]]
166 166  
167 +Пример программы:
167 167  
168 -Example program:
169 -
170 170  {{code language="assembler"}}
171 171  ;.............................
172 172  AZ$CSR = 177220
... ... @@ -174,44 +174,46 @@
174 174  OpnDir = 003
175 175  
176 176   MOV #AZ$CSR,R3
177 -; The DirPtr cell contains a pointer to the beginning of the field with Full
178 -; Path. We assume that the string is terminated by three zero
179 -; bytes in order to recognize the end of the transfer of the
180 -; string word by word by zero. Indeed, if the number of
181 -; characters in the string is even, then the next two bytes of zeros
182 -; form a zero word; if it is odd, then one zero
183 -; will go away with the last character of the string, and the zero
184 -; word is formed by the second and third zero bytes,
185 -; ending the string. That is, such an end of the string,
186 -; transferred word by word, is quite reliable.
176 +
177 +; Ячейка DirPtr содержит указатель на начало поля с Full
178 +; Path. Считаем, что строка завершается тремя нулевыми
179 +; байтами, чтобы распознать по нулю окончание пересылки
180 +; строки пословно. Действительно, если количество
181 +; символов в строке четное, то следующие два байта нулей
182 +; образуют нулевое слово; если же нечетное, то один ноль
183 +; уйдет вместе с последним символом строки, а нулевое
184 +; слово образуют второй и третий нулевые байты,
185 +; оканчивающие строку. То есть, такое окончание строки,
186 +; передаваемой пословно, вполне надежно.
187 187   MOV DirPtr,R2
188 188  
189 - MOV #WrBuf,(R3)+; We issue the "Write to
190 - ; buffer" command and transmit the string
191 -11$: MOV (R2)+,@R3; word by word,
192 - BNE 11$ ;until zero is sent,
189 + MOV #WrBuf,(R3)+; Подаем команду "Запись в
190 + ; буфер" и передаем строку
191 +11$: MOV (R2)+,@R3; пословно, до тех пор,
192 + BNE 11$ ; пока не перешлется ноль
193 193  
194 - MOV #OpnDir,-(R3); We issue the "Open
195 - ; table of contents" command
194 + MOV #OpnDir,-(R3); Подаем команду "Открыть
195 + ; оглавление"
196 196  
197 -12$: TSTB @R3; and wait for the controller to
198 - BPL 12$; execute it,
199 - TST @R3; after which we check for an error.
200 - BMI Err10; Error -->
197 +12$: TSTB @R3; и ждем, когда контроллер ее
198 + BPL 12$; выполнит,
199 + TST @R3; после чего проверяем на ошибку.
200 + BMI Err10; Ошибка -->
201 201  ;.............................
202 202  {{/code}}
203 203  
204 204  == **004: Монтировать диск** ==
205 205  
206 -Sequence of actions:
207 -• Reset the controller
208 -• Send a line to the controller with a record similar to the lines describing the disks in the AZ.INI file
209 -• Issue the "Mount disk" command
210 -• Wait for it to finish (the command is long)
211 -• Check for errors
212 -The selected AZnn drive MUST NOT have a disk mounted. If it is mounted, the old disk should be unmounted before mounting a new one - command 014
206 +Порядок действий:
207 +• [[Сбросить контроллер>>doc:||anchor="H000:A042143144043E44143A43E43D44244043E43B43B435440430"]]
208 +• Переслать в контроллер строку с записью, подобной строкам описания дисков в файле AZ.INI
209 +• Выдать команду "Монтировать диск"
210 +• Дождаться ее окончания (команда длительная)
211 +• Проверить на ошибки
212 +На выбранный накопитель AZnn НЕ ДОЛЖЕН быть смонтирован диск. Если он таки смонтирован, перед монтированием туда нового диска следует размонтировать старый - команда 014
213 +
213 213  
214 -Example program:
215 +Пример программы:
215 215  
216 216  {{code language="assembler"}}
217 217  ;..................