I have a large stack of five-inch floppy disks from a computer on my window, which my parents gave me at three years old, and from which I was able to climb onto a PC only at 14. This is Quorum-128, our Ural Spectrum clone. The clone is quite interesting and significantly different from, for example, the Ural “Magik”. He worked with a tape recorder like any other Spectrum, but when you connected a Kvorumovsky drive controller, it was not so easy to get it! - he was able to work in OS CP / M-80. I want to tell you about this OS and its implementation on “Quorum” today.

')
A bit of theory: Spectrum without CP / M
Let's start with the fact that we recall the architecture of the classic Spectrum - to understand how different CP / M is from it. I apologize in advance for possible inaccuracies - it was all a long time ago.
The Spectrum-48 is assembled on a Z-80 processor with 8-bit registers and 16-bit addressing. In the Spectrum was 16 KB of ROM, occupied by the interpreter of the BASIC dialect, which served simultaneously as the operating system for the machine; and 48 Kbytes of RAM, of which 6.75 Kbytes was occupied by video memory with very specific addressing, into the device of which we will not go into now. The shared memory card looked like this:

Of course, BASIC programs on a processor with a frequency of 3.5 MHz were utterly inhibited, and all the normal guys then wrote in assembler, and BASIC programs were usually assigned the role of a loader, which loads the assembler modules from the cassette at specified addresses and transfers control to them. (Real boys and loaders had cunning assembly language, but not the essence.)
Spectrum-128, as it is easy to guess, expanded the total RAM of the machine from 48 to 128 Kbytes (and added the AY-3-8910 / 12 musical coprocessor, which in the second half of the 90s was already a severe deficit, and in my Quorum it was did not appear). But since the address of 128 Kbytes was no longer included in the 16-bit bus, a special, not very convenient system was used: the whole memory was divided into 8 banks of 16 Kbytes, and it was possible to “imprint” any of the top 16 Kbytes of address space (0xC000-0xFFFF) from these 8 banks, bringing special value to port 0x7FFD. (Yes, the memory areas 0x4000-0x7FFF and 0x8000-0xBFFF were also ordinary memory banks - I do not remember the numbers now - and in 0xC000-0xFFFF it was possible to mirror them.) In addition, there were two banks of the ROM in the Spectrum-128 with a classical interpreter BASIC, and with a more advanced one, in which the line editor was changed to a primitive full-screen, and the functions of BASIC itself and the OS were separated - a simple menu system was added, thanks to which you could turn on loading from the tape without going to BASIC and not typing sacral LOAD "" :)
Finally, for the Spectrum there were a number of different drive controllers, of which Beta Disk Interface was the most popular (and the only one used in the Russian Spectrum clones). He added another bank of ROM to the Spectrum, which was switched on instead of the usual hardware and intercepted control when going to the addresses 0x3D00-0x3FFF, if I'm not mistaken. The controller's ROM contained a very primitive disk operating system TR-DOS, which worked with floppy disks of 640 Kbytes and was controlled by commands similar to BASIC commands. The controller also had a special Magic Button button, when clicked, a full memory dump was recorded on the disk (48 Kbytes - I did not know about the Spectrum-128 TR-DOS). This allowed instead of making a full-fledged adaptation of Spectrum programs and games under the drive, simply load the program from the tape, press the button and reset it to disk. Then you could download it from a floppy. Of course, if the program had, for example, a save and write function, then they continued to work with the tape, but on the whole it was very convenient.
CP / M-80 operating system
The CP / M-80 was designed for machines on Intel i8080 processors and compatible Zilog Z-80 by Digital Research in the 1970s. CP / M stands for Control Program for Microcomputers; The suffix -80 officially appeared in the title only when the CP / M-86 for PC and 8088/8086 processors appeared. Before the PC quickly began to gain popularity, the niche of personal, relatively low-power computers was occupied by machines with CP / M-80.
CP / M-80 was one of the first operating systems in the modern sense. It was in her that such a feature appeared as the abstraction of programs from physical equipment, and this was the reason for its (relative) popularity. The CP / M-80 consisted of three modules in memory: CCP (Console Command Processor - a primitive command interpreter), BDOS (Basic Disk Operating System - implementation of system calls) and BIOS (Basic Input / Output System - drivers of standard devices: a disk, console, printer and serial interface). When porting CP / M to a new machine, it was necessary to rewrite only the BIOS; CCP and BDOS were hardware independent. Application programs could use BDOS functions, or, if necessary, directly BIOS, but were spared the need to know the wisdom of working with disk controllers of different machines.
Of course, in practice, everything was not so smooth. The biggest omission of BDOS / BIOS was the absence of any standardization of display functions, except for the most primitive, those that fit the terminal-teletype. As a result, programs that included functions such as an on-screen editor (like WordStar and Turbo Pascal) offered to choose from a few dozen machines known to developers, or, if there were no machines in the list, enter your own screen sizes and various control codes to move the cursor, etc. Well, it's the little things.
The shared CP / M-machine memory card looked like this:

