Article View: comp.sys.amiga.tech
Article #14196Re: Reading Autoconfig Parameters From a Card
From: Nicolas Costes
Date: Mon, 12 Mar 1990 15:32
Date: Mon, 12 Mar 1990 15:32
40 lines
1844 bytes
1844 bytes
Here is my 2 cents worth of code.
It is so simple , i could not resist posting it
it compiles with LATTICE 5.04 but use nothing specific
#include "libraries/expansionbase.h"
#include "libraries/expansion.h"
struct ExpansionBase *ExpansionBase;
main ()
{
struct ConfigDev *cd = NULL;
ExpansionBase =(struct ExpansionBase *) OpenLibrary(EXPANSIONNAME,0L);
if (ExpansionBase==NULL)
return(NULL);
cd = (struct ConfigDev *)ExpansionBase->BoardList.lh_Head;
while( cd->cd_BoardAddr )
{
printf("cd_Rom = %lx\n", cd->cd_Rom);
printf("cd_BoardAddr = %lx\n", cd->cd_BoardAddr);
printf("cd_BoardSize = %lx\n", cd->cd_BoardSize);
printf("cd_SlotAddr = %lx\n", cd->cd_SlotAddr);
printf("cd_Driver = %lx\n", cd->cd_Driver);
printf("er_Type = %d\n", cd->cd_Rom.er_Type);
printf("er_Product = %d\n", cd->cd_Rom.er_Product);
printf("er_Manufacturer = %d\n", cd->cd_Rom.er_Manufacturer);
printf("er_SerialNumber = %ld\n\n", cd->cd_Rom.er_SerialNumber);
cd = (struct configDev *)cd->cd_Node.ln_Succ;
}
CloseLibrary((struct Library *) ExpansionBase);
return(0);
}
It demonstrate ugly and straight access to the boards list.
//
\\X/ Nicolas
Technical Details
Message-ID:
<932@cbmfra.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ns-mx!iowasp!deimos!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!prls!pyramid!cbmvax!cbmehq!cbmfra!nicolasReferences:
<1287@mindlink.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ns-mx!iowasp!deimos!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!prls!pyramid!cbmvax!cbmehq!cbmfra!nicolas From: nicolas@cbmfra.UUCP (Nicolas Costes) Newsgroups: comp.sys.amiga.tech Subject: Re: Reading Autoconfig Parameters From a Card Summary: Example code Message-ID: <932@cbmfra.UUCP> Date: 12 Mar 90 15:32:07 GMT References: <1287@mindlink.UUCP> Reply-To: nicolas@cbmfra.UUCP (Nicolas Costes) Organization: Commodore France Amix system (A) Lines: 40