Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!intercon!news From: amanda@mermaid.intercon.com (Amanda Walker) Newsgroups: comp.sys.mac.programmer Subject: Re: Accessing Nubus board name Message-ID: <1694@intercon.com> Date: 8 Jan 90 23:40:30 GMT References: <7492@pt.cs.cmu.edu> Sender: news@intercon.com Reply-To: amanda@mermaid.intercon.com (Amanda Walker) Lines: 67 In article <7492@pt.cs.cmu.edu>, mkb@rover.ri.cmu.edu (Mike Blackwell) writes: > For a given Nubus slot, how do I access the name of the board (as stored in > the configuration ROM)? I would guess it's in a slot resource, accessable by > SGetCString(), but I don't have Designing Cards and Drivers so I don't know > which one or where (and IM5 is no help). If you have a code fragment, or > even a hint, I would be most obliged. Here's my standard Slot Manager demo program. It compiles into an MPW tool (MPW C 3.0): #include #include #include main() { int i; SpBlock spb; long l; for (i = 9; i < 16; i++) { spb.spSlot = i; spb.spID = 1; spb.spExtDev = 0; if (!SRsrcInfo(&spb)) { printf("Slot %d:\n", i); spb.spID = sRsrcName; if (!SGetCString(&spb)) { printf(" %s\n", (char *) spb.spResult); } spb.spID = vendorInfo; if (!SFindStruct(&spb)) { spb.spID = vendorId; if (!SGetCString(&spb)) { printf(" Vendor: %s\n", (char *) spb.spResult); } spb.spID = serialNum; if (!SGetCString(&spb)) { printf(" Serial Number: %s\n", (char *) spb.spResult); } spb.spID = revLevel; if (!SGetCString(&spb)) { printf(" Revision: %s\n", (char *) spb.spResult); } spb.spID = partNum; if (!SGetCString(&spb)) { printf(" Part Number: %s\n", (char *) spb.spResult); } spb.spID = date; if (!SGetCString(&spb)) { printf(" Revision Date: %s\n", (char *) spb.spResult); } } } } } Enjoy, Amanda Walker InterCon Systems Corporation --