We note again that this memory card will be valid on any machine with CP / M. Therefore, there are many uncertainties. There is no video memory, for example (and it’s not a fact that it will be present in reality - maybe the machine is generally connected to a teletype), but the only addresses whose contents are guaranteed are 0x0000-0x0100. To make a system call, you need to put its number in the C register, if I'm not mistaken, and then execute the CALL 0x0005 instruction; The JMP instruction at the address 0x0005 already performs the transition where necessary in BDOS. Also in this area are available:
- entry point in BIOS (address 0x0000). This function reboots the machine, but with simple arithmetic you can get the address of any other BIOS function;
- current disk number (A: = 0, B: = 1 ...);
- directing current I / O streams (for example, the console can be directed to a printing device, or to a serial port);
- file names (no more than 2), passed to the loaded program as command line parameters, in FCB data structures, suitable as arguments of BDOS function calls;
- full command line of the current program (addresses 0x0080-0x00FF - no more than 127 characters).
The amount of TPA (areas for downloadable programs) was also not guaranteed and, in principle, could, depending on the implementation, be anywhere from 10 to 52 KB.
The CP / M-80 file system is much simpler than the FAT, although it handles its tasks quite satisfactorily. Files are stored with the names of 8.3; creation / change dates are not stored (the availability of RTC hours on machines with CP / M is not guaranteed); The file size is stored with an accuracy of 128 bytes, rounded up (the amount of space on the disk is 4 KB). Also, there are no directories, in general - to work with hard drives CP / M was not designed, but with floppy disks you can live like that. There was, however, a kind of surrogate called “user area”. These areas were numbered from 0 to 15, and separate files could be stored in each of them. Switched they command USER
n .
If we are talking about teams, there were a few of them: DIR, SAVE, ERA (delete files), REN (rename files), USER, maybe one or two more. (SAVE performed a rather specific function - saving TPA contents to disk - if, for example, you started the debugger, loaded the program in it, clicked on it, exited and want to save the remaining version in memory.) The popular extension for CP / M was the alternative command ZCPR3 interpreter, much more sophisticated. However, I myself have not tried.
In general, CP / M was very similar to the early version of DOS, yes, in general, and no wonder - DOS was developed as a clone of CP / M. For CP / M-80 there was a lot of application software - office software, development tools, utilities. But with the advent and rapid development of the PC, all this quickly became irrelevant - just like the CP / M-86 version, which failed to make any significant DOS competition.
The source code for CP / M of various versions and its system utilities (in assembler) is easy to find on the Internet.
How to cross CP / M and Spectrum
At CP / M and the Spectrum, the only common thing is that they work on the Z-80 processor. If we compare their memory cards, we see practically nothing in common, and the periphery expected on the CP / M and on the Spectrum machine is significantly different. Nevertheless, the creators of the Quorum were able to make a machine that can simultaneously work with CP / M, and as a rather ordinary Spectrum. What had to change?

First of all, in the Quorum we are disturbed by the ROM. There is no ROM in CP / M (although the BIOS may well be located in the ROM, all the same, the BIOS is not at the very beginning, but at the very end of the addressable space, and its volume is much less than 16 Kbytes). Therefore, in the Quorum, the memory management port 0x00 was added, which allows you to switch the Spectrum-Quorum ROM to an additional 16 KB of memory in the addresses 0x0000-0x3FFF. Therefore, by the way, the youngest model of the Quorum is not called the “Quorum-48”, but the “Quorum-64” - there really is an extra 16 Kbytes of RAM left specially for the CP / M mode.
(Actually, the Quorum-64 is not yet the youngest model - before it was either the Quorum BK-02, or the Quorum BK-04, which is a simple clone of the Spectrum and does not know how to launch .)
In addition to the ROM, we are hampered by the video memory, which will stick with us right in the middle of the precious TPA space. So the second function of the port 0x00 - switching the video memory addresses - from the default 0x4000-0x5AFF to 0xC000-0xDAFF. In the second mode, the video memory will be squeezed in the middle of BDOS and BIOS, but they, adapted for the Quorum, know about it, and the programs will not necessarily know.
Speaking of video memory, there is only one video mode on the Spectrum, 256x192 with 16 colors. (More precisely, 256x192 is the resolution of a monochrome picture, which is then superimposed with color attributes in a resolution of only 32x24 - so there can be no more than 2 different colors in each 8x8 pixel section. But these are details.) The text is displayed in 8x8 pixels, which gives 24 lines of 32 characters - which is conveniently superimposed on the structure of the video memory, but frankly not enough for most practical purposes. Most non-adapted CP / M programs generally expect that the line contains at least 80 characters!
Therefore, there are four modes for outputting text in the Quorum CP / M - 42 characters per line (6x8 font), 51 characters per line (5x8 font), 64 characters per line (4x8 font) and 83 characters per line (3x8 font). By default, after loading, 42 characters are used per line:

