home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 284_01 / cpm.doc < prev    next >
Encoding:
Text File  |  1989-03-13  |  5.8 KB  |  158 lines

  1. Porting of CP/M for the portable 8080 system
  2.  
  3.  
  4. This documentation explains the porting of CP/M.  Since the BIOS part
  5. is already implemented (I tried to use C to implement the BIOS package
  6. as much as possible.), the porting procedures are centered on copying the real
  7. CP/M to the simulated environment. It is assumed that you have the standard
  8. CP/M (8 inch single sided single density), but in case you don't have that,
  9. you need to modify the procedures appropriately.
  10.  
  11. First of all, you need to create the boot image of CP/M. This is 
  12. written in the track 0 and 1 in CP/M. Our virtual CP/M is
  13. a MSDOS file called "CPMxx.HEX". xx refers to the CP/M system size.
  14. For example, in a 20 KB system, it will be "CPM20.HEX" which is
  15. obviously Intel hexa format.
  16.  
  17. You need to extract CCP and BDOS from 20K-CP/M. If you have the standard
  18. CP/M for Intel MDS, you can use as it is because it includes the
  19. system track of 20K-CP/M. If your system supports the standard CP/M format but
  20. it is not for a 20K-CP/M, you need to create 20K-CP/M using your CP/M.
  21.  
  22. If you have 20K-CP/M, you first set the master floppy disk
  23. in the disk drive assigned as the physical drive under the virtual
  24. CP/M and execute these commands under MSDOS.
  25.  
  26.     A>type nul > cpm20.com
  27.     A>i8080 -b getsys.hex -A . -B cpm20.com
  28.  
  29. This operation copies the file CPM20.COM, which includes 20KB-CP/M, into a 
  30. MSDOS file.
  31. And then, execute 
  32.  
  33.     A>mkhex 20
  34.  
  35. As a result, a file CPM20.HEX is created. Note that a file BIOS20.HEX must
  36. exist in the current directory for this operation.
  37. CPM20.COM can be deleted after CPM20/HEX is created.
  38.  
  39. Next, with the master disk in the drive, please execute the commands:
  40.  
  41.     A>newdsk cpmsys.dsk
  42.     A>i8080 -b copyall.hex -A . -B cpmsys.dsk
  43.     A>cpmfile -d cpmsys.dsk -b -w halt.com
  44.  
  45. This operation creates a virtual disk whose contents is the same as
  46. the CP/M master floppy disk. The program HALT.COM is a command to
  47. terminate the virtual CP/M and exit to MSDOS.
  48.  
  49. With the procedures above, 20KB-CP/M is created. Please go on
  50. to the execution stage.
  51.  
  52. If the CP/M size is different, you need to create 20KB-CP/M using MOVCPM.
  53. First, you need to make a copy of the standard CP/M master disk.
  54. The procedures described below use the copy.
  55. Under CP/M, please enter the commands:
  56.  
  57.     A>MOVCPM 20 *
  58.  
  59. In response, MOVCPM gives a message:
  60.  
  61.     CONSTRUCTING 20K CP/M VERS 2.2
  62.     READY FOR "SYSGEN" OR
  63.     "SAVE 34 CPM20.COM"
  64.  
  65. Now, you enter
  66.  
  67.     A>SAVE 34 CPM20.COM
  68.  
  69. Finally, a CP/M master floppy disk including 20KB-CP/M is created.
  70.  
  71. You set this disk in the 8 inch disk drive assingned as the 
  72. physical disk drive under the virtual CP/M and execute the commands:
  73.  
  74.     A>newdsk cpmsys.dsk
  75.     A>i8080 -b copyall.hex -A . -B cpmsys.dsk
  76.  
  77. Note that i8080 command distinguishes upper-case and lower-case letters.    
  78. If this operation is successful, the size CPMSYS.DSK should be 249,600
  79. bytes. This file will be used as a CP/M virtual master disk after the 
  80. porting of CP/M is finished.  For the preparation, please execute the 
  81. command:
  82.  
  83.     A>cpmfilie -b -w -d cpmsys.dsk halt.com
  84.  
  85. The program HALT.COM is a command to terminate the virtual CP/M and exit
  86. to MSDOS.
  87.  
  88. Next, you create CPM20.HEX. Under MSDOS, please enter
  89.  
  90.     A>cpmfile -b -d cpmsys.dsk cpm20.com
  91.  
  92. This operation extracts CPM20.COM including 20K-CP/M from CPMSYS.DSK.
  93. Now, input the command:
  94.  
  95.     A>mkhex 20
  96.  
  97. This operation creates CPM20.HEX. Note that BIOS20.HEX must exist in the
  98. current directory for this operation.
  99. CPM20.COM can be deleted after CPM20.HEX is created.
  100.  
  101. Finally, you have 20KB-CP/M. Let's start running this.
  102. Please input the command below under MSDOS.
  103.  
  104.     A>i8080 -b cpm20.hex -A cpmsys.dsk
  105.  
  106. As a result, the prompt of the virtual CP/M will be displayed.
  107. ( In this case, it is the same as MSDOS prompt.)
  108. Please try DIR and you will see the display format is different from MSDOS.
  109. Please make sure that you have HALT.COM in the drive A.
  110.  
  111.     A>HALT  
  112. brings you back to MSDOS.
  113.  
  114. Since CP/M runs with the procedures described above, you can change the size of 
  115. CP/M suitable for the memory size of your virtual environment. This procedure
  116. is the same as one described above. Please note that you need to change the
  117. definition in BIOS20.ASM corresponding to the memory size specified in MOVCPM
  118. and reassemble it. (You need to change the filename, too.)
  119. You should assemble under the virtual CP/M and copy the created .HEX file
  120. into MSDOS using cpmfile.
  121.  
  122. If you want to change the floppy disk format, you need to change both a BIOS
  123. program under the virtual CP/M (BIOS20.ASM) and the BIOS simulator in i8080.
  124. In BIOS20.ASM, you need to change DPB, Disk Parameter Block. (Please
  125. refer to the CP/M manual about this.)
  126. From the new DPB table, you pick up two values, SPT (the number of logical
  127. sectors per track) and OFF (the number of tracks reserved for system),
  128. and define macros DPB_SPT and DPB_OFF in BIOS.H with these two values.
  129.  
  130. To support a physical drive, you need to modify
  131. functions, x_rd and x_wr.  When you need a blocking in the floppy aceess,
  132. it would be better to  make a change to those functions rather
  133. than changing the entries of READ and WRITE in BIOS20.ASM.
  134.  
  135. A change to the floppy format normally means a loss of
  136. portability in the virtual disk. You need to create the virtual system disk
  137. everytime. COPYALL, in this package,can't be used except with 8 inch single 
  138. sided and single density. If necessary, you have to modify for this, too.
  139.  
  140. The standard CP/M is distributed with a single CPU license. The CP/M you 
  141. purchased is allowed for use only for a machine with one CPU. Therefore,
  142. you need to purchase the CP/M for your virtual CP/M. When porting
  143. CP/M, please not violate the copyright of Digital Research.
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.