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
-
... ... @@ -369,56 +369,63 @@ 369 369 ;................................... 370 370 {{/code}} 371 371 372 -== **012:Установканомераблока,старшиебитыномераблока**==372 +== 012: Setting the block number, block number high bits == 373 373 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 - 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. 378 378 379 -== **013: Прочитать запись оглавления HFS** == 380 380 381 -Код команды 013, команда читает запись оглавления во внутреннюю область памяти и переключает на нее указатель для передачи данных через DR. Оглавление перед этим должно быть открыто. Порядок действий следующий: 382 -• Сбросить контроллер. 383 -• Выдать в CSR команду "Прочитать запись оглавления" и дождаться ее окончания. 384 -• Выдать в CSR команду "Прочитать из памяти контроллера" 385 -• Прочитать из DR 11 слов записи оглавления 386 -\\Запись оглавления имеет формат: 387 -\\См. Имя Значение 388 -0 fSize Размер файла в байтах, младшее слово 389 -2 старшее слово 390 -4 fDate Дата в формате MS-DOS 391 -6 fTime Время в формате MS-DOS 392 -10 fAttr Атрибуты 1 байт 393 -11 fName ИМЯ.ТИП файла, 8+1+3+1 = 13 байт 394 -\\Смещения указаны восьмеричные. Формула в строке fName означает, что там сначала должно быть имя, максимально из восьми символов, далее должна быть точка, далее тип, до трёх символов, и завершающий нулевой байт 0х00. Если тип не указан, точка тоже не нужна. 395 -\\Атрибуты файлов в байте fAttr (восьмеричные): 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: 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): 396 396 \\001 - Read Only 397 397 002 - Hidden 398 398 004 - System 399 399 020 - Directory 400 400 040 - Archive 401 -\\ Примерпрограммы.408 +\\Example program 402 402 403 403 {{code language="assembler"}} 404 404 ;...................................... 405 -RdDir = 013; кодкоманды"Читатьзаписьоглавления"412 +RdDir = 013; command code "Read table of contents entry" 406 406 RdBuf = 015 407 407 408 408 MOV #AZ$CSR,R3 409 409 410 410 15$: CLR @R3; 411 - TSTB @R3; Сбросимконтроллер418 + TSTB @R3; Reset the controller 412 412 BPL 15$; 413 413 414 - MOV #RdDir,@R3; Попросимконтроллер415 -16$: TSTB @R3; прочитатьвсвоюпамять416 - 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 417 417 418 418 MOV @RdBuf,(R3)+; 419 - MOV DIRREC,R2; Иперенесемеексебев420 - MOV #11.,R1; областьпамяти,указатель421 -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 422 422 SOB R1,17$; DIRREC. 423 423 424 424 ;...................................... ... ... @@ -425,50 +425,51 @@ 425 425 {{/code}} 426 426 427 427 428 -== **014:Размонтироватьдиск**==435 +== 014: Unmount disk == 429 429 430 - Кодкоманды014,чтобыразмонтироватьдиск,следуетсброситьконтроллер,переслатьвDRконтроллераномерприводаAZ,которыйследуетразмонтировать,ипослатьвCSRконтроллеракод014,послечегодождатьсяокончанияоперации(онадлительная)ипроверитьнаошибку.Ошибкавыдается,еслиприводнебылсмонтирован.431 -[[ **//пример утилиты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]] 432 432 433 433 434 -== **015:Начатьпередачусчитанногоблока**==441 +== 015: Start transferring the read block == 435 435 436 - Кодкоманды-015.Получивэтукоманду,контроллернастраиваетсянапословнуювыдачусодержимоготогосамоговстроенногобуферана256слов,которыебудутвыданыпоследовательночерезрегистрDR.Никакихожиданийнетребуется,простопересылаем256разсловоизDRвпоследовательныеячейкипамяти,ивсе.Еслинужноменьше,чем256слов(последнийукороченныйблокфайла),тоостатокможнопростобросить,несчитывая,сбросконтроллеравначалеследующейоперациисброситиэтотостаток.437 -\\ Примерпрограммы: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: 438 438 439 439 {{code language="assembler"}} 440 440 ;.................................. 441 -RdBuf=015; символическоенаименованиекоманды448 +RdBuf=015; symbolic name of the command 442 442 443 -; ВR3отпредыдущегофрагментаосталсяадресCSR450 +; In R3 from the previous fragment there is the address of the CSR 444 444 ; (177220) 445 445 446 -; Считаем,чтоунасвR2находитсяадреспервогослова447 -; памяти,кудаследуетразместитьпрочитанныйблок.448 -; Программаполученияэтогоадресанеприводится.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. 449 449 450 - MOV #400,R1; Готовимсчетчикслов457 + MOV #400,R1; Prepare the word counter 451 451 ; 0400 oct = 256 dec 452 452 453 - MOV #RdBuf,(R3)+; ипересылаемкоманду454 -; 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). 455 455 456 -3$: MOV @R3,(R2)+ ;перешлемочередноесловов457 - память458 - SOB R1,3$; иповторимэто256 (0400)459 - ; раз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 460 460 ;.................................. 461 461 {{/code}} 462 462 463 -Всё, чтение закончено. 464 -\\Для записи наоборот, требуется сначала перенести весь блок данных из памяти ЦП в контроллер и потом выдать команду "Записать содержимое буфера на диск" 470 +That's it, reading is complete. 465 465 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" 466 466 467 -== **016: Принять блок данных в буфер** == 468 468 469 -Код команды 016. Команда настраивает контроллер на прием блока данных и помещении его в буфер. Следующие 256 циклов записи в DR поместят данные, переданные через МПИ, в буфер. 470 -\\Пример программы. 475 +== 016: Receive data block into buffer == 471 471 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 + 472 472 {{code language="assembler"}} 473 473 ;.................................. 474 474