Looks pretty decent in my opinion. The 4x8 font is stored in memory simultaneously with 6x8, and, for example, in the text file viewer shown, you can switch to it with one F5 button:

Very inconvenient, but you can adapt - if you did not have the worst TV connected to your computer (Quorum, like all Spectra, usually worked with a TV instead of a monitor). This mode is well suited for editing text for later printing - text printed on a matrix printer with 64 characters in a line looks pretty good.
Using the TTY51.COM and TTY80.COM commands, you can switch to 5x8 and 3x8 fonts. 3x8 is, of course, a hell of a hell - look at the screenshot of 4x8 and imagine that all these tiny letters are also stuck together in one line without gaps between them. This mode sometimes had to be used to launch programs unadapted for the Quorum (Quorumians sold several diskettes with utilities and development tools for CP / M, simply downloaded from the Internet and recorded as-is).
Well, a little about the disk part. The Quorum drive unit, slightly smaller than the current Micro-ATX system unit, was made of solid steel thickness, painted gray, and had two five-inch bays. A system diskette with a basic set of utilities and several games was attached to it - in fact, the image of a newer version of this diskette is the only one I found for the emulator. After the purchase - that year in 1998 - he refused to work for me, which cost me ten years of considerable frustration; in the end we got it repaired under warranty. I caught the block in a vertical version with a black five-inch drive "Electronics MS-6313" or something like that. The disk drive was of very poor quality; floppy disks were lightweight. At Quorum, I was changed to a more adequate five-inch Panasonic, then the second Mitsumi was installed, and then the second was replaced by a three-inch Samsung. However, all the same, the floppy disks they all ate only on the way, and CP / M one day began to give out terrible messages “BDOS ERR ON A: BAD SECTOR”.
Unfortunately, I have not had a drive block or Quorum for a long time, so now I am writing from memory and taking screenshots from the emulator :)
Inside, in addition to the drive bays, there was a controller board with the traditional K1818VG93 chip for the Spectrum clones, and a power supply. The vulnerability of the drive unit was the interface with the computer - a short wide cable stretched from the unit, at the end of which a heavy metal box dangled somewhere 8x8x1 cm with an interface card inside that needed to be mounted on the edge connector behind the computer; Quorum, like most Spectra, was merged into a single package with a keyboard. The reliability of such a connection was low.
The floppy disks, both five-inch and three-inch, were understood by the disk drive exclusively in the Double Sided / Double Density format, 800 KB. Under DOS, it would be 720 KB of floppy disks, but CP / M used its own formatting: 2 sides, 80 tracks, 5 sectors, a sector size of 1024 bytes. On bootable diskettes, 20 KB was occupied by the OS; it was not visible from the file system, it just occupied the first two tracks. To work with three-inch floppy disks from the store, it was necessary to glue a hole on them (opposite to that with a slider to protect from writing) with an opaque adhesive tape.
Perhaps because of this formatting, disk access in CP / M was
extremely slow. This (along with the insufficient screen resolution to work in full text modes) was, in my opinion, the main drawback of the system. Of course, floppy disks are not fast in and of themselves, but a couple of tens of kilobytes per second should quietly pull out; in CP / M on the Quorum, the actual read speed did not exceed 2–5 Kb / s. This is not a hardware problem - everything works just as slowly even in an emulator, and TR-DOS will be noticeably nicer. It was especially sad to copy something between floppy disks with just one floppy drive.
On the program side of the CP / M, the quorum of disk drives also actually supported only two. On Quorum-128, 64 Kbytes of extended memory were also used as a C: RAM disk, which could be quite convenient, especially with such a speed of working with the disk.
BDOS in the CP / M Quorum was slightly doped to make the user areas somewhat more practical and similar in appearance and in the way they work on directories. The number of areas increased from 16 to 32, areas with numbers> 10 allowed to call letters (10 = A, 11 = B ...), added the current user area to the command line prompt (it was A>, became A: \ 0>), and added in the command line interpreter, the ability to launch programs and specify files from other areas of the user (\ A \ FILE.TXT).

