home *** CD-ROM | disk | FTP | other *** search
/ World of A1200 / World_Of_A1200.iso / programs / monitors / rsys / source.lha / src / RSysSummaryLists.c < prev    next >
C/C++ Source or Header  |  1995-01-09  |  20KB  |  659 lines

  1. /*
  2. ***************************************************************************
  3. *
  4. * Datei:
  5. *    RSysSummaryLists.c
  6. *
  7. * Inhalt:
  8. *    void MakeHardwareList(void);
  9. *    void MakeMemoryList(void);
  10. *    void MakeSystemList(void);
  11. *
  12. * Bemerkungen:
  13. *    Listen für Hardwarekonfiguration, Speicherlisten und Systemliste.
  14. *
  15. * Erstellungsdatum:
  16. *    25-Jun-93    Rolf Böhme
  17. *
  18. * Änderungen:
  19. *    25-Jun-93    Rolf Böhme    Erstellung
  20. *
  21. ***************************************************************************
  22. */
  23.  
  24. #include "RSysDebug.h"
  25. #include "RSysFunc.h"
  26.  
  27. #define MEMTYPELEN 15
  28.  
  29. static struct _hardwareentry
  30. {
  31.    char  title[TITLELEN];
  32.    char  info[MAXSTRLEN];
  33.    struct _hardwareentry *next;
  34. }     firsthardwareentry =
  35.  
  36. {
  37.    "", "", NULL
  38. };
  39.  
  40. static struct Remember *Key = NULL;
  41.  
  42.    /*
  43.     * allochardwareentry() erzeugt einen Eintrag für die
  44.     * Hardwareliste
  45.     */
  46. static struct _hardwareentry *
  47. allochardwareentry(struct _hardwareentry *prev, char *title, char *info)
  48. {
  49.    struct _hardwareentry *new;
  50.  
  51.    if (new = (struct _hardwareentry *) AllocRemember((struct Remember **) & Key,
  52.                                                      sizeof(struct _hardwareentry),
  53.                                                      MEMF_CLEAR))
  54.    {
  55.       if (title)
  56.          strncpy(new->title, title, TITLELEN);
  57.       else
  58.          strcpy(new->title, field[BLANK_FIELD]);
  59.  
  60.       if (info)
  61.          strncpy(new->info, info, MAXSTRLEN);
  62.       else
  63.          new->info[0] = STRINGEND;
  64.  
  65.       prev->next = new;
  66.  
  67.       new->next = NULL;
  68.    }
  69.    else
  70.       ErrorHandle(MEMORY_ERR, ALLOC_FAIL, KILL);
  71.  
  72.    return (new);
  73. }
  74.  
  75.    /*
  76.     * allochardwareentry() erzeugt einen Eintrag für die
  77.     * Hardwareliste
  78.     */
  79. static struct _hardwareentry *
  80. allocentry(struct _hardwareentry *prev, char *title, char *info)
  81. {
  82.    struct _hardwareentry *new;
  83.  
  84.    if (new = (struct _hardwareentry *) AllocRemember((struct Remember **) & Key,
  85.                                                      sizeof(struct _hardwareentry),
  86.                                                      MEMF_CLEAR))
  87.    {
  88.       strncpy(new->title, title, TITLELEN);
  89.  
  90.       if (info)
  91.          strncpy(new->info, info, MAXSTRLEN);
  92.       else
  93.          strcpy(new->info, "-");
  94.  
  95.       prev->next = new;
  96.  
  97.       new->next = NULL;
  98.    }
  99.    else
  100.       ErrorHandle(MEMORY_ERR, ALLOC_FAIL, KILL);
  101.  
  102.    return (new);
  103. }
  104.  
  105.    /*
  106.     * allocnumhardwareentry() erzeugt einen Zahleneintrag für die
  107.     * Hardwareliste
  108.     */
  109. static struct _hardwareentry *
  110. allocnumhardwareentry(struct _hardwareentry *prev, char *title,
  111.                       unsigned long num, int hex)
  112. {
  113.    struct _hardwareentry *new;
  114.  
  115.    if (new = (struct _hardwareentry *)AllocRemember((struct Remember **) & Key,
  116.                                                     sizeof(struct _hardwareentry),
  117.                                                     MEMF_CLEAR))
  118.    {
  119.       strncpy(new->title, title, TITLELEN);
  120.  
  121.       if (hex)
  122.          sprintf(new->info, "0x%08lx", num);
  123.       else
  124.          sprintf(new->info, "%lD", num);
  125.  
  126.       prev->next = new;
  127.  
  128.       new->next = NULL;
  129.    }
  130.    else
  131.       ErrorHandle(MEMORY_ERR, ALLOC_FAIL, KILL);
  132.  
  133.    return (new);
  134. }
  135.  
  136. static char *company_str[] =
  137. {
  138.    /* 0 */ "Stormbringer",
  139.    /* 1 */ "C= Braunschweig",
  140.    /* 2 */ "C= West Chester",
  141.    /* 3 */ "Unknown",
  142.    /* 4 */ "MicroBotics",
  143.    /* 5 */ "ASDG",
  144.    /* 6 */ "Ameristar",
  145.    /* 7 */ "Supra",
  146.    /* 8 */ "IVS TrumpCard",
  147.    /* 9 */ "Kronos",
  148.    /* 10 */ "Roßmöller",
  149.    /* 11 */ "Golem (earlier Kupke)",
  150.    /* 12 */ "Nexus Adv. Storage Systems",
  151.    /* 13 */ "IVS TrumpCard",
  152.    /* 14 */ "Hydra",
  153.    /* 15 */ "DMI Resolver",
  154.    /* 16 */ "Vortex",
  155.    /* 17 */ "ReadySoft",
  156.    /* 18 */ "MacroSystems",
  157.    /* 19 */ "Combitec",
  158.    /* 20 */ "ReisWare",
  159.    /* 21 */ "Great Valley Products (GVP)",
  160.    /* 22 */ "XPert Germany"
  161. };
  162.  
  163. #define NONE (UWORD)(-1)
  164.  
  165. static struct Manufacturer
  166. {
  167.    UWORD manu_nr;
  168.    UWORD prod_nr;
  169.    UWORD type_nr;
  170.    char name[BUFSIZE];
  171.    int  company;
  172. }     manu[]=
  173. {
  174.    /*  0 */ { 256, NONE, 0,      "MC68030 Board",             0 },
  175.    /*  1 */ { 513, 1,   196,     "A2088",                     1 },
  176.    /*  2 */ { 513, 1,   196,     "A2286",                     1 },
  177.    /*  3 */ { 514, 81, NONE,     "A2630 MC68030 (2MB Stand.)",2 },
  178.    /*  4 */ { 514, 10, 230,      "A2091/A590 or A2052/A2058", 2 },
  179.    /*  5 */ { 514, 1, 209,       "2090A",                     2 },
  180.    /*  6 */ { 514, 3, 209,       "A2091",                     2 },
  181.    /*  7 */ { 514, 2, 209,       "A590",                      2 },
  182.    /*  8 */ { 514, 10, 230,      "A2052",                     2 },
  183.    /*  9 */ { 514, 70, NONE,     "A2232 Mult. Ser. Board",    2 },
  184.    /* 10 */ { 514, 112, NONE,    "A2065 Ethernet Comm. Board",2 },
  185.    /* 11 */ { 514, 146, NONE,    "Unknown",                   2 },
  186.    /* 12 */ { 514, NONE, 103,    "A2386SX",                   2 },
  187.    /* 13 */ { 1005, 1, 193,      "a^2 Live!",                 3 },
  188.    /* 14 */ { 1010, 3, 230,      "MicroBotic 8up!",           4 },
  189.    /* 15 */ { 1023, NONE, NONE,  "Unknown",                   5 },
  190.    /* 16 */ { 1053, NONE, NONE,  "Unknown",                   6 },
  191.    /* 17 */ { 1056, 12, 209,     "Wordsync",                  7 },
  192.    /* 18 */ { 1056, 10, NONE,    "RAM 2000 Memory Board",     7 },
  193.    /* 19 */ { 1056, 11, 193,     "2400zi (internal Modem)",   7 },
  194.    /* 20 */ { 1056, NONE, 9,     "500RX",                     7 },
  195.    /* 21 */ { 1761, 8, 230,      "GVP (2MB on board)",        21 },
  196.    /* 22 */ { 2012, 48, NONE,    "Classic HD Controller",     8 },
  197.    /* 23 */ { 2017, 9, 231,      "32 BIT Ram",                21 },
  198.    /* 24 */ { 2017, 8, 209,      "A3001",                     21 },
  199.    /* 25 */ { 2017, 3, 210,      "Impact Hard Card",          21 },
  200.    /* 26 */ { 2017, 2, 209,      "Hard Card / 2 MB",          21 },
  201.    /* 27 */ { 2017, 2, 210,      "Impact / 8MB",              21 },
  202.    /* 28 */ { 2017, NONE, 13,    "A3001 REV.  7",             21 },
  203.    /* 29 */ { 2050, 4, 209,      "Cltd.  Kronos SCSI",        9 },
  204.    /* 30 */ { 2052, 1, 230,      "Roßmöller 2/8MB",           10 },
  205.    /* 31 */ { 2071, 1, 209,      "ICD Advantage SCSI",        21 },
  206.    /* 32 */ { 2071, NONE, 2,     "ICD AD IDE",                21 },
  207.    /* 33 */ { 2073, 2, 193,      "Kupke SCSI-II SCSI",        11 },
  208.    /* 34 */ { 2102, 1, NONE,     "SCSI Controller",           12 },
  209.    /* 35 */ { 2112, 48, NONE,    "Classic HD Controller",     8 },
  210.    /* 36 */ { 2121, 1, 193,      "Hydra Ethernet",            14 },
  211.    /* 37 */ { 2129, 1, NONE,     "Graphics Board (T34010)",   15 },
  212.    /* 38 */ { 2162,1,NONE,       "Domino Graphic Card",       22 },
  213.    /* 39 */ { 8215, 3, 217,      "Athlet AT-Bus (IDE)",       16 },
  214.    /* 40 */ { 8448, NONE, 1,     "A-MAX-IIPlus Card",         17 },
  215.    /* 41 */ { 18260, 6, 1,       "Retina Graphics Card",      18 },
  216.    /* 42 */ { 26230, 131, 230,   "MacroSystems MegaRAM",      18 },
  217.    /* 43 */ { 26470, 130, 230,   "Combitec RAM",              19 },
  218.    /* 44 */ { 43537, NONE, 17,   "ReisWare Scanner Interface",20 },
  219.    /* 45 */ { NONE, NONE, NONE,  "Unknown",                   3  }
  220. };
  221.  
  222. #define CNT_DEVELOPER (sizeof(manu)/sizeof(struct Manufacturer))
  223.  
  224.    /*
  225.     * extract_comp() ermittelt einen Company-Namen und einen
  226.     * Produktnamen aus dem Manufacturer-Eintrag in der
  227.     * ExpansionBase
  228.     */
  229. static void
  230. extract_comp(UWORD manufactnr,UWORD prodnr,char *name,char *company)
  231. {
  232.    register int i,j;
  233.  
  234.    strncpy(company,company_str[3],BUFSIZE);
  235.    strncpy(name,company_str[3],BUFSIZE);
  236.  
  237.    for (i = 0; i < CNT_DEVELOPER - 1; i++)
  238.       if (manu[i].manu_nr == manufactnr)
  239.       {
  240.          strncpy(company,company_str[ manu[i].company ],BUFSIZE);
  241.  
  242.          j = i;
  243.          while((manu[j].prod_nr != prodnr) && (manu[j].manu_nr == manufactnr))
  244.             j++;
  245.  
  246.          if((manu[j].prod_nr == prodnr) && (manu[j].manu_nr == manufactnr))
  247.             strncpy(name,manu[j].name,BUFSIZE);
  248.  
  249.          break;
  250.       }
  251.  
  252.    return;
  253. }
  254.  
  255. extern ULONG GetCPUType(void),GetFPUType(void),GetMMUType(void);
  256.  
  257.    /*
  258.     * CheckProcessors() prüft den Type der CPU, MMU und der FPU
  259.     * mit ein paar kleinen Assemblerroutinen, die ich aus dem
  260.     * Quelltext des Programmes SetCPU von D. Haynie geratzt habe
  261.     */
  262. static void
  263. CheckProcessors(char *cpu,char *fpu,char *mmu)
  264. {
  265.    ULONG _cpu = GetCPUType(),_fpu = GetFPUType(),_mmu = GetMMUType();
  266.  
  267.    sprintf(cpu,"CPU %ld",_cpu);
  268.  
  269.    if(_fpu != 0L)
  270.       sprintf(fpu,"FPU %ld",_fpu);
  271.    else
  272.       strcpy(fpu,"None");
  273.  
  274.    if(_mmu != 0L)
  275.       sprintf(mmu,"MMU %ld",_mmu);
  276.    else
  277.       strcpy(mmu,"None");
  278.  
  279.    return;
  280. }
  281.  
  282.    /*
  283.     * MakeHardwareList() erzeugt eine Anzeigeliste mit den
  284.     * Daten der Hardware-Ausstattung des Rechners, auf dem RSys
  285.     * läuft
  286.     */
  287. void
  288. MakeHardwareList(void)
  289. {
  290.    struct _hardwareentry *loop;
  291.    int   count = 0,
  292.          i;
  293.    UWORD type = SysBase->AttnFlags;
  294.    char  out[BUFSIZE],comp[BUFSIZE],name[BUFSIZE],
  295.         *titles[]=
  296.    {
  297.       /* 0 */ "Processor",
  298.       /* 1 */ "Coprocessor",
  299.       /* 2 */ "Memory Unit",
  300.       /* 3 */ "Denise",
  301.       /* 4 */ "Agnus",
  302.       /* 5 */ "Type",
  303.       /* 6 */ "Company",
  304.       /* 7 */ "Name",
  305.       /* 8 */ "Init Action",
  306.       /* 9 */ "Driver",
  307.       /* 10 */ "Priority",
  308.       /* 11 */ "Diagnosis",
  309.       /* 12 */ "Manuf.nr.",
  310.       /* 13 */ "Prod.nr.",
  311.       /* 14 */ "Serial",
  312.       /* 15 */ "Boardaddr.",
  313.       /* 16 */ "Boardsize",
  314.       /* 17 */ "Slotaddr.",
  315.       /* 18 */ "Slotsize",
  316.       /* 19 */ "           >",
  317.       /* 20 */ "Alice",
  318.       /* 21 */ "Lisa",
  319.       /* 22 */ "MLisa",
  320.       /* 23 */ "Chipset"
  321.    },cpu[3][10];
  322.    struct ConfigDev *lastboard = NULL;
  323.    struct ExpansionRom *expansionrom;
  324.    struct Node *devnode /*, *node */;
  325. /*   struct BootNode *bootnode; */
  326.  
  327.    DPOS;
  328.  
  329.    loop = allochardwareentry(&firsthardwareentry, "----- Hardware", NULL);
  330.  
  331.    CheckProcessors(cpu[0],cpu[1],cpu[2]);
  332.  
  333.    for(i = 0; i < 3; i++)
  334.       loop = allochardwareentry(loop, titles[i], cpu[i]);
  335.  
  336.    if(GfxBase->ChipRevBits0 & GFXF_HR_DENISE)
  337.       loop = allochardwareentry(loop, titles[3], "ECS-Denise (8373)");
  338.    else
  339.       loop = allochardwareentry(loop, titles[3], "Normal Denise (8362)");
  340.  
  341.    if(GfxBase->ChipRevBits0 & GFXF_HR_AGNUS)
  342.       loop = allochardwareentry(loop, titles[4], "ECS-Agnus (8372)");
  343.    else
  344.       loop = allochardwareentry(loop, titles[4], "Normal Agnus");
  345.  
  346.    count += 6;
  347.  
  348. #define GFXF_AA_ALICE   4
  349. #define GFXF_AA_LISA       8
  350. #define GFXF_AA_MLISA   16    /* internal use only */
  351.  
  352.    if(GfxBase->ChipRevBits0 & (GFXF_AA_ALICE | GFXF_AA_LISA | GFXF_AA_MLISA))
  353.    {
  354.       if(GfxBase->ChipRevBits0 & GFXF_AA_ALICE)
  355.          loop = allochardwareentry(loop, titles[20], "AA-Alice");
  356.       else
  357.          loop = allochardwareentry(loop, titles[20], "Non AA-Alice");
  358.  
  359.       if(GfxBase->ChipRevBits0 & GFXF_AA_LISA)
  360.          loop = allochardwareentry(loop, titles[21], "AA-Lisa");
  361.       else
  362.          loop = allochardwareentry(loop, titles[21], "Non AA-Lisa");
  363.  
  364.       if(GfxBase->ChipRevBits0 & GFXF_AA_MLISA)
  365.          loop = allochardwareentry(loop, titles[22], "AA-MLisa");
  366.       else
  367.          loop = allochardwareentry(loop, titles[22], "Non AA-MLisa");
  368.  
  369.       count += 3;
  370.    }
  371.    else
  372.    {
  373.       loop = allochardwareentry(loop, titles[23], "No AA-Chipset");
  374.       count++;
  375.    }
  376.  
  377.    loop = allochardwareentry(loop, (char *)field[BLANK_FIELD], NULL);
  378.    loop = allochardwareentry(loop, "----- Expansion", NULL);
  379.  
  380.    count += 2;
  381.  
  382.    if (ExpansionBase = (struct ExpansionBase *)
  383.        OpenLibrary((UBYTE *) "expansion.library", NULL))
  384.    {
  385.       int cnt = 0;
  386.  
  387.       while (lastboard = FindConfigDev(lastboard, -1L, -1L))
  388.       {
  389.          expansionrom = &(lastboard->cd_Rom);
  390.          if (expansionrom->er_Type & ERTF_MEMLIST)
  391.             loop = allochardwareentry(loop, titles[5], "RAM Expansion");
  392.          else
  393.             loop = allochardwareentry(loop, titles[5], "Other Expansion");
  394.  
  395.          extract_comp(expansionrom->er_Manufacturer,
  396.                       expansionrom->er_Product,
  397.                       name,comp);
  398.          loop = allochardwareentry(loop, titles[6], comp);
  399.          loop = allochardwareentry(loop, titles[7], name);
  400.  
  401.          count += 3;
  402.  
  403.          if (lastboard->cd_Flags & CDF_SHUTUP)
  404.          {
  405.             loop = allochardwareentry(loop, titles[8], "No active");
  406.             count++;
  407.          }
  408.  
  409.          if (lastboard->cd_Flags & CDF_CONFIGME)
  410.          {
  411.             loop = allochardwareentry(loop, titles[8], "Need Driver");
  412.             count++;
  413.          }
  414.  
  415.          if (lastboard->cd_Flags & CDF_BADMEMORY)
  416.          {
  417.             loop = allochardwareentry(loop,titles[19], "Contains bad memory");
  418.             count++;
  419.          }
  420.  
  421.          if (lastboard->cd_Flags & CDF_PROCESSED)
  422.          {
  423.             loop = allochardwareentry(loop, titles[19], "Private processed");
  424.             count++;
  425.          }
  426.  
  427.          if (devnode = (struct Node *) lastboard->cd_Driver)
  428.          {
  429.             loop = allochardwareentry(loop, titles[9], devnode->ln_Name);
  430.             loop = allocnumhardwareentry(loop, titles[10],
  431.                                          (unsigned long)devnode->ln_Pri,
  432.                                          FALSE);
  433.             count += 2;
  434.          }
  435.  
  436.          if (expansionrom->er_Flags & ERTF_DIAGVALID)
  437.             loop = allochardwareentry(loop, titles[11], "Action attached");
  438.          else
  439.             loop = allochardwareentry(loop, titles[11], "No action attached");
  440.  
  441.          loop = allocnumhardwareentry(loop, titles[12],
  442.                            (unsigned long)expansionrom->er_Manufacturer, FALSE);
  443.          loop = allocnumhardwareentry(loop, titles[13],
  444.                            (unsigned long)expansionrom->er_Product, FALSE);
  445.          loop = allocnumhardwareentry(loop, titles[14],
  446.                            (unsigned long)expansionrom->er_SerialNumber,TRUE);
  447.          loop = allocnumhardwareentry(loop, titles[15],
  448.                            (unsigned long)lastboard->cd_BoardAddr, TRUE);
  449.          loop = allocnumhardwareentry(loop, titles[16],
  450.                            (unsigned long)lastboard->cd_BoardSize, FALSE);
  451.          loop = allocnumhardwareentry(loop, titles[17],
  452.                            (unsigned long)lastboard->cd_SlotAddr, TRUE);
  453.          loop = allocnumhardwareentry(loop, titles[18],
  454.                            (unsigned long)lastboard->cd_SlotSize, FALSE);
  455.  
  456.          loop = allochardwareentry(loop, (char *)field[BLANK_FIELD], NULL);
  457.  
  458.          count += 9;
  459.  
  460.          cnt++;
  461.       }
  462.  
  463.       sprintf(out,"%ld expansions found",cnt);
  464.       loop = allochardwareentry(loop, "Summary", out);
  465.       count++;
  466. /* -------------------------------------------------------------------------
  467.       loop = allochardwareentry(loop, (char *)field[BLANK_FIELD], NULL);
  468.       count++;
  469.       loop = allochardwareentry(loop, "----- Boot nodes", NULL);
  470.       count++;
  471.  
  472.       Forbid();
  473.  
  474.       for(node = ExpansionBase->MountList.lh_Head; node->ln_Succ; node = node->ln_Succ)
  475.       {
  476.          bootnode = (struct BootNode *)node;
  477.  
  478.          loop = allocentry(loop, "Name", bootnode->bn_Node.ln_Name);
  479.  
  480.          loop = allocnumhardwareentry(loop, "Priority", (ULONG)bootnode->bn_Node.ln_Pri, FALSE);
  481.          loop = allocnumhardwareentry(loop, "Flags", (ULONG)bootnode->bn_Flags,TRUE);
  482.          loop = allocnumhardwareentry(loop, "Device node", (ULONG)bootnode->bn_DeviceNode,TRUE);
  483.          loop = allochardwareentry(loop, (char *)field[BLANK_FIELD], NULL);
  484.  
  485.          count += 5;
  486.       }
  487.  
  488.       Permit();
  489.  
  490.       cnt = CountNodes(&ExpansionBase->MountList);
  491.  
  492.       sprintf(out,"%ld Boot nodes found",cnt);
  493.       loop = allochardwareentry(loop, "Summary", out);
  494.       count++;
  495.  -------------------------------------------------------------------------*/
  496.  
  497.       CloseLibrary((struct Library *) ExpansionBase);
  498.    }
  499.    else
  500.       ErrorHandle(LIBRARY_ERR, OPEN_FAIL, NO_KILL);
  501.  
  502.    countentries = count;
  503.  
  504.    Entries = AllocScrollEntries(countentries);
  505.  
  506.    loop = firsthardwareentry.next;
  507.    i = 0;
  508.  
  509.    while (loop && (i < countentries))
  510.    {
  511.       if (loop->info[0])
  512.          sprintf(Entries[i].se_Entry, "%-13s : %s", loop->title, loop->info);
  513.       else
  514.          strncpy(Entries[i].se_Entry, loop->title, BUFSIZE);
  515.  
  516.       i++;
  517.  
  518.       loop = loop->next;
  519.    }
  520.  
  521.    FreeRemember((struct Remember **) & Key, TRUE);
  522.  
  523.    CreateEntryList(NO_SORT);
  524.  
  525.    PrintInfo("Hardwarelist read", SPEAK, 0);
  526.  
  527.    return;
  528. }
  529.  
  530.    /*
  531.     * MakeMemoryList() erzeugt eine Liste der Speichereinträge mit
  532.     * allen Fragmentierungen
  533.     */
  534. void
  535. MakeMemoryList(void)
  536. {
  537.    register int i = 3;
  538.    register struct MemChunk *Loop;
  539.    register struct MemHeader *MemHeader;
  540.    char  cattype[MEMTYPELEN],type[5];
  541.    ULONG BlockSize = 0L, MemSize;
  542.  
  543.    DPOS;
  544.  
  545.    countentries = CountMemory() + 3;
  546.  
  547.    if (NoEntries())
  548.       return;
  549.  
  550.    Entries = AllocScrollEntries(countentries);
  551.  
  552.    Forbid();
  553.  
  554.    for (MemHeader = (struct MemHeader *) SysBase->MemList.lh_Head;
  555.         MemHeader->mh_Node.ln_Succ && (i < countentries);
  556.         MemHeader = (struct MemHeader *) MemHeader->mh_Node.ln_Succ)
  557.    {
  558.       MemSize = ((ULONG) MemHeader->mh_Upper - (ULONG)MemHeader->mh_Lower);
  559.       BlockSize += MemSize;
  560.  
  561.       if (MemHeader->mh_Attributes & MEMF_CHIP)
  562.          strcpy(type, "CHIP");
  563.       else if (MemHeader->mh_Attributes & MEMF_FAST)
  564.          strcpy(type, "FAST");
  565.       else
  566.          strcpy(type, field[NO_TYPE]);
  567.  
  568.       strncpy(cattype, type, MEMTYPELEN);
  569.  
  570.       sprintf(Entries[i].se_Entry, EntryAttr[MEMORY].ea_dataformat,
  571.               (ULONG) MemHeader, MemSize, type);
  572.  
  573.       i++;
  574.  
  575.       for (Loop = MemHeader->mh_First; Loop && (i < countentries);
  576.            Loop = Loop->mc_Next)
  577.       {
  578.          strncpy(cattype, type, MEMTYPELEN);
  579.          strcat(cattype, "-CHUNK");
  580.  
  581.          sprintf(Entries[i].se_Entry, EntryAttr[MEMORY].ea_dataformat,
  582.                  (ULONG) Loop, Loop->mc_Bytes, cattype);
  583.          i++;
  584.       }
  585.    }
  586.  
  587.    Permit();
  588.  
  589.    sprintf(Entries[0].se_Entry, "Total  : %8ld C:%8ld F:%8ld",
  590.            BlockSize, AvailMem(MEMF_CHIP), AvailMem(MEMF_FAST));
  591.  
  592.    sprintf(Entries[1].se_Entry, "Largest: %8s C:%8ld F:%8ld",
  593.            field[BLANK_FIELD], AvailMem(MEMF_CHIP | MEMF_LARGEST),
  594.            AvailMem(MEMF_FAST | MEMF_LARGEST));
  595.  
  596.    strcpy(Entries[2].se_Entry,"-------------- Fragmentation --------------");
  597.  
  598.    CreateEntryList(NO_SORT);
  599.  
  600.    return;
  601. }
  602.  
  603.    /*
  604.     * MakeSystemList() gibt eine Kurzinfo über das laufende System
  605.     */
  606. void
  607. MakeSystemList(void)
  608. {
  609.    int   count = 0;
  610.    long timeptr;
  611.    struct tm tm,
  612.         *tmhelp = &tm;
  613.  
  614.    DPOS;
  615.  
  616.    countentries = 10;
  617.    Entries = AllocScrollEntries(countentries);
  618.  
  619.    timeptr = time(NULL);
  620.    tmhelp = localtime((time_t *) & timeptr);
  621.  
  622.    sprintf(Entries[count++].se_Entry, "%02ld.%02ld.%ld, %3ld. day, %2ld. week",
  623.            tmhelp->tm_mday, tmhelp->tm_mon + 1, (1900 + tmhelp->tm_year),
  624.            tmhelp->tm_yday + 1, (int)((tmhelp->tm_yday + 1) / 7) + 1);
  625.  
  626.    sprintf(Entries[count++].se_Entry, "Tasks       : %ld",
  627.            CountNodes(&SysBase->TaskWait) + CountNodes(&SysBase->TaskReady) + 1);
  628.  
  629.    sprintf(Entries[count++].se_Entry, "Libraries   : %ld",
  630.            CountNodes(&SysBase->LibList));
  631.  
  632.    sprintf(Entries[count++].se_Entry, "Ports       : %ld",
  633.            CountNodes(&SysBase->PortList));
  634.  
  635.    sprintf(Entries[count++].se_Entry, "Volumes     : %ld",
  636.            CountDevices(LDF_VOLUMES));
  637.  
  638.    sprintf(Entries[count++].se_Entry, "Assigns     : %ld",
  639.            CountDevices(LDF_ASSIGNS));
  640.  
  641.    sprintf(Entries[count++].se_Entry, "Fonts       : %ld",
  642.            CountNodes(&GfxBase->TextFonts));
  643.  
  644.    sprintf(Entries[count++].se_Entry, "Resources   : %ld",
  645.            CountNodes(&SysBase->ResourceList));
  646.  
  647.    sprintf(Entries[count++].se_Entry, "Windows     : %ld",
  648.            CountIntuiObjects((int)WINDOWS));
  649.  
  650.    sprintf(Entries[count++].se_Entry, "Screens     : %ld",
  651.            CountIntuiObjects((int)SCREENS));
  652.  
  653.    CreateEntryList(NO_SORT);
  654.  
  655.    PrintInfo("Systeminfo read", SPEAK, 0);
  656.  
  657.    return;
  658. }
  659.