Date: February 27, 1988 To: Users of Xerox 820-II CP/M-80/86 From: Peter H. Haas Subject: CP/M-86 Generalized RAM Support Xerox's 820-II implementation of CP/M-80/86 is innovative in that both CP/M-80 and CP/M-86 may execute simultaneously, although only one may have access to the console at any point in time. This is somewhat like Concurrent CP/M-86's virtual console concept. Whereas Xerox's CP/M-80/86 implementation uses two processors (a Z80 and an 8086) to support two virtual consoles, Concurrent CP/M-86 uses a single processor (an 8086 or com- patible) to support four (or more) virtual consoles by time- slicing. Unfortunately Xerox's implementation of CP/M-86 is not general in that only 128k and 256k of RAM are supported. In fact, if exactly 128k or 256k of error-free RAM is not present, the system will assume exactly 128k of RAM is available (whether or not this RAM is error-free). A hardware modification providing 512k of RAM on the 16/8 CPU board has been developed and is available now. Hardware modifications providing 640k or 1024k of RAM on the 16/8 CPU board are under development and may be available in the near future. A software modification has been developed which generalizes Xerox's CP/M-86 RAM support. This modification and procedure for its installation given below provides Xerox's CP/M-86 with generalized RAM support, including support for 512k, 640k, and 1024k of RAM. The modification replaces the entire INIT function of the Xerox CP/M-86 BIOS. The INIT function provided by Xerox establishes a screen management area in the last 1000h bytes of the first 128k of RAM. With 256k of RAM (or more), two regions are created, one which begins at the end of the CP/M-86 system image and ends at 1f000h, and the other which begins at 20000h and ends at the end of RAM. This modification also eliminates this fragmentation by moving the screen management area to the end of RAM. Before the modification can be installed, a backup copy of CPM86.COM is made. The size of this copy is larger in order to accomodate the modification. 1) Boot CP/M-80, load DDT and read CPM86.COM. A>DDT DDT VERS 2.2 -ICPM86.COM -R NEXT PC 3C00 0100 2) Exit DDT. Note that "<^C>" means the CTRL-C key. -<^C> 3) Save NEWCPM86.COM. Note that while CPM86.COM is 59 pages in length, NEWCPM86.COM is 60 pages in length. This is necessary to accomodate the modification. A>SAVE 60 NEWCPM86.COM To install the modification, execute the following steps: 1) Boot CP/M-86, load DDT86, and read NEWCPM86.COM. Note that if the system has exactly 128k of RAM, the signon message will state "128k", otherwise the signon message will state "xxxk". a>DDT86 DDT86 1.1 -RNEWCPM86.COM START END 035C:0000 035C:3BFF 2) Display the DRI copyright notice. The copyright notice is contained in the first page of the CCP which is at offset 0d00h from the beginning of CPM86.COM. On a 128k system the segment will be 035ch. On a 256k or larger system the segment will be 2000h. In the these instructions, a 128k system is assumed. -D035C:0D00 Modify an internal table which CPM86.COM uses to write the CP/M-86 system image into 8086 RAM. This is necessary as the modification to be made increases the size of the system image. -S035C:0C81 035C:0C81 DF E2 035C:0C82 02 . -S035C:0C85 035C:0C85 DF E2 035C:0C86 02 . 3) Compute a new segment such that the CCP is at offset 0000h. 00d0h is added to the old segment. -H035C:00D0 042C 028C 4) Verify that the DRI copyright notice is as displayed above. If not, you've made a finger check, so start over. -D042C:0000 5) Move the signon message out of the modification area. It will be moved back later. Fill the modification area with 00h. -M042C:2DA5,2DD3,042C:2F00 -F042C:2D40,2EFF,00 6) Assemble the modification. -A042C:2D40 042C:2D40 MOV AX,CS 042C:2D42 MOV SS,AX 042C:2D44 MOV SP,3180 042C:2D47 MOV AX,F400 042C:2D4A MOV DS,AX 042C:2D4C MOV WORD [C380],0B06 042C:2D52 MOV [C382],CS 042C:2D56 MOV WORD [C38C],2708 042C:2D5C MOV [C38E],CS 042C:2D60 MOV BX,[46BC] 042C:2D64 MOV BX,04[BX] 042C:2D67 CMP BX,2000 042C:2D6B JZ 2DBC 042C:2D6D MOV AX,BX 042C:2D6F DEC AH 042C:2D71 MOV DX,AX 042C:2D73 SUB AX,CS: [2C01] 042C:2D78 MOV CS: [2C03],AX 042C:2D7C MOV AX,DX 042C:2D7E MOV [46E6],AX 042C:2D81 MOV [4748],AX 042C:2D84 MOV [4750],AX 042C:2D87 MOV [4762],AX 042C:2D8A MOV [476A],AX 042C:2D8D ADD AX,00C0 042C:2D90 MOV [47FC],AX 042C:2D93 MOV [C2C2],AX 042C:2D96 MOV [C2C6],AX 042C:2D99 MOV [C2CA],AX 042C:2D9C MOV [C2CE],AX 042C:2D9F MOV AX,1F00 042C:2DA2 MOV DS,AX 042C:2DA4 CMP AX,DX 042C:2DA6 JB 2DAD 042C:2DA8 XOR AX,AX 042C:2DAA CLD 042C:2DAB JMPS 2DB1 042C:2DAD MOV AX,FFF 042C:2DB0 STD 042C:2DB1 MOV SI,AX 042C:2DB3 MOV ES,DX 042C:2DB5 MOV DI,AX 042C:2DB7 MOV CX,800 042C:2DBA REP MOVSW 042C:2DBC MOV AX,CS 042C:2DBE MOV DS,AX 042C:2DC0 MOV AX,BX 042C:2DC2 MOV CL,06 042C:2DC4 SHR AX,CL 042C:2DC6 MOV CL,64 042C:2DC8 DIV CL 042C:2DCA ADD AL,30 042C:2DCC MOV [2DFE],AL 042C:2DCF MOV AL,AH 042C:2DD1 CBW 042C:2DD2 MOV CL,0A 042C:2DD4 DIV CL 042C:2DD6 ADD AX,3030 042C:2DD9 MOV [2DFF],AX 042C:2DDC MOV BL,20 042C:2DDE MOV DX,31C0 042C:2DE1 INT B2 042C:2DE3 STI 042C:2DE4 MOV BX,2DEF 042C:2DE7 CALL 2D30 042C:2DEA XOR CL,CL 042C:2DEC JMP 0000 042C:2DEF 7) Move signon message back. -M042C:2F00,2F2E,042C:2DEF 8) Write NEWCPM86.COM to disk. -WNEWCPM86.COM 9) Exit DDT86. -<^C> To install the modification, a series of REName operations is performed. Either CP/M-80 or CP/M-86 may be used. The follow- ing assumes CP/M-86 is being used. 1) Rename CPM86.COM to OLDCPM86.COM. This creates a backup copy of CPM86.COM without the modification. a>REN OLDCPM86.COM=CPM86.COM 2) Rename NEWCPM86.COM to CPM86.COM. This creates an executable copy of CPM86.COM with the modification. The patch will become active at the next boot of CP/M-86. a>REN CPM86.COM=NEWCPM86.COM To verify that the modified version of CPM86.COM is correctly installed, execute the following steps: 1) Reboot CP/M-86 and load DDT86. Note that if the system has exactly 128k of RAM, the signon message will state "128k", otherwise the signon message will state exactly how much RAM is available. a>DDT86 DDT86 1.1 2) List the modification in its actual location in the CP/M-86 system segment. The CP/M-86 system segment is 0040h. Note that after system initialization the CP/M-86 BIOS uses 2d40h through 2d55h as a scratch area so only 0040:2D56 through 0040:2DEE are listed. -L0040:2D56,2DEC 0040:2D56 MOV WORD [C38C],2708 0040:2D5C MOV [C38E],CS 0040:2D60 MOV BX,[46BC] 0040:2D64 MOV BX,04[BX] 0040:2D67 CMP BX,2000 0040:2D6B JZ 2DBC 0040:2D6D MOV AX,BX 0040:2D6F DEC AH 0040:2D71 MOV DX,AX 0040:2D73 CS: SUB AX,[2C01] 0040:2D78 CS: MOV [2C03],AX 0040:2D7C MOV AX,DX 0040:2D7E MOV [46E6],AX 0040:2D81 MOV [4748],AX 0040:2D84 MOV [4750],AX 0040:2D87 MOV [4762],AX 0040:2D8A MOV [476A],AX 0040:2D8D ADD AX,00C0 0040:2D90 MOV [47FC],AX 0040:2D93 MOV [C2C2],AX 0040:2D96 MOV [C2C6],AX 0040:2D99 MOV [C2CA],AX 0040:2D9C MOV [C2CE],AX 0040:2D9F MOV AX,1F00 0040:2DA2 MOV DS,AX 0040:2DA4 CMP AX,DX 0040:2DA6 JB 2DAD 0040:2DA8 XOR AX,AX 0040:2DAA CLD 0040:2DAB JMPS 2DB1 0040:2DAD MOV AX,0FFF 0040:2DB0 STD 0040:2DB1 MOV SI,AX 0040:2DB3 MOV ES,DX 0040:2DB5 MOV DI,AX 0040:2DB7 MOV CX,0800 0040:2DBA REP MOVSW 0040:2DBC MOV AX,CS 0040:2DBE MOV DS,AX 0040:2DC0 MOV AX,BX 0040:2DC2 MOV CL,06 0040:2DC4 SHR AX,CL 0040:2DC6 MOV CL,64 0040:2DC8 DIV CL 0040:2DCA ADD AL,30 0040:2DCC MOV [2DFE],AL 0040:2DCF MOV AL,AH 0040:2DD1 CBW 0040:2DD2 MOV CL,0A 0040:2DD4 DIV CL 0040:2DD6 ADD AX,3030 0040:2DD9 MOV [2DFF],AX 0040:2DDC MOV BL,20 0040:2DDE MOV DX,31C0 0040:2DE1 INT B2 0040:2DE3 STI 0040:2DE4 MOV BX,2DEF 0040:2DE7 CALL 2D30 0040:2DEA XOR CL,CL 0040:2DEC JMP 0000 3) Exit DDT86. -<^C> If all of the above steps have been executed correctly, then the modification installation procedure is complete. If there are any problems, then the modification should be backed-out. To back-out the modification, execute the follow- ing steps: 1) Reboot CP/M-80. 2) Rename CPM86.COM to NEWCPM86.COM. A>REN NEWCPM86.COM=CPM86.COM 3) Rename OLDCPM86.COM to CPM86.COM. A>REN CPM86.COM=OLDCPM86.COM CPM86.COM has now been restored to its unmodified state. Peter H. Haas Santa Cruz, California