/******************************************************************************/ /* PROBE.C Version 1 Revision 02 2 January 1985 */ /******************************************************************************/ /* */ /* Copyright (c) 1984, 1985 by Paul M. Sittler */ /* */ /* Released for non-commercial use. Commercial use is expressly undesired. */ /******************************************************************************/ PROBE will tell you what version of CP/M or MP/M you are running, display the operating system serial number, and display the I/O byte if appropriate. It then displays the addresses of the CCP, BDOS, and BIOS. The BIOS jump table will next be displayed including the extended BIOS calls for CP/M+, and XIOS calls if running MP/M. It then displays the disk parameter blocks (DPB's), disk parameter headers (DPH's), group size, total disk size, number of directory entries, space required for directory entries, total usable space on the disk, and the disk space allocation vectors for any selected drive (A: through P:). PROBE was written in 'c' to help decode the disk formats of a number of different machines to aid in transportability. It was inspired by BDLOC, TELL, ALLOC, SERNO2, and a number of other public domain CP/M utilities. My method of use of PROBE has been to move it to the target machine and run it after pressing a CTRL-P to get a hard copy print of the target machine's disk parameter blocks. Because of this modus operandi, I have not used any pretty screen stuff. You may wish to be prepared to hit the old control-S as it starts scrolling by. I have used the information gathered this way to write a "Uniform(tm)"-like utility (also in 'c') to change my disk parameter blocks to read/write a whole bunch of floppy formats. This works very nicely on my machine (Heath H-89/90 using the CDR soft-sectored controller), and I have plans to move it to Osborne and Kaypro, as well as certain others. PROBE is NOT a "uniform(tm)"-like utility. It is a tool I developed to develop one for the Heath w/CDR controller. Use it in good health! /******************************************************************************/ /* Files and what they do */ /******************************************************************************/ For PROBE version 102, the files have been broken into a number of smaller files instead of all in one huge thing. PROBE102.SUB Submit file to put it all together. PROBE102.C Contains following functions: main() calls all the other functions. getsysversn() gets the operating system version, figures out what it is, and splits it into version and revision numbers. Writes a text string of either MP/M or CP/M, depending on which it found. shosysversn() prints the operating system version. showiobyte() gets the I/O byte and displays it so that even my brother can understand it. He said "I never saw it explained that way before!" Well, neither had I, before. . . tell() displays all those addresses of jumps and things, for CP/M, CP/M+, MP/M, like BDOSLOC and TELL used to, only more of them. ASCTOBIN.C asciitobin() takes a byte and returns a null-terminated string of 0's and ones, grouped in two groups of four, with a space between groups. For example, 'E5' will return "1110 0101\0". PROBSDPB.C showdpb() prompts for drive, resets disk system, and decodes and displays the disk parameter block (dpb), the disk parameter header (dph), shows allocation block size, disk size, number of directory entries, total useful disk capacity, etc. Then it displays the disk space allocation vector as a series of 0's and 1's in a nice table. PROBSERN.C get_ser_num() gets the CP/M serial number and prints it. PROBSIGN.C signon() is the why and whodunnit thing that prints all the garbage on the screen at first. Also answers the wadduzzit do question (sorta). BDOSDEF.H Sometimes useful BDOS definitions that are used in some of the files. CBIOSDEF.H Sometimes useful CBIOS definitions that are used in some of the files. /******************************************************************************/ /* Style notes. . . (or soapbox time) */ /******************************************************************************/ I tend to 'overdocument' the code in an attempt to make the code readable for others (and for myself 6 months later). This is probably due to my mother having been frightened by an assembler when she was pregnant. My variable and function names are huge but hopefully descriptive. I had the experience a few years ago of needing to make "a few small changes" on old fortran-iv code that I had myself written only a few months before. You remember, variable names like A1, AA, A2, and no comment cards allowed. . . I personally feel that no-one should EVER be allowed to teach programming courses until they have spent at least two years doing maintenance programming. I am also VERY tired of hearing people say that "c is a terse and obtuse language." So is COBOL, if properly written. . . I hope that the source may be useful as a tutorial on both techniques of 'c' programming and system-level programming in the CP/M operating system. My placement of the curly braces is pragmatic; it is easier for me to see them in that rather baroque placement, and it enables me to draw squiggly lines with a pencil in a bizarre game of connect the braces that I sometimes play. . . Sometimes that's how I function. . . If the whitespace and comments get in the way, just use "HACK" and remove all comments, whitespace, line feeds, returns. Then, globally search and replace with your favorite editor and shorten all variable names and function names to two characters or less. It will save a lot on disk space, fer shure!! /******************************************************************************/ /* Who was that masked man anyway? */ /******************************************************************************/ Scapegoat for this drivel is: Paul Sittler - My Word!! RCP/M (409) 845-0510 (late nights) Veterinary Public Health RCP/M (409) 845-0509 (24 hours) Dept of Veterinary Public Health, Texas A&M University College Station, Texas 77840-4468