Subject: Re: buggy bios or pnpbios problem?
To: Castor Fu <castor@geocast.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: port-i386
Date: 11/30/1999 14:09:58
castor@geocast.com said:
> it looks almost as if the count of nodes returned should correspond to
> the node index, but it's one too high for that.

The node indices are not necessarily contigous. It's an
iterator-like thing. So this shouldn't be the cause of
your problems.
What does your debug output mean? Does it die during the
BIOS call?
I'll append an untested patch which should catch a possible BIOS
inconsistency. It might help or not...

best regards
Matthias


Index: pnpbios.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/pnpbios/pnpbios.c,v
retrieving revision 1.5
diff -c -r1.5 pnpbios.c
*** pnpbios.c	1999/11/19 02:40:25	1.5
--- pnpbios.c	1999/11/30 12:52:56
***************
*** 231,237 ****
  	buf = malloc(size, M_DEVBUF, M_NOWAIT);
  
  	idx = 0;
! 	for (i = 0; i < num; i++) {
  		int node = idx;
  		res = pnpbios_getnode(1, &idx, buf, size);
  		if (res) {
--- 231,237 ----
  	buf = malloc(size, M_DEVBUF, M_NOWAIT);
  
  	idx = 0;
! 	for (i = 0; i < num && idx != 0xff; i++) {
  		int node = idx;
  		res = pnpbios_getnode(1, &idx, buf, size);
  		if (res) {
***************
*** 242,247 ****
--- 242,249 ----
  			printf("node idx: called %d, got %d\n", node, buf[2]);
  		pnpbios_attachnode(sc, node, buf, buf[0] + (buf[1] << 8));
  	}
+ 	if (i != num)
+ 		printf("got only %d nodes\n", i);
  	if (idx != 0xff)
  		printf("last idx=%x\n", idx);