home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug172.arc / UZI.LBR / INTRO.YYY / INTRO.
Text File  |  1979-12-31  |  7KB  |  175 lines

  1.         UZI: UNIX Z-80 IMPLEMENTATION
  2.  
  3.           Written by Douglas Braun
  4.  
  5.  
  6. Introduction:
  7.  
  8. UZI is an implementation of the Unix kernel written for a Z-80 based
  9. computer.  It implementts almost all of the functionality of the
  10. 7th Edition Unix kernel.  UZI was written to run on one specific
  11. collection of custom-built hardware, but since it can easily have device
  12. drivers added to it, and it does not use any memory management hardware,
  13. it should be possible to port it to numerous computers that current use
  14. the CP/M operating system.  The source code is written mostly in C,
  15. and was compiled with The Code Works' Q/C compiler.  UZI's code was
  16. written from scratch, and contains no AT&T code, so it is not subject
  17. to any of AT&T's copyright or licensing restrictions.  Numerous 7th
  18. Edition programs have been ported to UZI with little or no difficulty,
  19. including the complete Bourne shell, ed, sed, dc, cpp, etc.
  20.  
  21.  
  22. How it works:
  23.  
  24. Since there is no standard memory management hardware on 8080-family
  25. computers, UZI uses "total swapping" to achieve multiprocessing.
  26. This has two implications:  First, UZI requires a reasonably fast
  27. hard disk.  Second, there is no point in running a different process
  28. while a process is waiting for disk I/O.  This simplifies the design
  29. of the block device drivers, since they do not have to be interrupt-based.
  30.  
  31. UZI itself occupies the upper 32K of memory, and the currently running
  32. process occupies the lower 32K.   Since UZI currently barely fits in 32K,
  33. a full 64K of RAM is necessary.
  34.  
  35. UZI does need some additional hardware support.  First, there must be
  36. some sort of clock or timer that can provide a periodic interrupt.
  37. Also, the current implementation uses an additional real-time clock
  38. to get the time for file timestamps, etc.  The current TTY driver assumes
  39. an interrupt-driven keyboard, which should exist on most systems.
  40. The distribution contains code for hard and floppy disk drivers, but
  41. since these were written for custom hardware, they are provided only
  42. as templates to write new ones.
  43.  
  44.  
  45. How UZI is different than real Unix:
  46.  
  47. UZI implements almost all of the 7th Edition functionality.
  48. All file I/O, directories, mountable file systems, user and group IDs,
  49. pipes, and applicable device I/O are supported.  Process control
  50. (fork(), execve(), signal(), kill(), pause(), alarm(), and wait()) are fully
  51. supported.  The number of processes is limited only by the swap space
  52. available.  As mentioned above,  UZI implements Unix well enough to
  53. run the Bourne shell in its full functionality.  The only changes made
  54. to the shell's source code were to satisfy the limitations of the C compiler.
  55.  
  56. Here is a (possibly incomplete) list of missing features and limitations:
  57.  
  58.     The debugger- and profiler-related system calls do not exist.
  59.  
  60.     The old 6th edition seek() was implemented, instead of lseek().
  61.  
  62.     The supplied TTY driver is bare-bones.  It supports only one port,
  63.     and most IOCTLs are not supported.
  64.  
  65.     Inode numbers are only 16-bit, so filesystems are 32 Meg or less.
  66.  
  67.     File dates are not in the standard format.  Instead they look like
  68.     those used by MS-DOS.
  69.  
  70.     The 4.2BSD execve() was implemented.  Additional flavors of exec()
  71.     are supported by the library.
  72.  
  73.     The format of the device driver switch table is unlike that of
  74.     the 7th Edition.
  75.  
  76.     The necessary semaphores and locking mechanisms to implement 
  77.     reentrant disk I/O are not there.  This would make it harder to
  78.     implement interrupt-driven disk I/O without busy-waiting.
  79.  
  80.  
  81. A Description of this Release:
  82.  
  83. Here is a list of the files supplied, and a brief description of each:
  84.  
  85.  
  86. intro:        What you are reading
  87.  
  88. config.h:    Setup parameters, such as table sizes, and the device
  89.         driver switch table.
  90.  
  91. unix.h:        All strcuture declarations, typedefs and defines.
  92.         (Includes things like errno.h).
  93.  
  94. extern.h:    Declarations of all global variables and tables.
  95.  
  96. data.c:        Dummy to source extern.h and devine globals.
  97.  
  98. dispatch.c:    System call dispatch table.
  99.  
  100. scall1.c:    System calls, mostly file-related.
  101.  
  102. scall2.c:    Rest of system calls.
  103.  
  104. filesys.c:    Routines for managing file system.
  105.  
  106. process.c:    Routines for process management and context switching.
  107.         Somewhat machine-dependent.
  108.  
  109. devio.c:    Generic I/O routines, including queue routines.
  110.  
  111. devtty.c:    Simple TTY driver, slightly-machine dependent.
  112.  
  113. devwd.c:    Hard disk driver.  Very machine-dependent.
  114.  
  115. devflop.c:    Floppy disk driver.  Very machine-dependent.
  116.  
  117. devmisc.c:    Simple device drivers, such as /dev/mem.
  118.  
  119. machdep.c:    Machine-dependent code, especially real-time-clock and
  120.         interrupt handling code.
  121.  
  122. extras.c:    Procedures missing from the Q/C compiler's library.
  123.  
  124. filler.mac:    Dummy to make linker load UZI at correct address.
  125.  
  126. makeunix.sub:    CP/M SUBMIT file to compile everything.
  127.  
  128. loadunix.sub:    CP/M SUBMIT file to load everything.
  129.  
  130.  
  131. Miscellaneous Notes:
  132.  
  133. UZI was compiled with the Code Works Q/C C compiler and the Microsoft
  134. M80 assembler under the CP/M operating system, on the same hardware
  135. it runs on.  Also used was a version of cpp ported to CP/M, since
  136. the Q/C compiler does not handle macros with arguments.  However, there
  137. are only a couple of these in the code, and they could easily be removed.
  138.  
  139. Because UZI occupies the upper 32K of memory, the standard L80 linker
  140. could not be used to link it.  Instead, a homebrew L80 replacement linker
  141. was used.  This generated a 64K-byte CP/M .COM file, which has the lower 
  142. 32K pruned by the CP/M PIP utility.  This is the reason for appearance
  143. of the string "MOMBASSA" in filler.mac and loadunix.sub.
  144.  
  145. To boot UZI, a short CP/M program was run that reads in the UZI image,
  146. copies it to the upper 32K of memory, and jumps to its start address.
  147. Other CP/M programs were written to build, inspect, and check UZI filesystems
  148. under CP/M.  These made it possible to have a root file system made before
  149. starting up UZI.  If the demand exists, these programs can be included
  150. in another release.
  151.  
  152.  
  153. Running programs under UZI:
  154.  
  155. A number of 7th Edition, System V, and 4.2BSD programs were ported to
  156. UZI.  Most notably, the Bourne shell and ed run fine under UZI.
  157. In addition the 4.2BSD stdio library was also ported.  This, along
  158. with the Code Works Q/C library and miscellaneous System V library 
  159. functions, was used when porting programs.
  160.  
  161. Due to obvious legal reasons, the source or executables for most of these
  162. programs cannot be released.  However, some kernel-dependent programs
  163. such as ps and fsck were written from scratch and can be included in future
  164. releases.  Also, a package was created that can be linked to CP/M .COM
  165. files that will allow them to run under UZI.  This was used to get
  166. the M80 assembler and L80 linker to run under UZI.  Cpp was also
  167. ported to UZI.  However, it was not possible to fit the Q/C compiler
  168. into 32K, so all programs (and UZI itself) were cross-compiled under CP/M.
  169.  
  170. The Minix operating system, written for PCs by Andrew Tanenbaum et al,
  171. contains many programs that should compile and run under UZI.  Since
  172. Minix is much less encumbered by licensing provisions than real Unix,
  173. it would make sense to port Minix programs to UZI.  In fact, UZI itself
  174. could be ported to the PC, and used as a replacement for the Minix kernel.
  175.