In general, I can not say that it was so very convenient. The surrogate remained the surrogate. Well, I suppose, better than nothing.
Separately, it should be said about the compatibility of CP / M Quorum and Spectrum games. This is a very important aspect - after all, where would Microsoft be now, for example, without its sacred backward compatibility? :) For this task — seemingly intractable — several solutions were also found, which we will discuss below.
Quorumians - as I understand it, in fact this is one person by the name of Karimov - did a great job by writing from scratch under CP / M Quorum many utilities (for example, NC.COM, a simple two-pane file manager), and adapting even more third-party software, starting with the CP / M itself and ending with Turbo Pascal. I remember well how I went to them in childhood to write floppy disks and ask accumulated questions. Quorum was located on the fifth, last floor of the Univerbyt shopping complex, which was not yet a glamorous shopping center. Behind the heavy iron door everything was inundated with computers, drawings, parts, and various strange units. Straight touch to a miracle. It is a pity that now there are no such places, and if there is, they will not be perceived like that.
Software for CP / M
Practically on every Quorum diskette, first of all, there was their classic couple - the NC.COM shell:

And the text editor ED.COM:

NC.COM was, as you can guess from the name, a variation on a two-pane file manager. Its useful features include working with user areas as subdirectories, copying files (CP / M didn’t know how to do that, although it had some simple external utility for that), viewing text files in KOI-8, KOI encodings -7, “GOST-Primary” and DOS CP866 (by the way, KOI-8 was chosen as the main coding for CP / M of the Quorum - apparently, because when cutting the 7th bit, the old unadapted programs can sin, it turns more or less into translit), and copying files to DOS floppies and back - the latter, except N C.COM, in my opinion, no one else could.
ED.COM, despite the name, was more like Unix vi than ed (and strictly speaking, if you believe the instructions, was a version of a WordMaster). He, like vi, had two main modes - text input and command mode. Of course, the instruction set was much more modest than that of vi, but the ability to create macros from commands and write them in .MED files was already there. Here is one of the help pages, for example:

