Sprinter programming...

ZXNet echo conference «code.zx»

From Oleg Grigoriev To Ivan Mak 18 July 1998

Let your enemies, Ivan, die without sons! 14-07-98 at 23:49:30 Ivan Mak ═> Oleg Grigoriev: OG>> there are already all the necessary drivers... And for the writing keyboard OG>> is there? IM> The writing keyboard works automatically, like the Spectrum one. There are a little more buttons on the writing keyboard than on the spectrum movskoy... Do page down/up work in your isdos? And insert, delete, home, end? Does the keyboard give you a scancode? (or whatever his name is) If yes, then why suffer through #fe? And the driver will be smaller than the standard one, I guess... IM> Available drivers for is-dos are a printer and a ramdisk. Ram disk is crooked, you said it yourself. And the printer too, if KIR is not I was wrong. :) So there is _nothing_ under the isdos. IM> The rest, as they say here, IM> are written in five minutes. I said that they are written in an hour... And adjusted for the CD - in day. IM> But I don’t know how to write them :( If someone tells me IM> I’ll write it myself. We take the meager documents, we take the exhaustive asm, don’t forget the head. And forward, to the mines... :) IM> We need information on how to write drivers for is-dos. A little lower. IM> Especially for screen drivers. Nothing will come of it. It will be more accurate, but not what is needed. :) IM>>> Under RAM it is crooked due to non-compliance with the rules for working with the BIOS. OG>> Crooked in the sense that the frame disks are being killed? IM> If there are more than a certain volume of them. A. I see. The block was probably from ATM - meter long. IM> However, when working with is-dos, these ramdisks are neither suitable for the village nor the city. is-dos them IM> does not see If I had a desire... I don’t have it at all, to this day For now, I just can’t get around to redoing the copiers and the disk drive. blocker for working with screw... IM> and no one seems to go to TR-DOS from is-dos. What do you mean? #3d13 ? or #3d00/#3d03 ? Nobody. IM>>> Who wrote it? :)) OG>> But really, who? Not me, that's for sure. =) IM> Paul Falcon Well, he was a good man... IM> I did it in the most natural way in _5_minutes_! IM> That’s why it’s crooked. :) The crookedness comes not from the fact that it was written in 5 minutes, but from the fact that he manages the memory alone. Info on the driver structure: =====cut===== 4. RESIDENCE PROGRAMS Resident program in the system IS-DOS is called the program, constantly located in a special memory area -ty and, therefore, available for work in any time without loading it from disk. Working with the resident program under is divided into three stages: 1. Installation (loading) into memory from the disk ka, setting to address and initializing tion. 2. Main work 3. Removing a program from memory The 1st and 3rd stages are carried out set.com team. She also creates 18-bye commercial channel describing the resident program. Installed (loaded) rubber dental programs can be seen when the power of show.com and eliminat.com programs. You can contact resident programs but by names from the command line, use- using the DOS built-in command "@", example: @date+3 or @scan ch+ *.* The last line contains 2 at once names of residents. This is due to the fact that Some residency programs are designed designed to work in tandem with special service residents - scan.res and univ.res. These service residents select files (by mask, from label, etc.) and transferring them as parameter to the resident running in pair with them. That. You are launching service res- dental program, indicating as the first parameter is the name of the working resident ta, and as the second - a key or a mass ku for selecting files. Service rubber dent determines the channel number by nameworking resident, remembers it and repeatedly launches by number, pre- carefully opening the next file, suitably corresponding to the specified mask or key. Residents working in tandem with residents dents scan.res and univ.res usually have special protection against direct handling to them via the "@" command. Residency program structure: **************************************** offset length comment 0 2 Address of the initialization procedure - tions. It is called when relocation (at the same time in reg. A served FF) or delete (in reg. A FE is supplied) prog. by SET.com. If this address is 0, then the procedure not called. This program must connect if it is necessary, the resident to the center interruption kidney or other goy program, intercept restarts and restore them. 2 2 Main entrance address, i.e. launch procedures by name restarts $exebat(#44) and $run(#48) or by ca- number restart $exeres(#53) If the address is 0, then starts from the 4th byte. 4 R The body of the program - actually machine code R+4 2 #FFFF - separates the body pro- grams from the subsequent servicepersonal information R+6 2n table of configurable addresses sov - 1. Offsets from the beginning are calculated using LSA. Unit subtracted for the sake of simplicity - you setting up such commands like: CALL, JP, LD HL, LD A,(nn), most often encountered in the program. With the advent of assembler programs and faucet (as.com and link.com) takes care of everything about separator and custom table The programmer no longer has addresses. To you only need to assemble a resident task reserve 4 bytes at the beginning of the file (2 words) for entry point addresses (see. the structure just given) and from link object file(s) with key /res. Don't forget to install ORG non-zero so that address #FFFF is not got confused with the separator! 5. DEVICE DRIVERS The driver is a resident program special purpose. He serves physical or logical device any of three types: 1. Block devices: *.blk files, F8..FF driver channel numbers, numbers device channels - 00..07 2. Character output devices: files type *.typ and *.lpr, driver channel numbers ver F0..F7, device channel numbers - 08..0F 3. Character input devices: files type *.key driver channel numbers E8..EF, device channel numbers - 10..1FThe driver installed on the system has There is only an 8-letter name (type in channel not stored). typ can be distinguished from lpr by 0th bit in the 13th byte of the driver (5th byte in vector g_typ(#12)). In na- at the front of each driver there is a century- torus of standard structure: **************************************** offset length name comment 0 2 INST Program, initialization tions called as and for all residents program SET.com, and also with each re- turning on the device, serviced driver rum At the same time, in the region page A number is given devices 2 2 ENTRY1 1st entry point 4 2 ENTRY2 2nd entry point 6 2 ENTRY3 3rd entry point 8 8 service information, also stored in description of the channel triplets and in vector devices - registers states, addresses ferov, etc. 16...driver body The INST entry point can be used to switch the driver to co- corresponding device (enabled in sys_driv and in hard drive drivers), and also informs the driver (and resident) aboutthat it has been moved or turned off. All information is supplied in register A: A=0..7 - number of the device to which driver switches A=FE - driver (resident) is disabled, i.e. will be removed or just te- the current device will be coming soon replaced. This is done on that case if the driver is working state intercepts feedback to any restart or to another driver. A=FF - driver (resident) just moved Inputs ENTRY1, 2, 3 correspond to IS-DOS system restart groups: **************************************** Driver ENTRY1 ENTRY2 ENTRY3 blk $read $write $binit typ $type $tycpl $typos key $key $kwait $ktest Appendix: Driver Structure IS-DOS devices **************************************** blk - block device 0 2 INSTL - switch to device or reinstallation (if the value is 0, then the procedure is not needed) 2 2 BREAD ┐ entry points 4 2 BWRIT │ for restarts 6 2 BINIT ┘ (only for disk drives with removable media) 8 1 SCCSR - status register: bits 0...2 - device number for cache memory bit 3 - 0 - driver with buffer1 - driver without buffer bit 4 - 0 - do not execute autoflush 1 - perform autoflush with each modification cation of blocks in cache bit 5 - 0 - read prohibition for restarts 1 - read resolution for restarts bit 6 - 0 - write prohibition for restarts 1 - recording resolution for restarts bit 7 - 0 - do not use cache 1 - use cache 9 1 DRCSR - also a status register: bit 0 - 0 - do not execute the request at QVST (vector g_cnfg shifted communication +40) when communicating growth to block device 1 - execute the request bit 1 - autoflush flag specified by the user) bit 2 - 0 - TR-DOS disk 1 - non-TR-DOS disk bits 3...6 - not used bit 7 - 0 - do not process errors ($erdrv) 1 - handle errors 10 2 OFIM2 - offset from the beginning drivers up to IM2 code in the restoration procedure switching IM2 mode to select-progress from the driver. If the value is 0, then IM2 is not output is installed 12 1 TPSYS - TR-DOS type: 0 - 5.01 1 - 5.03 and above) 14 2 TMBUF - driver buffer address, Buffer volume - 1Kb. ........ 20 2 ..... - current sector number in the driver buffer ........ 30 1 ..... - drive type: bit 0 - 0 - 40 tracks 1 - 80 tracks bit 1 - 0 - one-way 1 - double-sided 31 1 TMWT - reading start delay sectors 32 1 HTIME - holo movement time wok drive 33 1 ..... - disk type: bit 0 - 0 - 40 tracks 1 - 80 tracks bit 1 - 0 - one-way 1 - double-sided 34 1 ..... - sector size, value of this byte: 1 - 256 bytes 2 - 512 bytes 4 - 1024 bytes 35 1 ..... - number of sectors per path 36 16 ..... - table of sect numbers ditch on the path Note: bytes 8...15 are also stored in the channel and in the vector of the block device stva. Bytes 33...51 are read from disk, this is nothing more than bytes 23...25 and64...79 from the zero block of the dis- ka. We'll talk more about disks in a moment. later, when describing the restart of $binit. **************************************** typ - display output device 0 2 ..... - as a rule, not used zuzyatsya 2 2 TYPE ┐ entry points for 4 2 TYCPL │ print restarts 6 2 TYPOS ┘ characters 8 1 ..... - width of the character matrix in points (6 for ty42 and 4 for ty64). Using is determined by restarts y___ and n___ WIN level 9 4 ..... - reserved 13 1 ..... - must be equal to 0 (typ sign) 14 2 ..... - reserved 16 2 GSZ character generator size in bytes 18 GSZ actual character generator - torus driver Note: bytes 8...15 are also stored in the channel and in the vector of the symbolic device output quality. Bytes corresponding to reserved are used there for storage of current print coordinates and ad- resa error handling procedures sim- free output device. **************************************** lpr - printer output device 0 2 ..... - port initialization printer, if this is not bypassed 2 2 ..... - procedure for printing symbols la, filed in reg. A,4 9 ..... - reserved 13 1 ..... - must be equal to 1 (lpr sign) 14 2 ..... - reserved Note: bytes 8...15 are also stored in the channel and in the vector of the symbolic device output quality. **************************************** key: 0 2 ..... - as a rule, not used zuzyatsya 2 2 TTYIN ┐ entry points for 4 2 KWAIT │ input restarts 6 2 KTEST ┘ from keyboard 8 1 K_CSR - status register: bit 0 - 0 - lowercase 1 - uppercase bit 1 - 0 - Latin 1 - Russians bit 2 - 0 - text 1 - pseudographics bit 3 - 0 - kwait resolution 1 - kwait prohibition(1) this bit is cleared itself with an empty buffer 9 1 M_CSR - shift permission mask corresponding bits register K_CSR 1 - shift allowed 10 1 KLAST - code of the last pressed keys 11 1 REPD - interval between first two identical keys vishami (delay auto- repeat), value by default - 29 12 1 REPP - interval between successive sharing the same keys vishami (frequency auto- repeat), value bydefault - 1 13 2 IKEYB - address of the survey procedure keyboards 14 2 ..... - reserved 16 2 KS - Code table size keys 18 KS ..... - the table itself keys ............ KS+18 1 PNKEY - number of keys pressed KS+19 1 - offset in the buffer vish to code for TTYIN (INC) KS+20 32 ..... - buffer of pressed keys (filled and emptied) via INC) =====cut===== Best wishes, Oleg aka Ruiner.