home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C128CPM / PIPMAG6.ARK / ZEN&CPM.DOC < prev   
Encoding:
Text File  |  1990-07-25  |  23.0 KB  |  365 lines

  1.                             Zen and the Art of CP/M
  2.         
  3.                                        by
  4.  
  5.                           Robert Coleman (R.COLEMAN3)
  6.  
  7.  
  8.         It was late.  Maybe midnight, and quiet in the house.  Upstairs, my 
  9.      wife and son were probably asleep.  I could hear the faint sound of 
  10.      the TV droning; that and the soft breeze outside my opened window.  
  11.      Whoosh!  Drive A on my computer was busy at work.  I was backing up 
  12.      some files and doing general housekeeping after a long session at the 
  13.      keyboard.  Tic-tic, whoosh, tic-tic!  Drive B kicked in.  I watched.  
  14.      I had to smile.  It was noisier than drive A -- always was (I could 
  15.      close my eyes and tell which of my drives were running, just by the 
  16.      sounds they made).  Drive B was perhaps the better of the two.  It was 
  17.      newer.  But they were both slow; just as slow and tired as I was now.  
  18.      I looked up at the window and felt the cool breeze on my skin.  No, 
  19.      they weren't the fastest drives.  Not like the 1.2 Meg on my 386 at 
  20.      work.  That was much faster; faster by a country mile.  And I pushed 
  21.      it too -- pushed the hell out of it.  But that was work.  Now, just 
  22.      being here late at night with this old CP/M computer, it was somehow 
  23.      different...
  24.  
  25.         Zen and the Art of CP/M?  (...like Motorcycle Maintenance?  [1]) 
  26.      Crazy?  Hey, I'm not the first to get this feeling of religious fervor 
  27.      over a computer operating system.  How about 'The SOUL of CP/M' and 
  28.      'The CP/M BIBLE' [2,3].  Mr. Waite and associates, they too had 
  29.      reverence for this IDEA.  In spite of MS-DOS, countless thousands 
  30.      still cling to CP/M.  Why?  Good question.  Perhaps it has more to do 
  31.      with the intangibles -- faith, acceptance, quiet devotion, and a brand 
  32.      of grass-roots, seat-of-the-pants wisdom.  The CP/Mer assumes a 
  33.      tongue-in-cheek posture; all the while, watching the rest of the 
  34.      computer world spin its wheels in a deluge of glitter, gloss and 
  35.      Madison Avenue hype.  It appears that regardless of the odds, in an 
  36.      era of disposable widgets and planned obsolescence, in the face of 
  37.      such staunch and resolute adversity, CP/M is here to stay.  In the 
  38.      words of one PIPMAG author, Jim Taylor, CP/M is 'the peoples operating 
  39.      system'.
  40.  
  41.         It is interesting that in spite of CP/M's continued popularity, the 
  42.      name 'CP/M' has been interpreted to mean several things:  The CP/M 
  43.      Bible refers to it as 'control program for microprocessor'.  In one 
  44.      Digital Research, Inc. CP/M Users Manual dated 1979, it is referred to 
  45.      as 'control program for microcomputer'.  Still, I have heard it 
  46.      referred to as 'control program monitor'.  These discrepancies of 
  47.      course only add to the mystique.  I guess any CP/Mer worth his salt 
  48.      has read the basics, but just where DID CP/M come from?  Where does it 
  49.      fit into the computer world as we enter the 1990s?
  50.  
  51.         Perhaps the largest MAINFRAME computer, and the grand-daddy of them 
  52.      all, was the UNIVAC computer of 1950.  Built entirely of vacuum tubes, 
  53.      it was so big it filled a large room.  And the PDP-8 MINICOMPUTER, 
  54.      costing a mere $50,000, brought computing to corporate business in the 
  55.      mid-60s.  But it was the advent of the microprocessor that made the 
  56.      MICROCOMPUTER a reality.  
  57.  
  58.         In 1969, engineers at Datapoint Corporation of San Antonio, Texas, 
  59.      designed a simple central processing unit and contracted both Intel 
  60.      and Texas Instruments to implement the design on a single piece of 
  61.      silicon.  Intel succeeded, but the product ran ten times slower than 
  62.      had been agreed upon, so Datapoint backed out of the deal.  Intel 
  63.      decided to go ahead and market the device and called it the 8008 
  64.      microcomputer [4].  Little did they know that this humble device 
  65.      signaled the beginning of the microcomputer revolution.  
  66.  
  67.         The 8008 was truly limited, and was used as a controller such as in 
  68.      robot stepper motors and push button TVs.  The 8080, more-or-less its 
  69.      direct descendent, was the first microprocessor with an instruction 
  70.      set powerful enough to do real data processing.  But these were still 
  71.      humble beginnings.  In 1974, a microcomputer kit was sold to hobbyists 
  72.      called the Altos 8000.  It featured switches to enter data, and LEDs 
  73.      as a monitor device.  There was no keyboard, no CRT, and no floppy 
  74.      drives, which meant no stored programs.  All programs had to be 
  75.      tediously entered by hand, byte by byte.  This was indeed the stone 
  76.      age of microcomputing.  They say that necessity is the mother of 
  77.      invention -- thus the birth of an operating system.  CP/M was 
  78.      originally developed by Gary Kildall in 1973 for testing 8" Shugart 
  79.      disk drives.  Later, in 1976, he founded Digital Research, Inc. and 
  80.      released CP/M, targeted at 8080 microcomputer hobbyists [5].  But the 
  81.      8080 was slow, and needed three different voltage levels and several 
  82.      support ICs to operate.  It was soon replaced by the 8085 which 
  83.      required only +5 volts to run.  Then, later came the Z80.  It was not 
  84.      only 8080/8085 software compatible, but included many additional, more 
  85.      powerful instructions.  By 1980, with the Z80, CP/M had truly become 
  86.      the industry standard.  
  87.  
  88.         This is where Big Blue enters the picture.  Microcomputers by this 
  89.      time were starting to find use in the business world.  IBM realized 
  90.      the vast commercial potential and was gearing up for a major 
  91.      onslaught.  They had been associated with quality mainframe computers, 
  92.      and most experts agreed that they would become the leader in the 
  93.      microcomputer field -- in essence, they would decide the future of 
  94.      microcomputing.  IBM chose the 8088 microprocessor by Intel, and with 
  95.      Microsoft, they developed a new operating system called PC-DOS 
  96.      (essentially the same as MS-DOS -- Microsoft's stand alone version).  
  97.      Today, PC doesn't just mean personal computer -- it means IBM 
  98.      compatible.  
  99.  
  100.         For the uninitiated, let's take a look inside these machines and 
  101.      see what all the fuss is about.  The 8088/8086 microprocessor, which 
  102.      is used in the PC-XT and its clones, is vaguely similar to our 8080 
  103.      (the NEC V20 version can run 8080 instructions).  It has an 8-bit data 
  104.      bus but 16-bit internal architecture and is considered a 16-bit 
  105.      microprocessor.  The 8086 is an upgrade with a full 16-bit data bus.  
  106.      The major feature of the 8088/8086 is the ability to address up to 1M 
  107.      of RAM using 'segment address-extension' registers.  This method is 
  108.      similar to CP/M 3.0's method of using multiple banks, only in the 
  109.      8088/8086, this technique is used to the fullest.  Much like the 8080, 
  110.      the 8086 can only use 64K at a time, but it has 10 banks of 64K each.  
  111.      This makes a total of 640K of RAM.  By using other tricks it can 
  112.      access many megabytes of additional memory.
  113.  
  114.         Another member of the 8086 family is the 80286.  It provides 12 Mhz 
  115.      operation, a crude form of multi-tasking (running several SMALL 
  116.      programs at once) and is used in the PC-AT and its clones.  The 80386 
  117.      is another upgrade which provides up to 33 Mhz operation, a full 32-
  118.      bit bus and addressing up to 4 Gigabytes of memory.  And the 80486 is 
  119.      yet the latest upgrade, which provides further streamlining with a 
  120.      built-in cache memory controller and a coprocessor to speed up 
  121.      floating point calculations.  These microprocessors are currently 
  122.      considered the 'leading edge technology' and are the darlings of the 
  123.      micro world [6].  But even now, there is talk of MS-DOS being replaced 
  124.      in the 1990s with UNIX, a true multi-user/multi-tasking operating 
  125.      system.
  126.  
  127.         There is another class of super microprocessors, such as the 
  128.      Motorola 88000.  These new devices use RISC technology (RISC -- 
  129.      'Reduced Instruction Set Computer').  They provide even faster 
  130.      execution by implementing a more efficient set of instructions and 
  131.      executing these within one machine cycle.  Whew!
  132.  
  133.         Okay, so what does this mean for CP/M?  The microcomputer, which 
  134.      started out as an experiment and a boon for hobbyists has now become 
  135.      the workhorse of the corporate business establishment.  The 80286-386-
  136.      486 explosion is being fueled by big business, where money is no 
  137.      object and there is a constant demand for ever more speed and 
  138.      efficiency.  Through CAD (Computer Aided Design), these powerful 
  139.      microcomputers are now being used by scientists and engineers.  By 
  140.      connecting them together with LANs (Local Area Networks), some experts 
  141.      predict microcomputers will be direct competition for the minicomputer 
  142.      market which has already taken a beating in recent times.  But while 
  143.      these advances are impressive, it leaves one piece of the puzzle 
  144.      missing.  What about the consumer?  It is true, most people can afford 
  145.      a simple XT.  What does that mean really?  Today, most GOOD software 
  146.      written for MS-DOS is expensive.  And to enjoy the fruits of the 
  147.      leading edge, you have to constantly upgrade your equipment.  The 
  148.      latest software offerings for PCs aren't designed to run on two 
  149.      floppies -- a hard drive is MANDATORY.  A VGA monitor alone can cost 
  150.      more than an entire monochrome XT package.  Getting caught up in this 
  151.      spiraling staircase of madness is frightening and can lead to gross 
  152.      over-spending and perhaps even what I like to call 'PC-phobia' -- the 
  153.      fear of owning an inferior computer.  In reality, the PC revolution 
  154.      could be thought of as a plush banquet, where Big Business is picking 
  155.      up the tab, and the gamers are picking up the crumbs, hanging on to 
  156.      Sugar Daddy's coat tails.  
  157.  
  158.         The dream among countless, now defunct computer manufacturers in 
  159.      the early 80s of fully automated lifestyles with a computer in every 
  160.      home was just that, a dream, and one that I fear will not soon be 
  161.      realized.  Let's face it, using a computer requires some effort, some 
  162.      learning on the part of the user.  You can't just turn it on like a 
  163.      VCR or a Nintendo.  Even the 'point and click' fad is too strenuous 
  164.      for most of the general public.  I venture to say that there is NO 
  165.      well defined home computer market.  All the non-IBM/clone platforms 
  166.      are beginning to fall away; ie:  Commodore C-series, Atari, even some 
  167.      Apple II-series.  The only true home computer market is really the 
  168.      COMPUTER HOBBYIST, and CP/M is still the ideal operating system for 
  169.      such a phenomenon.
  170.  
  171.         It is conceivable that a CP/M supercomputer could be designed to 
  172.      have many of the bells and whistles of MS-DOS.  The HD64180 is an 
  173.      integrated Z80 microcontroller with several built-in features: 10 Mhz 
  174.      operation, two DMA controllers, two serial ports, and a programmable 
  175.      timer.  But the most notable feature is the ability to address up to 1 
  176.      Meg of memory using a built-in MMU (Memory Management Unit -- similar 
  177.      to the 'segment address-extension registers' in the 8086 family, 
  178.      previously mentioned).  A SCSI bus (Small Computer System Interface) 
  179.      could be used to interface up to eight devices; ie:  hard drives, 
  180.      floppy drives, tape drives, printers, etc.  This system could have 
  181.      high-resolution bit-mapped graphics, and perhaps even some form of 
  182.      multi-tasking (MP/M-II).  The only problem is that CP/M as we know it 
  183.      has no provisions for handling graphics, let alone 1 Meg of memory!  
  184.      Alas, I have found myself fantasizing at times about such a machine.  
  185.      I have personally designed several 68000 microprocessor-driven 
  186.      systems, and it would not be exceptionally difficult to implement the 
  187.      64180.  Of course, outside of a few crazies like myself, such a 
  188.      machine would have no commercial value in light of the current 
  189.      technologies.  It would merely be one CP/Mers dream of power and 
  190.      glory.  (NOTE: anyone out there who has similar ideas of building a 
  191.      CP/M supercomputer or who knows of such a beast, please drop me a line 
  192.      via GEnie mail.)
  193.  
  194.         Anyway, what makes CP/M so special?  Well, to begin with, it was 
  195.      the first successful disk operating system.  Living life as a 
  196.      microcomputerist before CP/M was akin to living without indoor 
  197.      plumbing.  And to think that a boni fide computer system like the 
  198.      UNIVAC, that once filled an entire room, could now sit on a table top, 
  199.      I find astonishing.  And further, the BDOS/BIOS concept is ingenious.  
  200.      The compatablitily of CP/M operated systems allows the user to share 
  201.      the experience with dissimilar hardware platforms -- thus a whole 
  202.      computing community is enriched.  And even more, anyone who lives in 
  203.      the MS-DOS world can feel comfortable with CP/M.  After all, MS-DOS 
  204.      really grew out of CP/M; many of the commands and file handling 
  205.      schemes are similar.  But more than anything else, maybe SIMPLICITY is 
  206.      what makes CP/M so appealing.  As in Art, there is a beauty in 
  207.      simplicity and symmetry, combined with functionality.  And CP/M is 
  208.      just that, a simple, straight-forward solution to operating a personal 
  209.      microcomputer system.
  210.  
  211.         I guess personal computing is different for others.  There's Dan-
  212.      the-man, my snippidy next door neighbor, the one with the super AT 
  213.      with VGA.  I have been to his house to marvel over his computer 
  214.      before, and it IS a remarkable machine.  It would be ridiculous to 
  215.      ignore the fact that this is no doubt a far superior machine to 
  216.      anything in the CP/M world.  The speed is overwhelming, the graphics 
  217.      dazzling.  It is awe inspiring, the shear, unbridled power!  (Excuse 
  218.      me, I get excited about computers -- any flavor.) Dan-the-man is 
  219.      indeed one happy camper, as well he should be.  But I am baffled.  
  220.      What I find unsettling is the way he PERCEIVES personal computing.
  221.  
  222.         Case in point: No sooner did he get this amazing machine, then he 
  223.      was planning to buy another, more powerful one.  Why?  I'm not sure.  
  224.      Is it the 'first on the block' syndrome, or is it that he really needs 
  225.      that kind of computing power?  Dan-the-man plays many computer games 
  226.      and experiments with various software packages.  Now six months later, 
  227.      he's ready for a new machine.  He hasn't even learned how to use THIS 
  228.      one yet.  Speaking of falling in love with one's computer; Dan-the-man 
  229.      not only has no loyalty, he is a technological flirt!  In this 
  230.      relationship, there seems to be something missing.  Hmmm...
  231.  
  232.         Anyone who would care to notice, would be astounded at the 
  233.      longevity of the Commodore 64 computer.  True, this little machine is 
  234.      edging its way to obsolescence, but what a journey it has seen!  
  235.      Nearly eight years after its debut, there is still a large group of 
  236.      devotees.  There are, as a rough guesstimate, about seven or eight 
  237.      million of these machines around the world.  Not all gamers either I 
  238.      remind you; there are multitudes of application programs that have 
  239.      been written for it.  With its handful of ROM-based kernel calls and 
  240.      its graphics capabilities, the C64 is a veritable programmer/hacker's 
  241.      delight.  How many imaginations have been stirred by these 8-bit 
  242.      wonders?  How many computer software careers do you suppose have been 
  243.      launched by these little 'toy' computers?  I have read articles in 
  244.      some trade magazines by professional programmers who STILL enjoy 
  245.      hacking on them.  These people really love the little computer.  In 
  246.      this relationship, there seems a great deal of dedication.  Obviously, 
  247.      personal computing means different things to different people.
  248.  
  249.         Meanwhile, back in my den, whoosh-tic!  Both drives came to a halt.  
  250.      I read the directory of the backed-up floppy.  Everything looked good.  
  251.      I wondered, should I check for bad sectors?  But then again, the 
  252.      format command should have detected any of these.  I yawned.  Now I 
  253.      yearned for sleep.  Inadvertently, I ran scan.com to look for a bad 
  254.      sector, only I entered the A drive by mistake.  I cringed as I 
  255.      realized that my boot disk was now being scanned for bad sectors.  
  256.      This is NOT what I had intended.  So much for working when I was 
  257.      tired.  But behold!  There was a bad sector detected on my boot 
  258.      floppy!  I glared at the message on the monitor with disbelief.  I 
  259.      thought to myself, maybe the A drive was overheating.  That had to be 
  260.      it.  I ran scan.com again with the boot disk in the B drive.  Again -- 
  261.      a bad sector -- the same one.  I decided to fix the problem NOW.  No 
  262.      matter how tired I was, I couldn't go to sleep having my boot disk 
  263.      corrupted.  No way.  That would be sacrilege.  
  264.          
  265.         I pulled out my back-up boot disk (yes, I had a back-up, but that 
  266.      is a different story!).  I pip'd the contents to my RAM drive and then 
  267.      reformatted the corrupted boot disk.  Outside my window, I heard a 
  268.      bird call, close in, near the house.  I looked briefly to the open 
  269.      window, then back to the task at hand.  Once again, I ran scan.com.  
  270.      Good!  No bad sectors.  Patiently, I waited as the RAM disk contents 
  271.      were copied back onto the boot floppy.  
  272.  
  273.         'Booting' -- what an odd term.  In the early 1970s, practically all 
  274.      memories were magnetic core types.  These memories had tiny toroid-
  275.      shaped magnets spaced between a lattice-work of wires.  The direction 
  276.      of the current through one wire determined the logic value, and 
  277.      current through the other determined whether that value was read or 
  278.      written into the magnet-element.  These devices were non-volatile, and 
  279.      held their contents even when the power was removed.  But when this 
  280.      data was corrupted, a small program had to be entered to load the 
  281.      system code.  This was a tedious process in those days -- done either 
  282.      with switches or paper tape input.  The solution?  A small loader 
  283.      program was entered manually which loaded another program which 
  284.      actually loaded the system code.  This small loader program was called 
  285.      a 'bootstrap' loader.  The system was loaded, or pulled up by its own 
  286.      bootstraps.  Hence the term -- 'boot' [7].  
  287.  
  288.         Whoosh-tic!  The A drive came to a stop.  I then rebooted.  It was 
  289.      done.  All was fine in the world.  Again, there was the bird outside 
  290.      my window.  I got up and walked over to have a look.  Again, I heard 
  291.      the cooing.  It came from the bushes near the tree out front.  It was 
  292.      really too dark to see.  Up in the sky, I could see the crescent moon 
  293.      hanging lazily in the heavens, amidst a slight veil of wispy cloud.  I 
  294.      listened and heard silence.  In the dim light, I glanced back at my 
  295.      computer; my reconditioned boot disk.  Yes...  all WAS fine in the 
  296.      world.  I was ready for sleep.
  297.  
  298.         It has been said that perhaps the true delight is not in arriving 
  299.      at the destination, but in the journey itself; to occasionally stop 
  300.      and enjoy the view.  If even just to simply smell the fragrance of 
  301.      flowers, or ponder over a private thought.  I, myself, find the 
  302.      personal computing experience to be just that -- PERSONAL.  It is a 
  303.      quiet time alone, away from the stress and strain of everyday life.  
  304.      And it is during these times that I learn about strength and weakness, 
  305.      success and failure; the value of work; and play for the sake of play; 
  306.      and ways of acceptance.  Perhaps it is in this process of DOING that I 
  307.      find the real reward.  Knowing the joy of getting a five page, hand 
  308.      typed program to finally run.  Learning to accept that slow, noisy 
  309.      drive.  Learning that there is always another corner to turn, another 
  310.      page to read.  Learning that maybe there is wisdom in discovering even 
  311.      just one little, simple thing each day.  If only for this, it has been 
  312.      worth the while.  Oh yes, it could be model cars, or stamp collecting, 
  313.      or flower arranging.  But it is when these things cease to be mere 
  314.      objects and become vehicles, taking us someplace else, to some secret, 
  315.      private place, they bring us closer to the inner self.  By pouring 
  316.      over the tired guts of my old CP/M computer, cursing myself for having 
  317.      misplaced my screw driver AGAIN, perhaps I learn a little more about 
  318.      myself.  
  319.  
  320.                            References / Odds and Ends 
  321.  
  322.      1.  Zen and the Art of Motorcycle Maintenance, Robert M. Pirsig, 
  323.      Bantam.  This book is not about fixing motorcycles, or even CP/M, but 
  324.      I strongly recommend it.  
  325.  
  326.      2.  The Soul of CP/M, The Waite group, Howard Sams.  Out of print, but 
  327.      a real gem for programmers.  I have read excerpts from some old copies 
  328.      of Computers and Electronics magazine, but I don't own a copy myself.  
  329.      I'm still looking but to no avail.  (If anyone knows of an available 
  330.      copy please let me know.)
  331.  
  332.      3.  The CP/M Bible, Waite and Angermeyer, Howard Sams.  Out of print.  
  333.      This book is useful for someone running several versions of CP/M.  It 
  334.      includes a handy cross reference section for 1.X, 2.X, and 3.X 
  335.      systems.  I found a NEW hard-bound copy in a used book shop for $4.  
  336.      Note:  Many CP/M computer books are now out of print but can be found 
  337.      at 'fire-sale' prices in used book stores.  With little money, you can 
  338.      build an impressive CP/M library.  
  339.  
  340.      4.  An Introduction to Microcomputers, Vol. 1 Basic Concepts, Adam 
  341.      Osborne, Osborne/Mcgraw Hill.  A good book for newcomers or anyone who 
  342.      wants to know generally how a microcomputer works.
  343.  
  344.      5.  TC128 Compendium #1, Issue #2, CP/M Update, by Todd Madson.  Any 
  345.      one who uses a C128 should subscribe to Twin Cities 128 magazine.  It 
  346.      deals ONLY with the Commodore 128.  But I must say, I wish there was 
  347.      more CP/M coverage.  
  348.  
  349.      6.  EDN magazine, #24, Nov. 23, 1989.  The Annual uP/uC directory.  
  350.      This magazine is written for professional electronic design engineers 
  351.      and is a good source of info on new technology.
  352.  
  353.      7.  CP/M Assembly Language Programming, Ken Barbier, Prentice Hall.  
  354.      As far as I know, this book is out of print.  However, it is an 
  355.      excellent tutorial on CP/M system programming with the 8080 
  356.      instruction set.
  357.  
  358.                           ----- About the Author -----
  359.  
  360.      Robert Coleman is an electronics engineer for Data General, 
  361.      Telecommunication Products Division.  Besides designing 
  362.      microprocessor-based electronic circuits, and fiddling around with 
  363.      CP/M in his spare time, he enjoys reading, writing and playing bass in 
  364.      a part-time rock 'n' roll band.
  365.