9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ish Rattan <ishwar@pali.cps.cmich.edu>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] Standalone cpu/auth..
Date: Thu, 16 May 2002 09:06:16 -0400	[thread overview]
Message-ID: <Pine.LNX.4.33L2.0205160903460.3010-100000@pali.cps.cmich.edu> (raw)
In-Reply-To: <4b8975be661bc48197d5ce424643c9a5@plan9.bell-labs.com>


Here is the output of the program. BTW the motherboard in question is
Intel Server board SAI2 with 32-bit and 64-bit PCI slots with on board
NIC and video.

-ishwar

On Wed, 15 May 2002, David Gordon Hogan wrote:

> > I just tried the cpu/auth standalone on a dual PIII with Intel
> > server mother board. At boot time, i see the message..
> > .....
> > pcirouting: South bridge FFFF, FFFF not found
> > .....
> > pcirouting: Can't find south bridge PCI 255.37.7
>
> The first message is ``impossible''.  I'd love to know
> why it's happening.  The second one is just improbable.
> What does the "pci" command report?  Also, here is
> a program for dumping the contents of the BIOS PCI
> routing table, please save it as "pcir.c", compile and
> run, then send me the output:
>
> #include <u.h>
> #include <libc.h>
>
> typedef struct Router Router;
> typedef struct Slot Slot;
>
> struct Slot
> {
> 	uchar	bus;			// Pci bus number
> 	uchar	dev;			// Pci device number
> 	uchar	maps[12];		// Avoid structs!  Link and mask.
> 	uchar	slot;			// Add-in/built-in slot
> 	uchar	reserved;
> };
>
> struct Router
> {
> 	uchar	signature[4];	// Routing table signature
> 	uchar	version[2];	// Version number
> 	uchar	size[2];		// Total table size
> 	uchar	bus;			// Interrupt router bus number
> 	uchar	devfn;		// Router's devfunc
> 	uchar	pciirqs[2];		// Exclusive PCI irqs
> 	uchar	compat[4];	// Compatible PCI interrupt router
> 	uchar	miniport[4];	// Miniport data
> 	uchar	reserved[11];
> 	uchar	checksum;
> };
>
> #define	GET2(p)		((p)[0]|((p)[1]<<8))
> #define	DEV(devfn)	(devfn>>3)
> #define	FN(devfn)		(devfn&7)
>
> void
> main(int argc, char *argv[])
> {
> 	Slot *e;
> 	Router *r;
> 	int fd, size, i;
> 	char file[64];
> 	uchar *buf, *p, *ep, *m;
>
> 	USED(argc, argv);
>
> 	snprint(file, sizeof file, "#p/%d/mem", getpid());
> 	fd = open(file, OREAD);
> 	if(fd < 0)
> 		sysfatal("open proc mem");
> 	if(seek(fd, 0x80000000|0xf0000, 0) < 0)
> 		sysfatal("seek proc mem");
>
> 	buf = malloc(0x10000);
> 	if(read(fd, buf, 0x10000) != 0x10000)
> 		sysfatal("read proc mem");
>
> 	ep = buf+0x10000;
> 	for(p = buf; p < ep; p += 16)
> 		if(p[0] == '$' && p[1] == 'P' && p[2] == 'I' && p[3] == 'R')
> 			break;
> 	if(p == ep) {
> 		fprint(2, "pcir: PCI routing table not found\n");
> 		exits("not found");
> 	}
>
> 	r = (Router *)p;
>
> 	print("PCI interrupt routing table version %d.%d at %.5ux\n",
> 		r->version[1], r->version[0], p-buf+0xf0000);
> 	print("South Bridge %d.%d.%d, irqs %.4uX compat %.4uX/%.4uX\n",
> 		r->bus, DEV(r->devfn), FN(r->devfn), GET2(r->pciirqs),
> 		GET2(&r->compat[0]), GET2(&r->compat[2]));
> 	print("miniport data: %.2uX %.2uX %.2uX %.2uX\n",
> 		r->miniport[0], r->miniport[1], r->miniport[2], r->miniport[3]);
> 	size = GET2(r->size);
> 	for(e = (Slot *)&r[1]; (uchar *)e < p + size; e++) {
> 		print("%d.%d.%d %.2uX:\t", e->bus, DEV(e->dev), FN(e->dev), e->slot);
> 		for(i = 0; i != 4; i++) {
> 			m = &e->maps[i * 3];
> 			print("[%d] %.2uX %.4uX ", i, m[0], (m[2] << 8)|m[1]);
> 		}
> 		print("\n");
> 	}
>
> 	exits(nil);
> }
>



  reply	other threads:[~2002-05-16 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-16  1:11 David Gordon Hogan
2002-05-16 13:06 ` Ish Rattan [this message]
2002-05-16 13:07 ` Ish Rattan
  -- strict thread matches above, loose matches on Subject: below --
2002-05-17 21:48 Ish Rattan
2002-05-16 19:26 David Gordon Hogan
2002-05-16 19:34 ` Ish Rattan
2002-05-16 18:02 David Gordon Hogan
2002-05-16 18:24 ` Ish Rattan
2002-05-16  1:21 rsc
2002-05-16  0:55 Ish Rattan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.33L2.0205160903460.3010-100000@pali.cps.cmich.edu \
    --to=ishwar@pali.cps.cmich.edu \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).