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
-
... ... @@ -375,57 +375,51 @@ 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 -\\ Toperformtheseactions,youshouldsendtherequiredpartoftheblock number bits toDRandthensendthecommand code toCSR,afterwhichyoushouldcheckforanerror.Thecommands are instantaneous,i.e.theyareexecutedinonecycleof access via MPI.378 +\\Для выполнения этих действий следует переслать требуемую часть битов номера блока в DR и затем переслать в CSR код команды, после чего следует проверить на ошибку. Команды мгновенные, т.е. выполняются за один цикл обращения по МПИ. 379 379 380 -== 013: ReadHFSTOC entry==380 +== **013: Прочитать запись оглавления HFS** == 381 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): 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 (восьмеричные): 403 403 \\001 - Read Only 404 404 002 - Hidden 405 405 004 - System 406 406 020 - Directory 407 407 040 - Archive 408 -\\ Exampleprogram402 +\\Пример программы. 409 409 410 410 {{code language="assembler"}} 411 411 ;...................................... 412 -RdDir = 013; commandcode"Readtableof contents entry"406 +RdDir = 013; код команды "Читать запись оглавления" 413 413 RdBuf = 015 414 414 415 415 MOV #AZ$CSR,R3 416 416 417 417 15$: CLR @R3; 418 - TSTB @R3; Resetthe controller412 + TSTB @R3; Сбросим контроллер 419 419 BPL 15$; 420 420 421 - MOV #RdDir,@R3; Askthe controller422 -16$: TSTB @R3; toreadintoits memory423 - BPL 16$; tableof contents entry415 + MOV #RdDir,@R3; Попросим контроллер 416 +16$: TSTB @R3; прочитать в свою память 417 + BPL 16$; запись оглавления 424 424 425 425 MOV @RdBuf,(R3)+; 426 - MOV DIRREC,R2; Andtransferittoitselfin427 - MOV #11.,R1; memoryarea,pointer428 -17$: MOV @R3,(R2)+; towhichliesincell420 + MOV DIRREC,R2; И перенесем ее к себе в 421 + MOV #11.,R1; область памяти, указатель 422 +17$: MOV @R3,(R2)+; на которую лежит в ячейке 429 429 SOB R1,17$; DIRREC. 430 430 431 431 ;...................................... ... ... @@ -432,46 +432,45 @@ 432 432 {{/code}} 433 433 434 434 435 -== 014: Unmountdisk==429 +== **014: Размонтировать диск** == 436 436 437 - Commandcode014,tounmountthe disk,youshouldreset the controller,sendtheAZ drive number to the controllerDR,whichshouldbeunmounted,andsendthe014codetothe controllerCSR,thenwaitfortheoperationtocomplete(ittakes a long time)andcheckforan error.Anerrorisissuedifthedrive has not been mounted.438 -[[AZUMNT utility example>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]]431 +Код команды 014, чтобы размонтировать диск, следует сбросить контроллер, переслать в DR контроллера номер привода AZ, который следует размонтировать, и послать в CSR контроллера код 014, после чего дождаться окончания операции (она длительная) и проверить на ошибку. Ошибка выдается, если привод не был смонтирован. 432 +[[**//пример утилиты AZUMNT//**>>url:https://forum.maxiol.com/index.php?showtopic=5605&st=0&p=59418&#entry59418]] 439 439 440 440 441 -== 015: Starttransferringtheread block==435 +== **015: Начать передачу считанного блока** == 442 442 443 - Thecommandcodeis015.Havingreceivedthis command,thecontrollerisconfiguredtooutputwordbywordthecontentsof the same built-in buffer for256words,whichwillbeoutputsequentiallythroughtheDRregister.Nowaitingisrequired,wesimplysendawordfromDRtosequentialmemorycells 256 times,andthat's it.Iflessthan256wordsare needed(thelastshortenedblock of the file),thentheremaindercansimplybediscarded without reading,resettingthecontrolleratthebeginningofthenextoperation will also reset this remainder.444 -\\ Exampleprogram:437 +Код команды - 015. Получив эту команду, контроллер настраивается на пословную выдачу содержимого того самого встроенного буфера на 256 слов, которые будут выданы последовательно через регистр DR. Никаких ожиданий не требуется, просто пересылаем 256 раз слово из DR в последовательные ячейки памяти, и все. Если нужно меньше, чем 256 слов (последний укороченный блок файла), то остаток можно просто бросить, не считывая, сброс контроллера в начале следующей операции сбросит и этот остаток. 438 +\\Пример программы: 445 445 446 446 {{code language="assembler"}} 447 447 ;.................................. 448 -RdBuf=015; symbolicnameof the command442 +RdBuf=015; символическое наименование команды 449 449 450 -; InR3fromthepreviousfragmentthereis the address of theCSR444 +; В R3 от предыдущего фрагмента остался адрес CSR 451 451 ; (177220) 452 452 453 -; WeassumethatinR2wehavetheaddress of the first word454 -; of memory,wherethereadblockshould be placed.455 -; Theprogramforobtainingthisaddress is not given.447 +; Считаем, что у нас в R2 находится адрес первого слова 448 +; памяти, куда следует разместить прочитанный блок. 449 +; Программа получения этого адреса не приводится. 456 456 457 - MOV #400,R1; Preparetheword counter451 + MOV #400,R1; Готовим счетчик слов 458 458 ; 0400 oct = 256 dec 459 459 460 - MOV #RdBuf,(R3)+; andsendthe command461 -; RdBuf totheCSR.TheaddressinR3willpointtoDR (177222).454 + MOV #RdBuf,(R3)+; и пересылаем команду 455 +; RdBuf в CSR. Адрес в R3 укажет на DR (177222). 462 462 463 -3$: MOV @R3,(R2)+ wewillsendthe next word to464 -; memory465 - SOB R1,3$; andrepeatthis256 (0400)466 - ; times457 +3$: MOV @R3,(R2)+;перешлем очередное слово в 458 + ; память 459 + SOB R1,3$; и повторим это 256 (0400) 460 + ; раз 467 467 ;.................................. 468 468 {{/code}} 469 469 470 -That's it, reading is complete. 464 +Всё, чтение закончено. 465 +\\Для записи наоборот, требуется сначала перенести весь блок данных из памяти ЦП в контроллер и потом выдать команду "Записать содержимое буфера на диск" 471 471 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" 473 473 474 - 475 475 == **016: Принять блок данных в буфер** == 476 476 477 477 Код команды 016. Команда настраивает контроллер на прием блока данных и помещении его в буфер. Следующие 256 циклов записи в DR поместят данные, переданные через МПИ, в буфер.