ED.COM was suitable for a set of programs (although with such a brake disk subsystem as on Quorum, the sequence “launched ED.COM — edited — released — compiled — linked — launched everything worked — go to step 1” required patience from the glacier) and simple text files. In principle, I wrote in it and any essays with formatting (without pictures, of course). This is done simply: you take instructions from the printer - oh, my SM-6337 is generally worthy of a separate post! .. - open the directory of control codes and insert them manually in the right places. Fortunately, matrix printers, even SM-6337, usually use more or less compatible Epson-shaped control codes.
From other software on the system diskette, we can mention FORMAT.COM, SGEN.COM (recording the OS on the system tracks, and allowing you to adjust some cosmetic parameters), SUBM.COM (running .SUB files — some sort of .BAT, only without variables and any controls like if, loops, etc.) and POWER.COM, which allows you to mess around with disks at a low level.
Quorum’s diskettes could have written (for 10 rubles each) a lot of interesting things, including:
- WordStar word processor , once hellishly popular program, almost a killer app for CP / M. WordStar made it possible to format the text in a more adequate way than to manually enter the printer control codes, but on the text screen, of course, there was no WYSIWIG about it, and generally it got into the Quorum WordStar screen so-so. His large panel of modes and tips at the top of the screen from a height of years suspiciously reminds ... the Office 2007/2010 tape :)
- SuperCalc , spreadsheet. Linux users can install the sc package themselves, or at least have it in most distros, and get a pretty close idea of ​​SuperCalc. It actually looked good, but I never managed to figure out why I might need spreadsheets.
- Microsoft BASIC-80 . Yes, yes, the one from which Bill Gates went to success. It is quite an adequate dialect of BASIC, in terms of functionality - something between a Spectrum BASIC and QBASIC, which we went through at school. BASIC-80 had a built-in line editor, which was not good news, as convenient, but much better than the editor-compiler-run cycle. The program, debugged in the interpreter, could be compiled with the BASCOM.COM compiler, and then linked with runtime and, if desired, with assembler procedures.
- Microsoft M80. More or less standard assembler i8080 / Z-80 under CP / M-80. The assembler is the assembler, what to take from it. The kit includes the actual assembler M80.COM, linker L80.COM and librarian LIB80.COM. IDE or editor is not. The ZSID.COM debugger and a surprisingly suitable DASM.COM disassembler were also supplied on diskette.
- Borland Turbo Pascal . Version 3.02A. Without exaggeration, the best development tool for CP / M. IDE — , , . . , . — 10- , IDE.
- BDS C . . , IDE .
- . . — : . CP/M . , ( SQUEEZE.COM Q, CRUNCH.COM — Z, CRLZH.COM, — Y), .LBR- LU.COM NULU.COM. ARC, ARJ ZIP. ARC, .
For compatibility with Spectrum software in CP / M Quorum there are two very interesting programs - BETA.COM and GAMMA.COM.BETA.COM is actually the TR-DOS emulator. From the word Beta Disk Interface. On the Quorum-128 TR-DOS is in the ROM and such an emulator in general is not needed, but on the Quorum-64 without it there will be no TR-DOS. The emulator is loaded into the zero page of RAM - the one that can be imprinted instead of the Spectrum ROM - and works like the most ordinary TR-DOS. Probably crooked in some places. Although the TR-DOS built into the Quorum-128 is actually somewhat crooked, many programs that require low-level access to the disk do not refuse to work. It is sad.
GAMMA.COM is a much more interesting invention. In fact, this is a special version of the CP / M Quorum for running Spectrum games, called Gamma-DOS.
Gamma-DOS, like BETA.COM, uses a trick with the bottom 16 Kbytes of RAM, but instead of TR-DOS, they are loaded neutered for the most I don’t want CP / M. The font in it is standard Spectrum, a third of the screen is not used at all (to save memory - you must save the remaining two thirds somewhere at the time of entering Gamma-DOS), there are no user areas, the TPA area is trimmed to several kilobytes - although simple utilities CP / M still run normally.After launching Gamma-DOS (which can be done both from CP / M, the GAMMA.COM command, and booting from a floppy disk, where Gamma-DOS is recorded in the system tracks instead of CP / M), you can exit into Spectrum BASIC with the SOS command. After that you can download any game from the tape recorder. After loading, by pressing the NMI key (Non-Masked Interrupt - non-maskable interrupt - in Z-80 it makes a transition to the address 0x0066 and cannot be ignored) control will be transferred to Gamma-DOS, after which you can save the game with the SAVE command and then return into it with the RET command. Games are saved in .SPC format - in fact, this is the same memory dump as in TR-DOS with a “magic button”, only compressed.The NMI trick is possible due to the verification provided in the Spectrum ROM of the Quorum - it switches to the zero RAM page if it contains the JMP processor instruction at 0x0066 - in other words, the ROM checks if there is a processor for the NMI in RAM.Games in the .SPC format can be run from the command line, as well as the usual .COM commands, but usually a shell like RUN.COM is used for this:
And go! :)
It is worth noting that in my memory, Gamma-DOS was not very stable and quite often when trying to save a game, it gave out “BDOS ERR ON A: BAD SECTOR” on seemingly completely normal diskettes. So I often used not Gamma-DOS, but SCREEN - a shell with a pseudo-graphic interface (and limited image editing tools - hence the name), which works much faster and more stable than Gamma-DOS, and more convenient to use. SCREEN even had its own API - for it there was a separate format of executable files, .EXE - but I could not find its descriptions anywhere, nor did the descriptions of how SCREEN worked. I suspect that Gamma-DOS was still there somewhere in the depths.The biggest disadvantage of both Gamma-DOS and SCREEN was that they only supported programs for the Spectrum-48. Toys for the Spectrum-128, and this, of course, were often the coolest toys, could only be launched from the TR-DOS Quorum-128. Alas and ah.
The present
Quorum, unfortunately, did not gain such fame as the epic Pentagon, Scorpio or Pro, and remained a Yekaterinburg shtetl computer, most of whose users probably didn’t suspect that it has a disk drive and some kind of CP / M there. Theoretically, the Quorum-256, Quorum-512, and even Quorum-1024 models existed, but it was quite nontrivial to buy them, if at all possible. Now, no "Quorum Ltd.", as far as I know, has long existed.The UnrealSpeccy emulator adapted to Quorum can be downloaded here: http://atmturbo.nedopc.com/emulator/kv_emul/unrl020q.zip , and the image of the system diskette is here: http://atmturbo.nedopc.com/others/kvorum/kv_cpm/kv_cpm .zip . Some software is also in this archive:http://atmturbo.nedopc.com/others/kvorum/kv_soft2/kv_soft2.zip (not an image, separate files), including the M80 assembler and the CP / M-80 programmer’s manual in Russian. Thanks to the person who put it all; As far as I know, there are no other images of Quorum diskettes on the Web Successful experiments :)