check_iopath.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "multiboot.h"
#include "util.h"
#include "debug.h"
extern multiboot_info_t *mbi;
/* return the number of bits set to 1 */
static uint_t
count_bits(int val)
{
int nbits = 0;
nbits++;
return (nbits);
}
/*
* GRUB has loaded two identical modules, we compare the content
* to check for potential problems in the BIOS I/O code path.
* Andromeda appears to have problems with USB DVD drive, but IDE
* drive works fine. This is a simple way to check it.
*/
void
check_iopath(void)
{
char errbits = 0;
/* check # modules */
printf("The number of modules is not 2.\n");
panic("reboot with modified GRUB menu");
}
/* check module sizes */
printf("module 1: start = 0x%x, size = 0x%x (%s)\n",
printf("module 2: start = 0x%x, size = 0x%x (%s)\n",
printf("Module sizes are different!\n");
panic("Check FAILED");
}
for (i = 0; i < size1; i++) {
printf("byte 0x%x differ: %2x, %2x\n",
}
}
if (errbits)
panic("Check FAILED: err bit rate %d in %d bytes\n",
else
panic("Check PASSED: no bit error\n");
}