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

From version 2.13
edited by Max
on 2025/02/25 12:51
Change comment: (Autosaved)
To version 2.30
edited by Max
on 2025/02/25 14:01
Change comment: (Autosaved)

Summary

Details

Page properties
Content
... ... @@ -375,51 +375,57 @@
375 375  
376 376  
377 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 -\\Для выполнения этих действий следует переслать требуемую часть битов номера блока в DR и затем переслать в CSR код команды, после чего следует проверить на ошибку. Команды мгновенные, т.е. выполняются за один цикл обращения по МПИ.
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 379  
380 -== **013: Прочитать запись оглавления HFS** ==
380 +== 013: Read HFS TOC entry ==
381 381  
382 -Код команды 013, команда читает запись оглавления во внутреннюю область памяти и переключает на нее указатель для передачи данных через DR. Оглавление перед этим должно быть открыто. Порядок действий следующий:
383 -• Сбросить контроллер.
384 -• Выдать в CSR команду "Прочитать запись оглавления" и дождаться ее окончания.
385 -• Выдать в CSR команду "Прочитать из памяти контроллера"
386 -• Прочитать из DR 11 слов записи оглавления
387 -\\Запись оглавления имеет формат:
388 -\\См. Имя Значение
389 -0 fSize Размер файла в байтах, младшее слово
390 -2 старшее слово
391 -4 fDate Дата в формате MS-DOS
392 -6 fTime Время в формате MS-DOS
393 -10 fAttr Атрибуты 1 байт
394 -11 fName ИМЯ.ТИП файла, 8+1+3+1 = 13 байт
395 -\\Смещения указаны восьмеричные. Формула в строке fName означает, что там сначала должно быть имя, максимально из восьми символов, далее должна быть точка, далее тип, до трёх символов, и завершающий нулевой байт 0х00. Если тип не указан, точка тоже не нужна.
396 -\\Атрибуты файлов в байте fAttr (восьмеричные):
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:
385 +• Reset the controller.
386 +• Issue the command "Read the table of contents entry" to the CSR and wait for it to finish.
387 +• Issue the command "Read from controller memory" to the CSR
388 +• Read 11 words of the table of contents entry from DR
389 +\\The table of contents entry has the format:
390 +
391 +(% style="width:686px" %)
392 +|=(% style="width: 136px;" %)Offset (octal)|=(% style="width: 305px;" %)Name|=(% style="width: 242px;" %)Value
393 +|(% style="width:136px" %)0|(% style="width:305px" %)fSize|(% style="width:242px" %)File size in bytes, low word
394 +|(% style="width:136px" %)2|(% style="width:305px" %)fSize|(% style="width:242px" %)File size in bytes, high word
395 +|(% style="width:136px" %)4|(% style="width:305px" %)fDate|(% style="width:242px" %)Date in MS-DOS format
396 +|(% style="width:136px" %)6|(% style="width:305px" %)fTime|(% style="width:242px" %)Time in MS-DOS format
397 +|(% style="width:136px" %)10|(% style="width:305px" %)fAttr|(% style="width:242px" %)Attributes 1 byte
398 +|(% style="width:136px" %)10|(% style="width:305px" %)fName|(% style="width:242px" %)NAME.FILE TYPE, 8+1+3+1 = 13 bytes
399 +
400 +
401 +The offsets are specified in octal. The formula in the fName line means that there must first be a name, maximum of eight characters, then a period, then a type, up to three characters, and a terminating zero byte 0x00. If the type is not specified, the period is also not needed.
402 +\\File attributes in fAttr byte (octal):
397 397  \\001 - Read Only
398 398  002 - Hidden
399 399  004 - System
400 400  020 - Directory
401 401  040 - Archive
402 -\\Пример программы.
408 +\\Example program
403 403  
404 404  {{code language="assembler"}}
405 405  ;......................................
406 -RdDir = 013; код команды "Читать запись оглавления"
412 +RdDir = 013; command code "Read table of contents entry"
407 407  RdBuf = 015
408 408  
409 409   MOV #AZ$CSR,R3
410 410  
411 411  15$: CLR @R3;
412 - TSTB @R3; Сбросим контроллер
418 + TSTB @R3; Reset the controller
413 413   BPL 15$;
414 414  
415 - MOV #RdDir,@R3; Попросим контроллер
416 -16$: TSTB @R3; прочитать в свою память
417 - BPL 16$; запись оглавления
421 + MOV #RdDir,@R3; Ask the controller
422 +16$: TSTB @R3; to read into its memory
423 + BPL 16$; table of contents entry
418 418  
419 419   MOV @RdBuf,(R3)+;
420 - MOV DIRREC,R2; И перенесем ее к себе в
421 - MOV #11.,R1; область памяти, указатель
422 -17$: MOV @R3,(R2)+; на которую лежит в ячейке
426 + MOV DIRREC,R2; And transfer it to itself in
427 + MOV #11.,R1; memory area, pointer
428 +17$: MOV @R3,(R2)+; to which lies in cell
423 423   SOB R1,17$; DIRREC.
424 424  
425 425  ;......................................
... ... @@ -426,96 +426,97 @@
426 426  {{/code}}
427 427  
428 428  
429 -== **014: Размонтировать диск** ==
435 +== 014: Unmount disk ==
430 430  
431 -Код команды 014, чтобы размонтировать диск, следует сбросить контроллер, переслать в DR контроллера номер привода AZ, который следует размонтировать, и послать в CSR контроллера код 014, после чего дождаться окончания операции (она длительная) и проверить на ошибку. Ошибка выдается, если привод не был смонтирован.
432 -[[**//пример утилиты AZUMNT//**>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]]
437 +Command code 014, to unmount the disk, you should reset the controller, send the AZ drive number to the controller DR, which should be unmounted, and send the 014 code to the controller CSR, then wait for the operation to complete (it takes a long time) and check for an error. An error is issued if the drive has not been mounted.
438 +[[AZUMNT utility example>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]]
433 433  
434 434  
435 -== **015: Начать передачу считанного блока** ==
441 +== 015: Start transferring the read block ==
436 436  
437 -Код команды - 015. Получив эту команду, контроллер настраивается на пословную выдачу содержимого того самого встроенного буфера на 256 слов, которые будут выданы последовательно через регистр DR. Никаких ожиданий не требуется, просто пересылаем 256 раз слово из DR в последовательные ячейки памяти, и все. Если нужно меньше, чем 256 слов (последний укороченный блок файла), то остаток можно просто бросить, не считывая, сброс контроллера в начале следующей операции сбросит и этот остаток.
438 -\\Пример программы:
443 +The command code is 015. Having received this command, the controller is configured to output word by word the contents of the same built-in buffer for 256 words, which will be output sequentially through the DR register. No waiting is required, we simply send a word from DR to sequential memory cells 256 times, and that's it. If less than 256 words are needed (the last shortened block of the file), then the remainder can simply be discarded without reading, resetting the controller at the beginning of the next operation will also reset this remainder.
444 +\\Example program:
439 439  
440 440  {{code language="assembler"}}
441 441  ;..................................
442 -RdBuf=015; символическое наименование команды
448 +RdBuf=015; symbolic name of the command
443 443  
444 -; В R3 от предыдущего фрагмента остался адрес CSR
450 +; In R3 from the previous fragment there is the address of the CSR
445 445  ; (177220)
446 446  
447 -; Считаем, что у нас в R2 находится адрес первого слова
448 -; памяти, куда следует разместить прочитанный блок.
449 -; Программа получения этого адреса не приводится.
453 +; We assume that in R2 we have the address of the first word
454 +; of memory, where the read block should be placed.
455 +; The program for obtaining this address is not given.
450 450  
451 - MOV #400,R1; Готовим счетчик слов
457 + MOV #400,R1; Prepare the word counter
452 452   ; 0400 oct = 256 dec
453 453  
454 - MOV #RdBuf,(R3)+; и пересылаем команду
455 -; RdBuf в CSR. Адрес в R3 укажет на DR (177222).
460 + MOV #RdBuf,(R3)+; and send the command
461 +; RdBuf to the CSR. The address in R3 will point to DR (177222).
456 456  
457 -3$: MOV @R3,(R2)+;перешлем очередное слово в
458 - ; память
459 - SOB R1,3$; и повторим это 256 (0400)
460 - ; раз
463 +3$: MOV @R3,(R2)+we will send the next word to
464 +; memory
465 + SOB R1,3$; and repeat this 256 (0400)
466 + ; times
461 461  ;..................................
462 462  {{/code}}
463 463  
464 -Всё, чтение закончено.
465 -\\Для записи наоборот, требуется сначала перенести весь блок данных из памяти ЦП в контроллер и потом выдать команду "Записать содержимое буфера на диск"
470 +That's it, reading is complete.
466 466  
472 +To write the opposite way, you first need to transfer the entire data block from the CPU memory to the controller and then issue the command "Write the contents of the buffer to disk"
467 467  
468 -== **016: Принять блок данных в буфер** ==
469 469  
470 -Код команды 016. Команда настраивает контроллер на прием блока данных и помещении его в буфер. Следующие 256 циклов записи в DR поместят данные, переданные через МПИ, в буфер.
471 -\\Пример программы.
475 +== 016: Receive data block into buffer ==
472 472  
477 +Command code 016. The command sets the controller to receive a block of data and place it in the buffer. The next 256 write cycles to DR will place the data transferred via the QBUS in the buffer.
478 +\\Example program:
479 +
473 473  {{code language="assembler"}}
474 474  ;..................................
475 475  
476 -WrBuf=016; Символическое наименование команды
483 +WrBuf=016; Symbolic name of the command
477 477  
478 -; Перед записью нужно выполнить те же действия, что и в
479 -; пп. 3.1.-3.3. Обычно, это одна и та же программа,
480 -; просто после пункта 3.3. выполняется проверка "Что
481 -; требуется: чтение или запись?" и разветвление на
482 -; программу чтения или записи.
485 +; Before writing, you need to perform the same actions as in
486 +; pp. 3.1.-3.3. Usually, this is the same program,
487 +; just after point 3.3. a check is performed "What
488 +; is required: reading or writing?" and a branch is made to the
489 +; reading or writing program.
483 483  
484 -; После фрагмента в п. 3.3. в R3 остался адрес CSR
485 -; (177220). Будем считать, что в R2 находится адрес в
486 -; памяти ЦП, где находится блок, подлежащий записи.
487 -; Программа получения этого адреса не показана.
491 +; After the fragment in point 3.3., the CSR address
492 +; (177220) remains in R3. We will assume that R2 contains the address in the CPU
493 +; memory where the block to be written is located.
494 +; The program for obtaining this address is not shown.
488 488  
489 - MOV #400,R1; Готовим счетчик
496 + MOV #400,R1; Preparing the counter
490 490  
491 - MOV #WrBuf,(R3)+; Перешлем команду в CSR и
492 - ; переключим адрес в R3 на
493 - ; DR
498 + MOV #WrBuf,(R3)+; Let's forward the command to the CSR and
499 +; switch the address in R3 to
500 +; DR
494 494  
495 -4$: MOV (R2)+,@R3; Перешлем очередное слово
496 - ; данных
497 - SOB R1,4$; и повторим это 256 раз
502 +4$: MOV (R2)+,@R3; Let's forward the next word
503 +; data
504 + SOB R1,4$; and repeat this 256 times
498 498  ;..................................
499 499  {{/code}}
500 500  
501 -== **017: Получить размер псевдодиска, большой** ==
508 +== 017: Get ramdisk size, large ==
502 502  
503 -Есть две команды получения размера псевдодиска, т.е. смонтированного на выбранный псевдопривод AZn файл-образа.
504 -\\Если используемая ОС (или программа, работающая с дисками без ОС) умеет работать с большими (больше 32М) дисками, следует пользоваться командой с кодом 017. Последовательность действий: сбросить контроллер (п. 3.1), выбрать накопитель (п. 3.2) и переслать в CSR код 017, а затем, без каких-либо ожиданий, считать из DR сначала младшее, и следом за ним старшее слово размера выбранного накопителя (файл-образа).
505 -\\Если используемая ОС не умеет работать с дисками бОльшими, чем 32М (RT-11), следует пользоваться командой 007 - получить размер псевдодиска с ограничением до 32М. Действия похожие: сбрасываем контроллер, выбираем диск, посылаем в CSR код [[007>>doc:||anchor="H007:41F43E43B44344743844244C44043043743C43544043F44143543243443E43443844143A430"]] и считываем из DR одно слово размера псевдодиска. Если размер файл-образа, смонтированного на выбранный псевдопривод, больше 65534 блоков, вместо этого "большого" размера, контроллер возвращает число 65534. Напоминаем, что число 65535 кое-где используется в специальных целях и не может быть размером диска.
506 -\\Также напоминаем, что если на этот накопитель не смонтирован файл-образ, последовательность действий не пройдет (команда 001 выбор устройства) и исполнение программы до этого места просто не дойдет. Поэтому ошибок у этих команд не предусмотрено.
507 -\\Пример программы с большими дисками
510 +There are two commands to get the size of a pseudo-disk, i.e. the AZn file-image mounted on the selected pseudo-drive.
511 +\\If the OS being used (or a program working with disks without an OS) can work with large (more than 32M) disks, you should use the command with the code 017. The sequence of actions: reset the controller (p. 3.1), select the drive (p. 3.2) and send the code 017 to the CSR, and then, without any waiting, read from DR first the lower word, and then the higher word of the size of the selected drive (image file).
512 +\\If the OS you are using cannot work with disks larger than 32M (RT-11), you should use the 007 command - get the pseudo-disk size with a limit of up to 32M. The steps are similar: reset the controller, select the disk, send the 007 code to the CSR and read one word of the pseudo-disk size from DR. If the size of the image file mounted on the selected pseudo-drive is larger than 65534 blocks, the controller returns the number 65534 instead of this "large" size. We remind you that the number 65535 is used in some places for special purposes and cannot be the disk size.
513 +\\We also remind you that if the image file is not mounted on this drive, the sequence of actions will not work (command 001 select device) and the program execution will simply not reach this point. Therefore, these commands do not provide for errors.
514 +\\Example of a program with large disks
508 508  
509 509  {{code language="assembler"}}
510 510  ;......................................
511 511  
512 -GetBig=017; Получить "большой" размер диска
519 +GetBig=017; Get the "big" disk size
513 513  
514 -; От фрагмента 3.2 (выбор диска) у нас в R3 остался
515 -; адрес DR (177222)
521 +; From fragment 3.2 (disk selection) we have in R3
522 +; DR address (177222)
516 516  
517 - MOV #GetBig,-(R3); пошлем команду
518 - TST (R3)+; вернем адрес в R3 назад, на DR
524 + MOV #GetBig,-(R3); send the command
525 + TST (R3)+; return the address in R3 back to DR
519 519   MOV @R3,BigSiz
520 520   MOV @R3,BigSiz+2
521 521  ;......................................
... ... @@ -522,16 +522,15 @@
522 522  {{/code}}
523 523  
524 524  
525 -== **020: Получить расширенный код диагностики** ==
532 +== 020: Get extended diagnostic code ==
526 526  
527 -Код команды 020, после сброса контроллера следует выдать эту команду в CSR и затем прочитать два слова расширенной диагностики из DR. Команда мгновенная, ожидание не требуется.
534 +Command code 020, after resetting the controller, you should issue this command in the CSR and then read two words of extended diagnostics from DR. The command is instant, no waiting is required.
528 528  
529 529  
530 -== **027: Получить версию firmware AZ STM32** ==
537 +== 027: Get firmware version AZ STM32 ==
531 531  
532 -Код команды 027, возвращает 2 слова
533 -\\первое слово - 06404 = старший байт 13. это версия прошивки, младший байт 4. это версия железа - те AZБК в данном случае
534 -второе слово - 037 = это максимальный монтируемый диск - 31.
539 +Command code 027, returns 2 words
540 +\\first word - 06404 = high byte 13. this is the firmware version, low byte 4. this is the hardware version - i.e. AZБК in this case second word - 037 = this is the maximum mountable disk - 31.
535 535  
536 536  
537 537  {{code language="assembler"}}