home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol1 / bootexpcon / manunum < prev    next >
Text File  |  1990-01-26  |  9KB  |  222 lines

  1. (c)  Copyright 1989 Commodore-Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice, and 
  3. is provided "as is" without warranty of any kind, either expressed or implied.  
  4. The entire risk as to the use of this information is assumed by the user.
  5.  
  6.  
  7.  
  8.                      Your Manufacturer Number    
  9.  
  10.                           by Dan Baker
  11.  
  12.  
  13.      Attention hardware manufacturers.  If you are developing a hardware
  14. expansion product for the Amiga then you will need to obtain a special
  15. manufacturer i.d. number from CATS to identify your product.  This
  16. manufacturer number is used by the Amiga to link your hardware with its
  17. driver software at boot time.
  18.  
  19.      Your manufacturer number is part of the special protocol that the Amiga
  20. uses to automatically configure all expansion devices on the bus without the
  21. user having to cut jumpers or adjust dip switches.  This is called
  22. auto-config.
  23.  
  24.      At start-up time, the system first polls each board in the system and
  25. assigns the board its own address space.  If it is a memory board, its RAM
  26. is linked into the memory free pool.  Later in the boot sequence, after DOS
  27. is initialized, the binddrivers program is run.  Binddrivers will search the
  28. directory SYS:Expansion for the drivers that go with the boards.
  29.  
  30.      To do this binddrivers looks in the Tool Type field of all icon files
  31. in SYS:Expansion.  If the first seven bytes of the Tool Type field are
  32. "PRODUCT", then this is an icon file for a driver.
  33.  
  34.      Binddrivers will then attempt to match the drivers it has found with
  35. the boards that were found earlier.  This is where your manufacturer number
  36. comes in.
  37.  
  38.      Your manufacturer number goes in two places.  First, it is burned in
  39. hex form into the PAL which is part of ALL auto-config expansion products.
  40. Second, it appears in ASCII in the Tool Type field of the icon file for
  41. your product's driver.  By matching these two numbers, the Amiga can
  42. automatically configure your board and bind it's software driver into the
  43. system as well.
  44.  
  45.      The manufacturer's number is a 16-bit i.d. which appears in PAL offsets
  46. $10-$17.  There is also an 8-bit product number which you assign.  The
  47. product number is for uniquely identifying different products from the same
  48. vendor.  The product number will appear in PAL offsets $04-$07.  This gives
  49. you a total of 24 bits to identify each of your products.
  50.  
  51.      These 24 bits of information in the PAL which identify your product are
  52. matched against the information in the Tool Type field of all icon files in
  53. the SYS:Expansion drawer.  For example, suppose you are manufacturer #1019.
  54. You have two products, #1 and #2 which both use the same driver.  The icon
  55. for your driver for these two products would have a Tool Type set to
  56. "PRODUCT=1019/1|1019/2".  This means: I am an icon for a driver that works
  57. with product number 1 or 2 from manufacturer 1019, now bind me.  Spaces are
  58. not legal.  Here are two other examples:
  59.  
  60.         PRODUCT=1208/11    is the Tool Type for a driver for product
  61.                            11 from manufacturer number 1208.
  62.  
  63.         PRODUCT=1017       is the Tool Type for a driver for any
  64.                            product from manufacturer number 1017.
  65.  
  66.  
  67.      For an informal explanation of the auto-configuration process, see the
  68. chapter on Software Expansion Architecture from the 2nd Annual Amiga
  69. Developer's Conference Notes (available from CATS, $20).  For the details
  70. of timing, power, the PAL equations and PAL address specifications and the
  71. expansion library documentation, see sections 3.1 to 3.3 of the A500/A2000
  72. Technical Reference Manual ($40).  The original auto-config spec appears in
  73. the A1000 Schematics and Expansion Specification ($20).  All three of these
  74. manuals are available from CATS at the address listed below.
  75.  
  76.      Manufacturer's numbers are assigned by CATS.  Your manufacturer number
  77. is NOT the same as your developer number.  To obtain your unique
  78. manufacturer number contact:
  79.  
  80.                  CATS, Commodore-Amiga Technical Support
  81.                  1200 Wilson Dr.
  82.                  West Chester, PA
  83.                  19380
  84.                  215-431-9300
  85.  
  86.      Be sure and include your name, address, phone number and the type of
  87. expansion product you are developing.  For those doing prototype boards,
  88. we have a temporary hacker's number set aside.
  89.  
  90.      The auto-config process makes the addition of expansion products to the
  91. system very easy.  All the user has to do is put the board in any slot and
  92. copy the driver from the release disk to his own SYS:Expansion drawer.
  93. Everything else is automatic.  There are no jumpers or dip switches to set.
  94. Best of all, you will get a lot less support calls asking how to make your
  95. product work with the XYZ-Corp-battery-backed-clock.
  96.  
  97.  
  98. ------------------------Code Starts Here---------------------------
  99.      
  100. /*-----------------------------------------------*/
  101. /* Here is a short program which will tell you   */
  102. /* about the expansion boards configured in your */
  103. /* system without you opening up the machine.    */
  104. /* Code by Bill Koester of CATS                  */
  105. /*-----------------------------------------------*/
  106. #include <libraries/configvars.h>
  107. #include <libraries/expansion.h>
  108.  
  109. struct ExpansionBase *ExpansionBase;
  110.  
  111. void main();
  112. void cleanup();
  113. void printdev();
  114.  
  115. void main()
  116. {
  117.    struct ConfigDev *MyConfigDev;
  118.  
  119.    /*----------------------------------*/
  120.    /* Open the expansion library,      */
  121.    /* if there is a problem then exit  */
  122.    /*----------------------------------*/
  123.  
  124.    ExpansionBase =(struct ExpansionBase *) OpenLibrary(EXPANSIONNAME,0);
  125.    if(ExpansionBase==NULL)
  126.    {
  127.       printf("Error opening expansion library!!\n");
  128.       cleanup();
  129.       exit(0);
  130.    }
  131.  
  132.    /*--------------------------------------------*/
  133.    /* Use FindConfigDev to get info on the first */
  134.    /* expansion board on the list maintained by  */
  135.    /* Exec.  If there are no expansion boards in */
  136.    /* the system then exit.                      */
  137.    /*--------------------------------------------*/
  138.  
  139.    MyConfigDev = NULL;
  140.  
  141.   /*--------------------------------------------------*/
  142.   /* FindConfigDev(oldConfigDev,manufacturer,product) */
  143.   /* oldConfigDev = NULL for the top of the list      */
  144.   /* manufacturer = -1 for any manufacturer           */
  145.   /* product      = -1 for any product                */
  146.   /*--------------------------------------------------*/
  147.  
  148.    MyConfigDev = FindConfigDev(NULL,-1,-1);
  149.  
  150.    if(MyConfigDev==NULL)
  151.    {
  152.       printf("No Configured Devices found!!\n");
  153.       cleanup();
  154.       exit(0);
  155.    }
  156.  
  157.    printdev(MyConfigDev);
  158.  
  159.    /*-----------------------------------*/
  160.    /* OK, there is at least one board,  */
  161.    /* so loop and get the entire list   */
  162.    /* printing as we go with printdev() */
  163.    /*-----------------------------------*/
  164.  
  165.    while(MyConfigDev = FindConfigDev(MyConfigDev,-1,-1))
  166.    {
  167.       printdev(MyConfigDev);
  168.    }
  169.    cleanup();
  170. }
  171.  
  172.  
  173. /*-------------------*/
  174. /* Close up shop...  */
  175. /*-------------------*/
  176. void cleanup()
  177. {
  178.    if(ExpansionBase)
  179.       CloseLibrary(ExpansionBase);
  180. }
  181.  
  182. /*----------------------------------*/
  183. /* Print out the contents of the    */
  184. /* dev structure for this expansion */
  185. /* product.                         */
  186. /*----------------------------------*/
  187.  
  188. void printdev(dev)
  189. struct ConfigDev *dev;
  190. {
  191.    char buff[200];
  192.  
  193.    printf("Flags          = ");
  194.    if(dev->cd_Flags==NULL)
  195.       printf("NULL  ");
  196.    if(dev->cd_Flags&CDF_SHUTUP)
  197.       printf("CDF_SHUTUP  ");
  198.    if(dev->cd_Flags&CDF_CONFIGME)
  199.       printf("CDF_CONFIGME  ");
  200.    printf("\n");
  201.    printf("Board Address  = %x\n",dev->cd_BoardAddr);
  202.    printf("Board Size     = %d bytes\n",dev->cd_BoardSize);
  203.    printf("Slot  Address  = %d\n",dev->cd_SlotAddr);
  204.    printf("Slot  Size     = %d\n",dev->cd_SlotSize);
  205.    printf("Driver code at   %x\n",dev->cd_Driver);
  206.  
  207.    printf("er_Type         = %x\n",dev->cd_Rom.er_Type);
  208.    printf("er_Product      = %x\n",dev->cd_Rom.er_Product);
  209.    printf("er_Flags        = %x\n",dev->cd_Rom.er_Flags);
  210.    printf("er_Reserved03   = %x\n",dev->cd_Rom.er_Reserved03);
  211.    printf("er_Manufacturer = %x\n",dev->cd_Rom.er_Manufacturer);
  212.    printf("er_SerialNumber = %x\n",dev->cd_Rom.er_SerialNumber);
  213.    printf("er_InitDiagVec  = %x\n",dev->cd_Rom.er_InitDiagVec);
  214.    printf("er_Reserved0c   = %x\n",dev->cd_Rom.er_Reserved0c);
  215.    printf("er_Reserved0d   = %x\n",dev->cd_Rom.er_Reserved0d);
  216.    printf("er_Reserved0e   = %x\n",dev->cd_Rom.er_Reserved0e);
  217.    printf("er_Reserved0f   = %x\n",dev->cd_Rom.er_Reserved0f);
  218.  
  219.    printf("Hit Return to continue:\n");
  220.    gets(buff);
  221. }
  222.