Index: msrpoke/Makefile =================================================================== --- msrpoke/Makefile (.../release-0) (revision 136) +++ msrpoke/Makefile (.../release-1) (revision 136) @@ -1,5 +1,5 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. -LDFLAGS = `pkg-config --libs glib-2.0` +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I.. +LDFLAGS = -nodefaultlibs -L../initramfs/data/lib -L../initramfs/data/usr/lib `pkg-config --libs glib-2.0` all: msrpoke.so @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f msrpoke.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: usbports/Makefile =================================================================== --- usbports/Makefile (.../release-0) (revision 136) +++ usbports/Makefile (.../release-1) (revision 136) @@ -1,5 +1,5 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. -I/usr/include/slang -LDFLAGS = `pkg-config --libs glib-2.0` +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I.. -I/usr/include/slang +LDFLAGS = -nodefaultlibs -L../initramfs/data/lib -L../initramfs/data/usr/lib `pkg-config --libs glib-2.0` all: usbports.so @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f usbports.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: biostest.h =================================================================== --- biostest.h (.../release-0) (revision 136) +++ biostest.h (.../release-1) (revision 136) @@ -70,6 +70,7 @@ extern GList *hardware_pokes; extern int finished_tests; extern int safe_mode; +extern int interactive_mode; @@ -96,7 +97,7 @@ /* ui.c */ -extern void init_resuilts_ui(void); +extern void init_results_ui(void); extern void report_testrun_ui(char *text); extern void show_results_ui(GList *list); extern void simple_ok_dialog(char *title, char *info); @@ -117,7 +118,7 @@ /* serial.c */ -extern void init_serial(int enable); +extern void init_serial(int enable, int tty, unsigned long speed); /* e820.c */ @@ -128,6 +129,8 @@ /* acpitable.c */ extern unsigned long RSDP_ADDRESS; extern int locate_acpi_table(char *name, unsigned long *address, unsigned long *size); +extern int locate_acpi_table32(char *name, unsigned long *address, unsigned long *size); +extern int locate_acpi_table64(char *name, unsigned long *address, unsigned long *size); extern int e820_is_reserved(uint64_t memory); extern char *copy_acpi_table(uint64_t address, char *name); extern char *execute_aml_method(char *method, char *execute); Index: virt/virt.c =================================================================== --- virt/virt.c (.../release-0) (revision 0) +++ virt/virt.c (.../release-1) (revision 136) @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2006, Intel Corporation + * + * This file is part of the Linux-ready Firmware Developer Kit + * + * This program file is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation;version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in a file named COPYING; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + +/* + * This test checks if the VT-setup is done correctly by the BIOS + */ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +static unsigned long long readmsr(int cpu, unsigned long offset) +{ + char buffer[PATH_MAX]; + FILE *file; + int fd; + unsigned long long msr_value=0xffffffff; + unsigned char *msr_value_buf; + int ret; + + msr_value_buf = (unsigned char *)&msr_value; + sprintf(buffer, "/dev/msr%i", cpu); + file = fopen(buffer, "r"); + if (!file) { + printf("Error: fopen failed \n"); + return -1; + } + fd = fileno(file); + + ret = pread(fd, msr_value_buf, 8, offset); + fclose(file); + if (ret<0) { + printf("Error: pread failed %d\n, errno=%d", ret, errno); + return -2; + } + + return msr_value; +} + +static int cpu_has_vmx(void) +{ + char line[4096]; + int hasit = 0; + FILE *file; + file = fopen("/proc/cpuinfo", "r"); + if (!file) + return 0; + while (!feof(file)) { + memset(line, 0, 4096); + fgets(line, 4095, file); + if (strstr(line,"flags") && strstr(line," vmx")) + hasit = 1; + } + fclose(file); + return hasit; +} + +#define MSR_FEATURE_CONTROL 0x03a + +static int vt_locked_by_bios(void) +{ + uint64_t msr; + + msr = readmsr(0, MSR_FEATURE_CONTROL); + return (msr & 5) == 1; /* VT capable but locked by bios*/ +} + +int main(int argc, char **argv) +{ + FILE *file; + start_test("virt", "VT/VMX Virtualization extensions", + "This test checks if VT/VMX is set up correctly"); + + if (!cpu_has_vmx()) + report_result("virt", INFO, "Processor does not support Virtualization extensions", NULL, NULL); + else + if (vt_locked_by_bios()) + report_result("virt", FAIL, "Virtualization extensions supported but disabled by BIOS", NULL, NULL); + + finish_test("virt"); + return EXIT_SUCCESS; +} + + + Index: virt/Makefile =================================================================== --- virt/Makefile (.../release-0) (revision 0) +++ virt/Makefile (.../release-1) (revision 136) @@ -0,0 +1,27 @@ +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC +LDFLAGS = `pkg-config --libs glib-2.0` -L../ -lstandalone + + +all: virt.exe + +virt.exe: virt.o .depend + gcc virt.o $(LDFLAGS) -o virt.exe + cp virt.exe ../plugins + +clean: + rm -rf *~ *.o + rm -f virt.so virt.exe + + +# most of the makefile remains as it was before. +# at the bottom, we add these lines: + +# rule for building dependency lists, and writing them to a file +# named ".depend". +.depend: + rm -f .depend + gccmakedep -f- -- $(CFLAGS) -- *.c > .depend + +# now add a line to include the dependency list. +include .depend + Index: AUTHORS =================================================================== --- AUTHORS (.../release-0) (revision 0) +++ AUTHORS (.../release-1) (revision 136) @@ -0,0 +1,3 @@ +Arjan van de Ven - arjan REMOVE-THIS AT linux DOT intel DOT com +Jacob Jun Pan - jacob.jun.pan REMOVE-THIS AT intel DOT com +Rolla Selbak - rolla.n.selbak REMOVE-THIS AT intel DOT com Index: acpiinfo/acpiinfo.c =================================================================== --- acpiinfo/acpiinfo.c (.../release-0) (revision 136) +++ acpiinfo/acpiinfo.c (.../release-1) (revision 136) @@ -68,7 +68,7 @@ extern char *current_test; -static void check_line(gpointer data, gpointer __unused user_data) +static void check_line(gpointer data, gpointer user_data) { static char *prevline = NULL; char *line = (char *)data; @@ -102,11 +102,11 @@ report_result("acpiinfo", FAIL, "Hyperthreading CPU enumeration fails", line, "dmesg://"); if (prevline && strstr(line, ">>> ERROR: Invalid checksum") && strlen(prevline)>11) { - char line[4096]; + char line2[4096]; char buf[4096]; - strcpy(line, prevline); - line[11]=0; - sprintf(buf, "ACPI table %s has an invalid checksum", &line[6]); + strcpy(line2, prevline); + line2[11]=0; + sprintf(buf, "ACPI table %s has an invalid checksum", &line2[6]); report_result("acpiinfo", FAIL, buf, prevline, "dmesg://"); } if (strstr(line, "MP-BIOS bug: 8254 timer not connected to IO-APIC")) @@ -129,12 +129,15 @@ if (strstr(line, "pcie_portdrv_probe->Dev") && strstr(line, "has invalid IRQ. Check vendor BIOS")) report_result("acpiinfo", FAIL, "PCI Express port driver reports an invalid IRQ", line, "dmesg://"); + + if (strstr(line, "BIOS handoff failed (BIOS bug ?)")) + report_result("acpiinfo", FAIL, "EHCI BIOS emulation handoff failed", line, "dmesg://"); /* and do the generic ones as well */ match_dmesg_string(line,"dmesg://"); - - prevline = line; + free(prevline); + prevline = strdup(line); } Index: acpiinfo/Makefile =================================================================== --- acpiinfo/Makefile (.../release-0) (revision 136) +++ acpiinfo/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += -fPIC `pkg-config --cflags glib-2.0` -I.. LDFLAGS = `pkg-config --libs glib-2.0` @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f acpiinfo.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +24,3 @@ # now add a line to include the dependency list. include .depend - Index: maxreadreq/maxreadreq.c =================================================================== --- maxreadreq/maxreadreq.c (.../release-0) (revision 0) +++ maxreadreq/maxreadreq.c (.../release-1) (revision 136) @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2006, Intel Corporation + * + * This file is part of the Linux-ready Firmware Developer Kit + * + * This program file is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation;version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in a file named COPYING; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + +/* + * This test checks if MaxReadReq is set > 128 for non-internal stuff + * A too low value hurts performance + */ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +int main(int argc, char **argv) +{ + FILE *file; + char current_type[512]; + char current_device[512]; + struct stat buffer; + memset(current_type, 0, 512); + memset(current_device, 0, 512); + + start_test("maxreadreq", "PCI Express MaxReadReq tuning", + "This test checks if the firmware has set MaxReadReq to a higher value on non-montherboard devices"); + + /* Check if lspci command exists */ + if(stat("/sbin/lspci", &buffer) != 0) { + + report_result("maxreadreq", FAIL, "Cannot find lspci command", + "/sbin/lspci", NULL); + goto finish; + } + + file = popen("/sbin/lspci -vvv", "r"); + if (!file) { + report_result("maxreadreq", FAIL, "Cannot execute lspci command", + "/sbin/lspci -vvv", NULL); + goto finish; + } + while (!feof(file)) { + char line[4096]; + int val = 0; + char *c; + memset(line, 0, 4096); + if (fgets(line, 4095, file)==NULL) + break; + + if (line[0]!=' ' && line[0] != '\t' && strlen(line)>8) { + sprintf(current_device, "pci://00:%s", line, 511); + current_device[16] = 0; + strncpy(current_type, line+8, 511); + c = strchr(current_type, ':'); + if (c) *c=0; + } + /* chipset devices are exempt from this check */ + if (strcmp(current_type, "PCI bridge")==0) + continue; + if (strcmp(current_type, "Host bridge")==0) + continue; + if (strcmp(current_type, "System peripheral")==0) + continue; + c = strstr(line, "MaxReadReq "); + if (c) { + char buffer[4096]; + sprintf(buffer, "MaxReadReq for device %s is low (128)", current_device); + c += 11; + val = strtoul(c, NULL, 10); + if (val == 128) + report_result("maxreadreq", WARN, buffer, NULL, current_device); + } + } + pclose(file); +finish: finish_test("maxreadreq"); + return EXIT_SUCCESS; +} + + + Index: maxreadreq/Makefile =================================================================== --- maxreadreq/Makefile (.../release-0) (revision 0) +++ maxreadreq/Makefile (.../release-1) (revision 136) @@ -0,0 +1,27 @@ +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC +LDFLAGS = `pkg-config --libs glib-2.0` -L../ -lstandalone + + +all: maxreadreq.exe + +maxreadreq.exe: maxreadreq.o .depend + gcc maxreadreq.o $(LDFLAGS) -o maxreadreq.exe + cp maxreadreq.exe ../plugins + +clean: + rm -rf *~ *.o + rm -f maxreadreq.so maxreadreq.exe + + +# most of the makefile remains as it was before. +# at the bottom, we add these lines: + +# rule for building dependency lists, and writing them to a file +# named ".depend". +.depend: + rm -f .depend + gccmakedep -f- -- $(CFLAGS) -- *.c > .depend + +# now add a line to include the dependency list. +include .depend + Index: os2gap/os2gap.c =================================================================== --- os2gap/os2gap.c (.../release-0) (revision 0) +++ os2gap/os2gap.c (.../release-1) (revision 136) @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2006, Intel Corporation + * + * This file is part of the Linux-ready Firmware Developer Kit + * + * This program file is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation;version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in a file named COPYING; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + +/* + * This test checks if there is a OS/2 memory hole that breaks linux bootloaders + */ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +void run_test(void) +{ + start_test("os2gap", "OS/2 memory hole test", + "This test checks if the OS/2 15Mb memory hole is absent"); + + if (e820_is_reserved(15*1024*1024)) + report_result("os2gap", FAIL, "The memory map has a memory hole between 15Mb and 16Mb", NULL, "e820://"); + + finish_test("os2gap"); +} + + + Index: os2gap/Makefile =================================================================== --- os2gap/Makefile (.../release-0) (revision 0) +++ os2gap/Makefile (.../release-1) (revision 136) @@ -0,0 +1,26 @@ +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC +LDFLAGS = `pkg-config --libs glib-2.0` + + +all: os2gap.so + +os2gap.so: os2gap.o .depend + gcc --shared os2gap.o $(LDFLAGS) -o os2gap.so + cp os2gap.so ../plugins + +clean: + rm -rf *~ *.o + rm -f os2gap.so + +# most of the makefile remains as it was before. +# at the bottom, we add these lines: + +# rule for building dependency lists, and writing them to a file +# named ".depend". +.depend: + rm -f .depend + gccmakedep -f- -- $(CFLAGS) -- *.c > .depend + +# now add a line to include the dependency list. +include .depend + Index: ui.c =================================================================== --- ui.c (.../release-0) (revision 136) +++ ui.c (.../release-1) (revision 136) @@ -48,13 +48,14 @@ return longest; } -void init_resuilts_ui(void) +/* Display LFDK root window and welcome screen */ +void init_results_ui(void) { int myHelloWin; newtComponent myHelloText, myHelloForm; newtInit(); newtCls(); - newtDrawRootText(0,0, " Linux-ready Firmware Developer Kit - Release 0 - (C) 2006 Intel Corporation"); + newtDrawRootText(0,0, " Linux-ready Firmware Developer Kit - Release 1 - (C) 2006 Intel Corporation"); newtPushHelpLine( " Linux-ready Firmware Developer Kit"); int W,H; @@ -85,12 +86,13 @@ if (getuid()==0) sleep(6); /* the kernel tends to spew for a few seconds or so after boot which distords the screen. Just show this text during this time to - not have the real app run with a distorded screen. + not have the real app run with a distorted screen. */ newtPopWindow(); } +/* Display LFDK help window */ void help_screen(void) { int myHelloWin; @@ -122,11 +124,14 @@ newtPopWindow(); } - +/* Initializing test progress window */ void report_testrun_ui(char *text) { int W,H; newtGetScreenSize(&W,&H); + + /* If this is the first test being run, show 'performing tests' + * message first. */ if (myProgressWin==-1) { myProgressWin = newtOpenWindow(5,9,W-12,7, "Performing tests"); myProgressForm = newtForm(NULL,NULL,0); @@ -142,6 +147,7 @@ newtRefresh(); } +/* Display progress bar */ void report_testrun_progress(int percentage) { /* abort when things aren't initialized yet */ @@ -610,6 +616,8 @@ } } +/* Display LFDK results window, the one you see after all the + * tests have been run, and the results are displayed. */ void show_results_ui(GList *all_tests) { int win; @@ -668,7 +676,9 @@ myHelpButton = newtButton(61,H-8, "Help"); newtFormAddComponent(myForm, myHelpButton); - while (1) { + if (!interactive_mode) { + save_on_usb(); + } else while (1) { resu = newtRunForm(myForm); if (resu == myList) { result = newtListboxGetCurrent(myList); Index: BUILD =================================================================== --- BUILD (.../release-0) (revision 0) +++ BUILD (.../release-1) (revision 136) @@ -0,0 +1,29 @@ +============================================ + Linux-ready firmware developer kit: + BUILD +============================================ + +- Compile all code and stand-alone tests + + # make + +- Create a bootable iso (initramfs/firmwarekit.iso) + + # make iso + +- Create a bootable iso and copy it to your usb stick + + # make usbiso + +- Clean up (won't delete downloaded rpms and srpms in initramfs/ dir) + + # make clean + + +For more documentation on running stand-alone tests and creating ISOs, +go to Documentation/ . + +Root user note: Running with 'root' privileges will provide best results (especially for scripts such as firmwarekit/initramfs/dev.sh, etc.) + +Proxy note: make sure your proxy is set correctly for wget commands (set variables http_proxy, ftp_proxy, etc.) + Index: serial.c =================================================================== --- serial.c (.../release-0) (revision 136) +++ serial.c (.../release-1) (revision 136) @@ -39,12 +39,17 @@ #include "biostest.h" -void init_serial(int enable) +void init_serial(int enable, int tty, unsigned long speed) { int fd; struct termios termios; struct winsize winsize; + char dev_name[255]; + char cp_command[255]; + sprintf(dev_name, "/dev/tty%d", tty); + sprintf(cp_command, "cp -a %s /dev/tty", dev_name); + memset(&winsize, 0, sizeof(winsize)); memset(&termios, 0, sizeof(termios)); @@ -56,8 +61,7 @@ if (access("/dev/tty.console", R_OK)) return; - - + /* if we're not using serial output */ if (!enable) { unlink("/dev/tty"); if (system("cp -a /dev/tty.console /dev/tty")) @@ -69,13 +73,13 @@ fprintf(stderr, "Remember to set your terminal settings to 115200/8N1.\n"); - fd = open("/dev/ttyS0", O_RDWR); + fd = open(dev_name, O_RDWR); if (fd<0) return; unlink("/dev/tty"); - if (system("cp -a /dev/ttyS0 /dev/tty")) + if (system(cp_command)) return; tcgetattr(fd, &termios); @@ -88,8 +92,8 @@ termios.c_cc[VMIN] = 1; termios.c_cc[VTIME] = 0; - cfsetospeed(&termios , B115200); - cfsetispeed(&termios , B115200); + cfsetospeed(&termios , speed); + cfsetispeed(&termios , speed); tcsetattr(fd, TCSANOW, &termios); Index: libstandalone.c =================================================================== --- libstandalone.c (.../release-0) (revision 136) +++ libstandalone.c (.../release-1) (revision 136) @@ -58,9 +58,14 @@ int len; int count = 0; + if (string==NULL) return strdup("--"); + if (getenv("DEBUG")!=NULL) { + return strdup(string); + } + len = strlen(string); buf = malloc(len*2+1); @@ -76,15 +81,28 @@ void start_test(char *testID, char *name, char *description) { + char *test_id = encode(testID); + char *_name = encode(name); + char *_description = encode(description); if (!boot_dmesg) local_get_dmesg_buffer(); - fprintf(stdout, "S %s %s %s\n", encode(testID), encode(name), encode(description)); + fprintf(stdout, "S %s %s %s\n", test_id, _name, _description); + free(test_id); + free(_name); + free(_description); fflush(stdout); } void report_result(char *testID, int res, char *summary, char *details, char *devuri) { char result[16]; + char *test_id = encode(testID); + char *_result; + char *_summary = encode(summary); + char *_details = encode(details); + char *_devuri = encode(devuri); + + memset(result, 0, 16); switch (res) { @@ -104,14 +122,22 @@ strcpy(result, "BUG!"); break; } + _result = encode(result); - fprintf(stdout, "R %s %s %s %s %s\n", encode(testID), encode(result), encode(summary), encode(details), encode(devuri)); + fprintf(stdout, "R %s %s %s %s %s\n", test_id, _result, _summary, _details, _devuri); + free(test_id); + free(_result); + free(_summary); + free(_details); + free(_devuri); fflush(stdout); } void finish_test(char *testID) { + char *test_id = encode(testID); fprintf(stdout, "F %s\n", encode(testID)); + free(test_id); fflush(stdout); } @@ -123,7 +149,20 @@ void announce_resource(char *uri, char *description, char *parent) { - fprintf(stdout, "U %s %s %s\n", encode(uri), encode(description), encode(parent)); + char *_uri = encode(uri); + char *desc = encode(description); + char *par = encode(parent); + + fprintf(stdout, "U %s %s %s\n", _uri, desc, par); + free(_uri); + free(desc); + free(par); + fflush(stdout); } +void load_boot_dmesg_buffer(void) +{ + if (!boot_dmesg) + local_get_dmesg_buffer(); +} Index: fan/fan.c =================================================================== --- fan/fan.c (.../release-0) (revision 136) +++ fan/fan.c (.../release-1) (revision 136) @@ -62,9 +62,9 @@ free(state); -} + } -int main(int __unused argc, char __unused **argv) +int main(int argc, char **argv) { DIR *dir; struct dirent *entry; @@ -86,7 +86,7 @@ entry = readdir(dir); if (entry && strlen(entry->d_name)>2) { sprintf(fanpath, "/proc/acpi/fan/%s", entry->d_name); - //do_fan(fanpath, entry->d_name); + do_fan(fanpath, entry->d_name); } } while (entry); Index: fan/Makefile =================================================================== --- fan/Makefile (.../release-0) (revision 136) +++ fan/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I../ +override CFLAGS += `pkg-config --cflags glib-2.0` -I../ LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone @@ -11,8 +11,8 @@ clean: rm -rf *~ *.o rm -f fan.so fan.exe - - + + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +25,3 @@ # now add a line to include the dependency list. include .depend - Index: bashshell/Makefile =================================================================== --- bashshell/Makefile (.../release-0) (revision 136) +++ bashshell/Makefile (.../release-1) (revision 136) @@ -1,5 +1,5 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. -I/usr/include/slang -LDFLAGS = `pkg-config --libs glib-2.0` +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I.. -I/usr/include/slang +LDFLAGS = -nodefaultlibs -L../initramfs/data/lib -L../initramfs/data/usr/lib `pkg-config --libs glib-2.0` all: bashshell.so @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f bashshell.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: cpufreq/cpufreq.c =================================================================== --- cpufreq/cpufreq.c (.../release-0) (revision 136) +++ cpufreq/cpufreq.c (.../release-1) (revision 136) @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -46,7 +47,14 @@ static int totaltests = 1; static int performedtests = 0; +static int no_cpufreq = 0; +static unsigned long topspeed=1; + +#define GET_PERFORMANCE_MAX (0) +#define GET_PERFORMANCE_MIN (1) +#define GET_PERFORMANCE_AVG (2) + static int count_ints(char *str) { char *c; @@ -65,9 +73,31 @@ return count; } +static void set_governor(int cpunr) +{ + char path[PATH_MAX]; + FILE *file; + sprintf(path, "/sys/devices/system/cpu/cpu%i/cpufreq/scaling_governor", cpunr); + file = fopen(path, "w"); + if (file == NULL) { + if (!no_cpufreq) + report_result("cpufreq", WARN, "Frequency scaling not supported", NULL, NULL); + no_cpufreq = 1; + return; + } + fprintf(file,"userspace"); + fclose(file); +} -static void set_HZ(int cpunr, unsigned long Hz, char *dir) +static int cpu_exists(int cpunr) { + char path[PATH_MAX]; + sprintf(path, "/sys/devices/system/cpu/cpu%i/cpufreq/scaling_governor", cpunr); + return !access(path, R_OK); +} + +static void set_HZ(int cpunr, unsigned long Hz) +{ cpu_set_t mask, oldset; char path[PATH_MAX]; FILE *file; @@ -79,9 +109,11 @@ CPU_ZERO(&mask); CPU_SET(cpunr, &mask); sched_setaffinity(0, sizeof(mask), &mask); + + set_governor(cpunr); /* then set the speed */ - sprintf(path, "%s/scaling_setspeed", dir); + sprintf(path, "/sys/devices/system/cpu/cpu%i/cpufreq/scaling_setspeed", cpunr); file = fopen(path, "w"); if (!file) return; @@ -92,11 +124,9 @@ } -static unsigned long get_performance(int cpunr, unsigned long Hz, char *dir) +static unsigned long get_performance(int cpunr) { cpu_set_t mask, oldset; - char path[PATH_MAX]; - FILE *file; time_t current; unsigned long loopcount = 0; @@ -108,14 +138,6 @@ CPU_SET(cpunr, &mask); sched_setaffinity(0, sizeof(mask), &mask); - /* then set the speed */ - sprintf(path, "%s/scaling_setspeed", dir); - file = fopen(path, "w"); - if (!file) - return 0; - fprintf(file, "%lu", Hz); - fclose(file); - current = time(NULL); while (current == time(NULL)) sched_yield(); current = time(NULL); @@ -148,6 +170,47 @@ return loopcount; } + +static unsigned long get_performance_repeat(int cpunr, unsigned long Hz, int count, int type) +{ + int i; + + unsigned long max = 0, min = ULONG_MAX, real_count = 0; + unsigned long long cumulative; + unsigned long retval; + + set_HZ(cpunr, Hz); + for (i = 0; i < count; i++) { + unsigned long temp; + temp = get_performance(cpunr); + if (temp) { + if (temp < min) + min = temp; + + if (temp > max) + max = temp; + + cumulative += temp; + real_count++; + } + } + switch (type) { + case GET_PERFORMANCE_MAX: + retval = max; + break; + case GET_PERFORMANCE_MIN: + retval = min; + break; + case GET_PERFORMANCE_AVG: + retval = cumulative/real_count; + break; + default: + retval = 0; + break; + } + return retval; +} + static char *HzToHuman(unsigned long hz) { static char buffer[1024]; @@ -163,13 +226,13 @@ sprintf(buffer, "%6lli Mhz", (Hz+500)/1000); if (Hz>1500000) - sprintf(buffer, "%6.2f Ghz", (Hz+500000.0)/1000000); + sprintf(buffer, "%6.2f Ghz", (Hz+50000.0)/1000000); return buffer; } -static void do_cpu(int cpunr, char *dir) +static void do_cpu(int cpunr) { char path[PATH_MAX]; char line[4096]; @@ -179,25 +242,19 @@ int i, delta; int speedcount; static int warned=0; - unsigned long topspeed=1; char *details = NULL; memset(freqs, 0, sizeof(freqs)); memset(line, 0, 4096); - sprintf(path, "%s/scaling_governor", dir); - file = fopen(path, "w"); - if (file == NULL) { - report_result("cpufreq", WARN, "Frequency scaling not supported", NULL, NULL); - return; - } - fprintf(file,"userspace"); - fclose(file); + set_governor(cpunr); - sprintf(path, "%s/scaling_available_frequencies", dir); + sprintf(path, "/sys/devices/system/cpu/cpu%i/cpufreq/scaling_available_frequencies", cpunr); file = fopen(path, "r"); if (file == NULL) { - report_result("cpufreq", WARN, "Frequency scaling not supported", NULL, NULL); + if (!no_cpufreq) + report_result("cpufreq", WARN, "Frequency scaling not supported", NULL, NULL); + no_cpufreq = 1; return; } if (fgets(line, 4095, file)==NULL) @@ -205,7 +262,7 @@ fclose(file); if (totaltests==1) - totaltests = count_ints(line) * sysconf(_SC_NPROCESSORS_CONF); + totaltests = (2+count_ints(line)) * sysconf(_SC_NPROCESSORS_CONF) + 2; c = line; i = 0; @@ -219,7 +276,8 @@ } freqs[i].Hz = strtoull(c, NULL, 10); - freqs[i].speed = get_performance(cpunr, freqs[i].Hz, dir); + set_HZ(cpunr, freqs[i].Hz); + freqs[i].speed = get_performance(cpunr); if (freqs[i].speed > topspeed) topspeed = freqs[i].speed; @@ -280,28 +338,58 @@ } -static void lowest_speed(int cpunr, char *dir) +static void lowest_speed(int cpunr) { char path[PATH_MAX]; char line[4096]; - struct freq freqs[32]; + unsigned long Hz; FILE *file; char *c, *c2; int i; - int speedcount; unsigned long lowspeed=0; - memset(freqs, 0, sizeof(freqs)); - memset(line, 0, 4096); + sprintf(path, "/sys/devices/system/cpu/cpu%i/cpufreq/scaling_available_frequencies", cpunr); + file = fopen(path, "r"); + if (file == NULL) + return; - sprintf(path, "%s/scaling_governor", dir); - file = fopen(path, "w"); - if (file == NULL) + if (fgets(line, 4095, file)==NULL) return; - fprintf(file,"userspace"); fclose(file); - sprintf(path, "%s/scaling_available_frequencies", dir); + c = line; + i = 0; + while (c && strlen(c)>1) { + c2 = strchr(c, ' '); + if (c2) { + *c2=0; + c2++; + } else { + c2 = NULL; + } + + Hz = strtoull(c, NULL, 10); + if (Hz < lowspeed || lowspeed==0) + lowspeed = Hz; + + + c = c2; + } + + set_HZ(cpunr, lowspeed); +} + +static void highest_speed(int cpunr) +{ + char path[PATH_MAX]; + char line[4096]; + uint64_t Hz; + FILE *file; + char *c, *c2; + int i; + unsigned long highspeed=0; + + sprintf(path, "/sys/devices/system/cpu/cpu%i/cpufreq/scaling_available_frequencies", cpunr); file = fopen(path, "r"); if (file == NULL) return; @@ -321,25 +409,212 @@ c2 = NULL; } - freqs[i].Hz = strtoull(c, NULL, 10); - if (freqs[i].Hz < lowspeed || lowspeed==0) - lowspeed = freqs[i].Hz; + Hz = strtoull(c, NULL, 10); + if (Hz > highspeed || highspeed==0) + highspeed = Hz; - i++; c = c2; } - speedcount = i; - set_HZ(cpunr, lowspeed, dir); + set_HZ(cpunr, highspeed); } -int main(int __unused argc, char __unused **argv) +/* + 4) Is BIOS wrongly doing Sw_All P-state coordination across cpus + - Change frequency on all CPU to the lowest value + - Change frequency on one particular CPU to the highest + - If BIOS is doing Sw_All, the last high freq request will not work + */ +static void do_sw_all_test(void) { DIR *dir; struct dirent *entry; + unsigned long highperf, lowperf; + int first_cpu_index = -1; + dir = opendir("/sys/devices/system/cpu"); + if (!dir) { + printf("FATAL: cpufreq: sysfs not mounted\n"); + return; + } + + do { + int cpunr; + entry = readdir(dir); + if (entry && strlen(entry->d_name)>3) { + cpunr = strtoul(entry->d_name+3, NULL, 10); + if (first_cpu_index == -1) + first_cpu_index = cpunr; + + lowest_speed(cpunr); + } + } while (entry); + closedir(dir); + + /* All CPUs at the lowest frequency */ + lowperf = 100 * get_performance_repeat(first_cpu_index, + 0, + 5, + GET_PERFORMANCE_MIN) / + topspeed; + highest_speed(first_cpu_index); + highperf = 100 * get_performance_repeat(first_cpu_index, + 0, + 5, + GET_PERFORMANCE_MAX) / + topspeed; + + if (lowperf >= highperf) { + char outbuf[4095]; + sprintf(outbuf, "Firmware not implementing hardware " + "coordination cleanly. Firmware using SW_ALL " + "instead?\n"); + report_result("cpufreq", FAIL, outbuf, NULL, NULL); + } +} + + +/* + 5) Is BIOS wrongly doing Sw_Any P-state coordination across cpus + - Change frequency on all CPU to the lowest value + - Change frequency on one particular CPU to the highest + - Change frequency on all CPU to the lowest value + - If BIOS is doing Sw_Any, the high freq request will not work + */ +static void do_sw_any_test(void) +{ + DIR *dir; + struct dirent *entry; + unsigned long highperf, lowperf; + int first_cpu_index = -1; + + dir = opendir("/sys/devices/system/cpu"); + if (!dir) { + printf("FATAL: cpufreq: sysfs not mounted\n"); + return; + } + + do { + int cpunr; + entry = readdir(dir); + if (entry && strlen(entry->d_name)>3) { + cpunr = strtoul(entry->d_name+3, NULL, 10); + if (first_cpu_index == -1) + first_cpu_index = cpunr; + + lowest_speed(cpunr); + } + } while (entry); + closedir(dir); + + /* All CPUs at the lowest frequency */ + lowperf = 100 * get_performance_repeat(first_cpu_index, + 0, + 5, + GET_PERFORMANCE_MIN) / + topspeed; + + highest_speed(first_cpu_index); + + dir = opendir("/sys/devices/system/cpu"); + if (!dir) { + printf("FATAL: cpufreq: sysfs not mounted\n"); + return; + } + + do { + int cpunr; + entry = readdir(dir); + if (entry && strlen(entry->d_name)>3) { + cpunr = strtoul(entry->d_name+3, NULL, 10); + if (cpunr == first_cpu_index) { + continue; + } + lowest_speed(cpunr); + } + } while (entry); + closedir(dir); + + highperf = 100 * get_performance_repeat(first_cpu_index, + 0, + 5, + GET_PERFORMANCE_MAX) / + topspeed; + + if (lowperf >= highperf) { + char outbuf[4095]; + sprintf(outbuf, "Firmware not implementing hardware " + "coordination cleanly. Firmware using SW_ANY " + "instead?\n"); + report_result("cpufreq", FAIL, outbuf, NULL, NULL); + } +} + + +static void check_sw_any(void) +{ + DIR *dir; + struct dirent *entry; + uint64_t low_perf, high_perf, newhigh_perf; + static int once = 0; + int max_cpu = 0, i,j; + /* First set all processors to their lowest speed */ + dir = opendir("/sys/devices/system/cpu"); + if (!dir) { + printf("FATAL: cpufreq: sysfs not mounted\n"); + return; + } + + do { + int cpunr; + entry = readdir(dir); + if (entry && strlen(entry->d_name)>3) { + cpunr = strtoul(entry->d_name+3,NULL,10); + lowest_speed(cpunr); + if (cpunr > max_cpu) + max_cpu = cpunr; + } + } while (entry); + closedir(dir); + + if (max_cpu == 0) + return; /* Single processor machine, no point in checking anything */ + + /* assume that all processors have the same low performance */ + low_perf = get_performance(max_cpu); + for (i=0; i<= max_cpu; i++) { + highest_speed(i); + if (!cpu_exists(i)) + continue; + high_perf = get_performance(i); + performedtests++; + report_testrun_progress((100 * performedtests)/totaltests); + /* now set all the others to low again; sw_any will cause the core in question + to now also get the low speed, while hardware max will keep the performance + */ + for (j=0; j <= max_cpu; j++) + if (i!=j) + lowest_speed(j); + newhigh_perf = get_performance(i); + if (high_perf - newhigh_perf > (high_perf - low_perf)/4 && once==0 && (high_perf - low_perf > 20)) { + report_result("cpufreq", FAIL, "Processors are set to SW_ANY", NULL, NULL); + once++; + lowest_speed(i); + } + performedtests++; + report_testrun_progress((100 * performedtests)/totaltests); + } + if (!once) + report_result("cpufreq", PASS, "P-state coordination done by Harware", NULL, NULL); +} + +int main(int argc, char **argv) +{ + DIR *dir; + struct dirent *entry; + start_test("cpufreq", "CPU frequency scaling tests", "For each processor in the system, this test steps through the " "various frequency states (P-states) that the BIOS advertises " @@ -348,6 +623,8 @@ " 1) Each processor has the same number of frequency states\n" " 2) Higher advertised frequencies have a higher performance\n" " 3) No duplicate frequency values are reported by the BIOS\n" + " 4) Is BIOS wrongly doing Sw_All P-state coordination across cores\n" + " 5) Is BIOS wrongly doing Sw_Any P-state coordination across cores\n" ); /* First set all processors to their lowest speed */ @@ -359,12 +636,10 @@ do { int cpunr; - char cpupath[2048]; entry = readdir(dir); if (entry && strlen(entry->d_name)>3) { - sprintf(cpupath, "/sys/devices/system/cpu/%s/cpufreq/", entry->d_name); cpunr = strtoul(entry->d_name+3,NULL,10); - lowest_speed(cpunr, cpupath); + lowest_speed(cpunr); } } while (entry); closedir(dir); @@ -379,19 +654,50 @@ do { int cpunr; - char cpupath[2048]; entry = readdir(dir); if (entry && strlen(entry->d_name)>3) { - sprintf(cpupath, "/sys/devices/system/cpu/%s/cpufreq/", entry->d_name); cpunr = strtoul(entry->d_name+3,NULL,10); - do_cpu(cpunr, cpupath); - lowest_speed(cpunr, cpupath); + do_cpu(cpunr); + lowest_speed(cpunr); + if (no_cpufreq) + break; } } while (entry); closedir(dir); + /* set everything back to the highest speed again */ + dir = opendir("/sys/devices/system/cpu"); + if (!dir) { + printf("FATAL: cpufreq: sysfs not mounted\n"); + return 0; + } + do { + int cpunr; + entry = readdir(dir); + if (entry && strlen(entry->d_name)>3) { + cpunr = strtoul(entry->d_name+3,NULL,10); + highest_speed(cpunr); + } + } while (entry); + closedir(dir); + if (!no_cpufreq) + check_sw_any(); + + /* + * Check for more than one CPU and more than one frequency and + * then do the benchmark set 2 + */ + if (sysconf(_SC_NPROCESSORS_CONF) > 1 && nrspeeds > 1) { + do_sw_all_test(); + performedtests++; + do_sw_any_test(); + performedtests++; + } else if (nrspeeds > 1) { + performedtests += 2; + } + finish_test("cpufreq"); return 0; } Index: cpufreq/Makefile =================================================================== --- cpufreq/Makefile (.../release-0) (revision 136) +++ cpufreq/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += -I.. `pkg-config --cflags glib-2.0` -fPIC LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone -lm @@ -11,8 +11,8 @@ clean: rm -rf *~ *.o rm -f cpufreq.so cpufreq.exe - - + + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +25,3 @@ # now add a line to include the dependency list. include .depend - Index: acpitable.c =================================================================== --- acpitable.c (.../release-0) (revision 136) +++ acpitable.c (.../release-1) (revision 136) @@ -425,15 +425,15 @@ if (rsdt) ret_r = locate_acpi_table_rsdt(name, &r_addr, &r_size); - if (xsdt && rsdt) { - if (x_addr != r_addr) { + if (xsdt && rsdt && ret_x != -1 && ret_r != -1) { + if (x_addr != r_addr && strcmp(name,"FACP")!=0) { char buffer[1024]; sprintf(buffer, "ACPI: there are different addresses (%lx and %lx) for table %s in XSDT versus RSDT.", x_addr, r_addr, name); report_result(NULL, WARN, buffer, NULL, NULL); } } - if (xsdt) { + if (xsdt && ret_x != -1) { *address = x_addr; *size = x_size; return ret_x; @@ -443,7 +443,52 @@ return ret_r; } +int locate_acpi_table32(char *name, unsigned long *address, unsigned long *size) +{ + *address = 0; + *size = 0; + unsigned long r_addr = 0, r_size = 0; + int ret_r = 0; + + /* not yet initialized */ + if (!rsdt) + find_rsdt(); + + if (!rsdt) + return -1; + + if (rsdt) + ret_r = locate_acpi_table_rsdt(name, &r_addr, &r_size); + + *address = r_addr; + *size = r_size; + return ret_r; +} + + +int locate_acpi_table64(char *name, unsigned long *address, unsigned long *size) +{ + *address = 0; + *size = 0; + + unsigned long x_addr = 0 , x_size = 0; + int ret_x = 0; + + /* not yet initialized */ + if (!xsdt) + find_rsdt(); + + if (!xsdt) + return -1; + + ret_x = locate_acpi_table_xsdt(name, &x_addr, &x_size); + + *address = x_addr; + *size = x_size; + return ret_x; +} + #define DMESG_SIZE 128000 char *execute_aml_method(char *method, char *execute) Index: tonetest/Makefile =================================================================== --- tonetest/Makefile (.../release-0) (revision 136) +++ tonetest/Makefile (.../release-1) (revision 136) @@ -1,5 +1,5 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. -I/usr/include/slang -LDFLAGS = `pkg-config --libs glib-2.0` +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I.. -I/usr/include/slang +LDFLAGS = -nodefaultlibs -L../initramfs/data/lib -L../initramfs/data/usr/lib `pkg-config --libs glib-2.0` all: tonetest.so @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f tonetest.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: cstates/cstates.c =================================================================== --- cstates/cstates.c (.../release-0) (revision 136) +++ cstates/cstates.c (.../release-1) (revision 136) @@ -148,8 +148,10 @@ for (i=2; i<16;i++) if (current.used[i]>0) { if (initial.counts[i] == current.counts[i] && !warned) { +/* sprintf(buffer,"Processor %i doesn't increment C-state count in C%i", cpunr,i); report_result("cstates", FAIL, buffer,NULL,NULL); +*/ /* Disabled due to Linux kernel bug */ warned = 1; } initial.counts[i] = current.counts[i]; @@ -173,9 +175,10 @@ if (initial.used[ti]==0) strcat(buffer, b2); } + strcat(buffer, "during tests."); if (keepgoing) - report_result("cstates", WARN, buffer, NULL, NULL); + report_result("cstates", INFO, buffer, NULL, NULL); sprintf(buffer,"Processor %i has reached all C-states", cpunr); for (ti=2; ti<16;ti++) { char b2[64]; @@ -206,7 +209,7 @@ } -int main(int __unused argc, char __unused **argv) +int main(int argc, char **argv) { DIR *dir; struct dirent *entry; Index: cstates/Makefile =================================================================== --- cstates/Makefile (.../release-0) (revision 136) +++ cstates/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC LDFLAGS = `pkg-config --libs glib-2.0` -lm -L.. -lstandalone @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f cstates.so cstates.exe - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: Documentation/HOWTO_CREATEISO.txt =================================================================== --- Documentation/HOWTO_CREATEISO.txt (.../release-0) (revision 136) +++ Documentation/HOWTO_CREATEISO.txt (.../release-1) (revision 136) @@ -1,34 +0,0 @@ -============================================ - Linux-ready firmware developer kit: - HOWTO CREATE ISO -============================================ - -CONTENTS ---------- - -1. Creating burnable ISO (bootable CD that automatically will run the tests) -2. Creating stand-lone self-extracting script to run tests on an already running Linux distro - ------------------------------------------------------------------------------ -1. Creating burnable ISO (bootable CD that automatically will run the tests) ------------------------------------------------------------------------------ - -- cd firmwarekit/ -- Run 'make iso' -- This will create the burnable iso: firmwarekit/biotest.iso - -* Root user note: Running with 'root' privelages will provide best results (especially for scripts such as firmwarekit/initramfs/dev.sh, etc.) - -* Proxy note: make sure your proxy is set for correctly for wget commands. - ----------------------------------------------------------------------------------------------- -2. Creating stand-lone self-extracting script to run tests on an already running Linux distro ----------------------------------------------------------------------------------------------- - -- Follow Step 1 -- This will also create a script: firmwarekit/initramfs/biostest.sh -- cd firmwarekit/initramfs -- Run 'sh biostest.sh' -- This will extract the image you created in Step 1, chroot into it, and run the tests (no shutdown or restart occurs) - -* Root user note: Running with 'root' privelages will provide best results Index: Documentation/HOWTO_RunStandalone.txt =================================================================== --- Documentation/HOWTO_RunStandalone.txt (.../release-0) (revision 0) +++ Documentation/HOWTO_RunStandalone.txt (.../release-1) (revision 136) @@ -0,0 +1,44 @@ +============================================ + Linux-ready firmware developer kit: + HOWTO RUN STANDALONE +============================================ + +CONTENTS +--------- + +1. Creating stand-lone self-extracting script to run tests on an already running Linux distro +2. Compile and run individual tests on running Linux distro + +---------------------------------------------------------------------------------------------- +1. Creating stand-lone self-extracting script to run tests on an already running Linux distro +---------------------------------------------------------------------------------------------- + +- # cd linuxfirmwarekit/ +- # make iso +- This will create a script: linuxfirmwarekit/initramfs/firmwarekit.sh +- # cd linuxfirmwarekit/initramfs +- # sh firmwarekit.sh; +- This will extract the iso image, chroot into it, and run the tests (no shutdown or restart +occurs) + + +------------------------------------------------------------ +2. Compile and run individual tests on running Linux distro +------------------------------------------------------------ + +- Each test is contained in its own dir (e.g. battery/ cpufreq/ fan/, etc.) +- Either run 'make' in root dir to compile all tests, or cd into the individual's + test dir and run 'make' +- The resulting binaries will be copied into the plugins/ dir +- Execute .exe, .sh or .pl. Preface with DEBUG=1 to output readable (non-hex) + output of tests. + e.g. # DEBUG=1 ./fan.exe +- ( note, make sure you can link with linuxfirmwarekit/libstandalone.so ) + + +* Root user note: Running with 'root' privileges will provide best results + + +Contributer: Rolla Selbak (rolla.n.selbak@intel.com) + + Index: Documentation/HOWTO_CreateISO.txt =================================================================== --- Documentation/HOWTO_CreateISO.txt (.../release-0) (revision 0) +++ Documentation/HOWTO_CreateISO.txt (.../release-1) (revision 136) @@ -0,0 +1,37 @@ +============================================ + Linux-ready firmware developer kit: + HOWTO CREATE ISO +============================================ + +CONTENTS +--------- + +1. Creating burnable ISO (bootable CD that automatically will run the tests) +2. Creating the ISO and copy it to your USB key + +----------------------------------------------------------------------------- +1. Creating burnable ISO (bootable CD that automatically will run the tests) +----------------------------------------------------------------------------- + +- cd linuxfirmwarekit/ +- Run 'make iso' +- This will create the burnable iso: linuxfirmwarekit/firmwarekit.iso + +-------------------------------------------------- +2. Creating the ISO and copy it to your USB key +-------------------------------------------------- + +- cd linuxfirmwarekit/ +- Run 'make usbiso' +- This will create the burnable iso: linuxfirmwarekit/firmwarekit.iso and copy it + to your USB key. + + + +* Root user note: Running with 'root' privileges will provide best results (especially for scripts such as linuxfirmwarekit/initramfs/dev.sh, etc.) + +* Proxy note: make sure your proxy is set correctly for wget commands. + + +Contributer: Rolla Selbak (rolla.n.selbak@intel.com) + Index: dmi/dmi.c =================================================================== --- dmi/dmi.c (.../release-0) (revision 0) +++ dmi/dmi.c (.../release-1) (revision 136) @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2006, Intel Corporation + * + * This file is part of the Linux-ready Firmware Developer Kit + * + * This program file is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation;version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in a file named COPYING; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + +/* + * This test checks if the dmi information has common bugs + */ + +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +char *full_dmi = NULL; + + +/* check_line() -- parses a line of dmidecode output for common errors. If + * it finds any, it calls report_result() to report. + * + * Parameters + * line - line of dmidecode output + * Returns + * nothing +*/ + +void check_line(char *line) +{ + if (strstr(line, "No SMBIOS nor DMI entry point found, sorry.")) + report_result("dmi", FAIL, "No SMBIOS nor DMI entry point found.", NULL, "dmi://"); + + if (strstr(line, "Wrong DMI structures count")) + report_result("dmi", FAIL, "Incorrect DMI structures count", line, "dmi://"); + + if (strstr(line, "Wrong DMI structures length:")) + report_result("dmi", FAIL, "Incorrect DMI structures length", line, "dmi://"); + + if (strstr(line, "")) + report_result("dmi", FAIL, "Out of spec value found", line, "dmi://"); + + if (strstr(line, "")) + report_result("dmi", FAIL, "Bad index value found", line, "dmi://"); + + if (strstr(line,"Bad checksum! Please report.")) + report_result("dmi", FAIL, "Incorrect checksum found", line, "dmi://"); + + if (strstr(line, "Serial Number:") && strstr(line,"0123456789")) + report_result("dmi", FAIL, "Template serial number not updated", line, "dmi://"); + + if (strstr(line, "Asset Tag") && strstr(line,"1234567890")) + report_result("dmi", FAIL, "Template Asset Tag not updated", line, "dmi://"); + + if (strstr(line, "UUID:") && strstr(line,"0A0A0A0A-0A0A-0A0A-0A0A-0A0A0A0A0A0A.")) + report_result("dmi", FAIL, "Template UUID number not updated", line, "dmi://"); + + if (strstr(line,"To Be Filled By O.E.M.")) + report_result("dmi", FAIL, "Template value not updated", line, "dmi://"); + + +} + +/* main() -- Checks DMI/SMBIOS tables for common errors by calling the + * 'dmidecode' command, then parsing through the output + * for common errors (by calling check_line()). + * + * Parameters + * argc & argv + * Returns + * EXIT_SUCCESS upon success of running this plugin + * EXIT_FAILURE upon failure of running this plugin +*/ + +int main(int argc, char **argv) +{ + FILE *file; + char *dmidecode_file = "/usr/sbin/dmidecode"; + struct stat buffer; + + start_test("dmi", "DMI information check", + "This test checks the DMI/SMBIOS tables for common errors."); + + /* Check if dmidecode command exists */ + if(stat(dmidecode_file, &buffer) != 0) { + + report_result("dmi", FAIL, "Cannot find dmidecode file", + dmidecode_file, NULL); + goto finish; + } + + /* Execute dmidecode command and obtain output stream */ + file = popen(dmidecode_file, "r"); + if (file == NULL) { + report_result("dmi", FAIL, "Error opening dmidecode command", + dmidecode_file, NULL); + goto finish; + } + + /* Parse through output for common errors */ + full_dmi = strdup("DMI information:\n"); + while (!feof(file)) { + char line[4096]; + memset(line, 0, 4096); + if (fgets(line, 4095, file)==NULL) + break; + + full_dmi = scatprintf(full_dmi, "%s", line); + check_line(line); + + } + pclose(file); + + /* Add to our resource list, passing all the lines of output*/ + announce_resource("dmi://", full_dmi, NULL); + +finish: finish_test("dmi"); + return EXIT_SUCCESS; +} + + + Index: dmi/Makefile =================================================================== --- dmi/Makefile (.../release-0) (revision 0) +++ dmi/Makefile (.../release-1) (revision 136) @@ -0,0 +1,27 @@ +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC +LDFLAGS = `pkg-config --libs glib-2.0` -L../ -lstandalone + + +all: dmi.exe + +dmi.exe: dmi.o .depend + gcc dmi.o $(LDFLAGS) -o dmi.exe + cp dmi.exe ../plugins + +clean: + rm -rf *~ *.o + rm -f dmi.so dmi.exe + + +# most of the makefile remains as it was before. +# at the bottom, we add these lines: + +# rule for building dependency lists, and writing them to a file +# named ".depend". +.depend: + rm -f .depend + gccmakedep -f- -- $(CFLAGS) -- *.c > .depend + +# now add a line to include the dependency list. +include .depend + Index: battery/battery.c =================================================================== --- battery/battery.c (.../release-0) (revision 136) +++ battery/battery.c (.../release-1) (revision 136) @@ -196,7 +196,7 @@ } -int main(int __unused argc, char __unused **argv) +int main(int argc, char **argv) { DIR *dir; struct dirent *entry; Index: battery/Makefile =================================================================== --- battery/Makefile (.../release-0) (revision 136) +++ battery/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I../ +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I../ LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f battery.so battery.exe - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +24,3 @@ # now add a line to include the dependency list. include .depend - Index: firmwarekit.h =================================================================== --- firmwarekit.h (.../release-0) (revision 136) +++ firmwarekit.h (.../release-1) (revision 136) @@ -26,9 +26,6 @@ #include -#define __unused __attribute__((__unused__)) - - #define PASS 0 #define INFO 1 Index: NEWS =================================================================== --- NEWS (.../release-0) (revision 0) +++ NEWS (.../release-1) (revision 136) @@ -0,0 +1,167 @@ +The Linux-ready Firmware Developer Kit team is pleased to announce the +release R1 of the kit. In this release many bugs have been fixed and several +key enhancements have been done to help the ease of use of the kit, and +several new tests have been added. + +The Linux-ready Firmware Developer Kit is a tool to test how well Linux +works together with the firmware (BIOS or EFI) of your machine, and is +designed for use by both firmware development teams and Linux kernel +hackers to prevent and diagnose firmware bugs. + +Summary +======= + +Enhancements +* Inclusion of the Linux 2.6.19 kernel for the latest hardware support +* Include several Linux distribution kernels for testing +* Many bugfixes +* The Serial-console mode now detects speed automatically +* Prototype IA64 support +* Automatic mode + +New Tests +========= +* Suspend-Resume +* basic HPET test +* P-state coordination +* Thermal Trip Points +* 32/64 FADT test +* SSDT AML test +* Microcode version test +* DMI table test +* VMX enabled test +* OS/2 gap test +* APIC edge/level test +* PCI Express maxreadreq test +* _SUN test + + +You can download this latest release of the kit from + + http://www.linuxfirmwarekit.org + + +The Linux-ready Firmware Developer Kit team + Jacob Pan + Rolla Selbak + Arjan van de Ven + + + + + +Changes in R1 of the Linux-ready Firmware Developer Kit +------------------------------------------------------- + +Features +-------- +Linux distribution kernels + Several people have asked us to make it easy to also test vendor + kernels with the BIOS, and not just the vanilla kernel.org kernel. + The standard ISO image contains 3 such kernels now, and the build + system allows adding your own very easily. + +General improvements +-------------------- +Infrastructure + The mini-OS on the CD has been upgraded to the Fedora Core 6 rpms. + This allows us to leverage the suspend/resume infrastructure in FC6. +Kernel + The kernel on the CD image has been updated to version 2.6.19 +Serial console + Thomas Renninger from Novell/SuSE contributed code that detects the + selected serial console speed automatically, rather than using a + fixed speed as R0 did. +Prototype IA64 support + The firmware kit runs on IA64 now; however no ISO image is available + yet. +Automatic mode + The firmware kit can now run in "auto pilot" mode, where the entire + kit is non-interactive and just saves the results before exiting. +Build system + The build process has been changed to link against the libraries + that will be on the final CD image, rather than the ones on the + system. This should make the build process a lot more portable + than it was in R0. + +New tests +--------- +Suspend-Resume + This manual test allows you to test if Suspend (to ram), and + more importantly, Resume works on the machine + +basic HPET test + This test verifies if the kernel detects the HPET component of + the chipset properly. Firmware writers are strongly encouraged + to default-enable HPET to allow Linux to do fast and accurate + timekeeping. + +P-state coordination + Current dual core processors have a behavior that the effective + frequency of both cores in a package is the maximum of the set + frequencies of the cores. This is called "Hardware coordination". + However some firmware does not get this right and uses "software + coordination" where both cores run at the speed that was programmed + into either of the cores. + +Thermal Trip Points + Frank Seidel from Novell/SuSE has contributed a test for the thermal + trip points in a system. + +32/64 FADT test + The FADT ACPI table is sometimes available in a 32 bit and a 64 bit + version. This test verifies that the common fields in these tables + are identical; they need to be since they describe the same properties. + +SSDT AML test + In addition to the DSDT, some firmware has SSDT tables which are + supplemental AML tables to the DSDT. The firmware kit now performs + the same checks on the SSDT tables as it does on the DSDT. + +Microcode version test + Intel CPUs have a feature called "microcode update", which makes it + possible to field update some non-performance critical behaviors of + the processor. The firmware is responsible to load a recent enough + version of this microcode into the processor; this test checks if + a more recent version exists. + +DMI table test + The DMI table is used by Linux in several places, for example for + model specific workarounds. This test checks the DMI table against + a set of common mistakes, such as out-of-range values and reference + values that are copied but not adjusted from a reference + implementation. + +VMX enabled test + Some firmware disables the VMX Virtualization extensions entirely; + this is unfortunate since Xen and KVM cannot use these extensions on + the machine. This test checks for this. + +OS/2 gap test + For old versions of the OS/2* operating system, the firmware needed + to leave a gap in memory between 15Mb and 16Mb. However this gap + breaks various bootloaders that are used by Linux distributions, + and should never be enabled by default. + +APIC edge/level test + When using apics, the legacy interrupts on a system should be + edge-triggered, while non-legacy interrupts should be level-triggered. + If this is not done correctly, interrupts get either lost or cause + an interrupt storm, both can hang the Linux kernel. + +PCI Express maxreadreq test + PCI Express cards have a tunable buffer size with a default size of + 128. The firmware is responsible for programming this buffer size to + a higher value during POST for optimal performance. This test + verifies that all PCI Express cards in a system have a higher tuned + setting. This test was suggested by Roland Dreier from Cisco after + a major Infiniband performance issue was diagnosed to be a non-tuned + maxreadreq. + +_SUN test + PCI slots may have numbers (this is needed to tell the user "the + card in slot 4 can now be hot-unplugged safely). Some firmware + has assigned duplicate numbers to some slots, and this prevents + PCI/PCI-E hotplug from working reliably. + + Index: Makefile =================================================================== --- Makefile (.../release-0) (revision 136) +++ Makefile (.../release-1) (revision 136) @@ -1,15 +1,19 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -g -I/usr/include/slang -fPIC -I. -LDFLAGS = -ldl -export-dynamic `pkg-config --libs glib-2.0` -lnewt +CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 -g +override CFLAGS += `pkg-config --cflags glib-2.0` -I/usr/include/slang -fPIC -I. +#LDFLAGS = -nodefaultlibs -Linitramfs/data/lib -Linitramfs/data/usr/lib -export-dynamic -lc -ldl `pkg-config --libs glib-2.0` -lnewt -lslang +LDFLAGS = -nostdlibs -Linitramfs/data/lib -Linitramfs/data/usr/lib -export-dynamic -lc -ldl `pkg-config --libs glib-2.0` -lnewt -lslang -SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery cstates msrpoke pcipoke usbports tonetest bashshell mcfg lmbench mtrr shelltools shelltests amlpoke fan fadt +SUBDIRS = acpiinfo pciresource acpicompile cpufreq ethernet edd battery msrpoke pcipoke usbports tonetest bashshell mcfg lmbench mtrr shelltools shelltests fan fadt chk_hpet suspend thermal_trip microcode dmi os2gap apicedge maxreadreq virt LIBS = dmesg.o main.o tests.o plugins.o ui.o uri.o dumpxml.o usb.o serial.o lib.o acpitable.o e820.o - - - all: libstandalone.so biostest subdirs +# if arch is i*86 (i386, i686, etc.) +ifeq ($(shell uname -m | cut -c1,3,4), i86) +LIBC = initramfs/data/usr/lib/libc.so +endif + .PHONY: subdirs $(SUBDIRS) subdirs: $(SUBDIRS) @@ -19,9 +23,12 @@ cd shelltests ; make install cd initramfs/kernel ; make -biostest: $(LIBS) biostest.h .depend +biostest: $(LIBS) biostest.h .depend $(LIBC) gcc $(LIBS) $(LDFLAGS) -o biostest - + +initramfs/data/usr/lib/libc.so: + cd initramfs ; sh create_initramfs.sh + libstandalone.so: $(LIBS) biostest.h .depend libstandalone.o gcc --shared libstandalone.o lib.o -o libstandalone.so @@ -35,28 +42,18 @@ rm -f resources.xml rm -f dsdt.dsl rm -f dsdt.asl - rm -f dsdt.dat + rm -f DSDT.dat rm -f DSDT.aml rm -f initramfs/rpms/pci.ids + rm -f initramfs/rpms/kernels rm -rf *~ *.o .depend */.depend - + install: all mkdir results || : cp -a biostest results plugins initramfs/data/root/ cp -a libstandalone.so initramfs/data/usr/lib cd shelltools ; make DESTDIR=../initramfs/data install -rsync: install - rsync -raz -e ssh initramfs/data root@expressive: - -expressive: all - mkdir results || : - cd initramfs ; sh create_initramfs.sh - cp -a biostest results plugins initramfs/data/root/ - cp -a libstandalone.so initramfs/data/usr/lib - cd shelltools ; make DESTDIR=../initramfs/data install - rsync -raz -e ssh initramfs/data root@expressive: - iso: all cd initramfs ; sh create_initramfs.sh mkdir results || : @@ -64,7 +61,7 @@ cp -a libstandalone.so initramfs/data/usr/lib cd shelltools ; make DESTDIR=../initramfs/data install cd initramfs ; sh makeisos.sh - + usbiso: iso mount /media/usbdisk cp firmwarekit.iso /media/usbdisk @@ -73,9 +70,7 @@ cp initramfs/cdimage/isolinux/initrd.img /media/usbdisk cp firmwarekit-source.iso /media/usbdisk umount /media/usbdisk - - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -87,5 +82,3 @@ # now add a line to include the dependency list. include .depend - - Index: fadt/fadt.c =================================================================== --- fadt/fadt.c (.../release-0) (revision 136) +++ fadt/fadt.c (.../release-1) (revision 136) @@ -45,6 +45,71 @@ #include "fadt.h" #include +#define CHECK_FIELD(field) \ + if (table32->field != table64->field) { \ + sprintf(line, "FADT field " #field " has value %x in the 32 bit table and value %x in the 64 bit table.", table32->field, table64->field); \ + report_result("FADT", WARN, "FADT field " #field " has different 32/64 bit values", line, NULL); \ + } + +void compare_32_and_64_fadt(void) +{ + struct fadt_descriptor *table32, *table64; + unsigned long address; + unsigned long size; + char *table_ptr; + char line[4096]; + + if (locate_acpi_table32("FACP", &address, &size)) + return; + if (address == 0 || address == -1) + return; + table_ptr = copy_acpi_table(address, "FACP"); + table32 = (struct fadt_descriptor *) table_ptr; + if (locate_acpi_table64("FACP", &address, &size)) + return; + if (address == 0 || address == -1) + return; + table_ptr = copy_acpi_table(address, "FACP"); + table64 = (struct fadt_descriptor *) table_ptr; + + CHECK_FIELD(V1_firmware_ctrl); + CHECK_FIELD(V1_dsdt); + CHECK_FIELD(prefer_PM_profile); + CHECK_FIELD(sci_int); + CHECK_FIELD(smi_cmd); + CHECK_FIELD(acpi_enable); + CHECK_FIELD(acpi_disable); + CHECK_FIELD(S4bios_req); + CHECK_FIELD(pstate_cnt); + CHECK_FIELD(V1_pm1a_evt_blk); + CHECK_FIELD(V1_pm1b_evt_blk); + CHECK_FIELD(V1_pm1a_cnt_blk); + CHECK_FIELD(V1_pm1b_cnt_blk); + CHECK_FIELD(V1_pm2_cnt_blk); + CHECK_FIELD(V1_pm_tmr_blk); + CHECK_FIELD(V1_gpe0_blk); + CHECK_FIELD(V1_gpe1_blk); + CHECK_FIELD(pm1_evt_len); + CHECK_FIELD(pm1_cnt_len); + CHECK_FIELD(pm2_cnt_len); + CHECK_FIELD(pm_tm_len); + CHECK_FIELD(gpe0_blk_len); + CHECK_FIELD(gpe1_blk_len); + CHECK_FIELD(gpe1_base); + CHECK_FIELD(cst_cnt); + CHECK_FIELD(plvl2_lat); + CHECK_FIELD(plvl3_lat); + CHECK_FIELD(flush_size); + CHECK_FIELD(flush_stride); + CHECK_FIELD(duty_offset); + CHECK_FIELD(duty_width); + CHECK_FIELD(day_alrm); + CHECK_FIELD(mon_alrm); + CHECK_FIELD(century); + CHECK_FIELD(iapc_boot_arch); + +} + void do_manual_fadt_test(void) { unsigned long address; @@ -102,10 +167,13 @@ report_result("FADT", FAIL, "Invalid register bit width", line, NULL); } if (value & 0x1) /*SCI_EN bit*/ - report_result("FADT", PASS, "ACPI mode, SCI_EN bit in PM1a_Control register is enabled",NULL,NULL); + report_result("FADT", PASS, "ACPI mode, SCI_EN bit in PM1a_Control register is correctly enabled",NULL,NULL); else - report_result("FADT", FAIL, "Legacy mode, SCI_EN bit in PM1a_Control register is Disabled",NULL,NULL); + report_result("FADT", FAIL, "Legacy mode, SCI_EN bit in PM1a_Control register is incorrectly Disabled",NULL,NULL); } + + + compare_32_and_64_fadt(); out: finish_test("FADT"); } Index: fadt/Makefile =================================================================== --- fadt/Makefile (.../release-0) (revision 136) +++ fadt/Makefile (.../release-1) (revision 136) @@ -1,18 +1,17 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC LDFLAGS = `pkg-config --libs glib-2.0` all: fadt.so fadt.so: fadt.o .depend - gcc --shared fadt.o $(LDFLAGS) -o fadt.so -lnewt + gcc --shared fadt.o $(LDFLAGS) -o fadt.so cp fadt.so ../plugins clean: rm -rf *~ *.o rm -f fadt.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +24,3 @@ # now add a line to include the dependency list. include .depend - Index: ethernet/ethernet.c =================================================================== --- ethernet/ethernet.c (.../release-0) (revision 136) +++ ethernet/ethernet.c (.../release-1) (revision 136) @@ -37,11 +37,16 @@ #include #include +#include /* debian has a broken /usr/include/linux/ethtool.h that uses kernel types not userspace safe types */ +#define u64 __u64 #define u32 __u32 +#define u16 __u16 #define u8 __u8 #include +#undef u64 #undef u32 +#undef u16 #undef u8 #include @@ -157,17 +162,19 @@ get_dhcp_lease(iface); } -static void check_line(gpointer data, gpointer __unused user_data) +static void check_line(gpointer data, gpointer user_data) { char *line = (char *)data; if (strstr(line, "The EEPROM Checksum Is Not Valid") && strstr(line,"e1000")) report_result("ethernet", FAIL, "E1000 EEPROM checksum is invalid, NIC unusable", line, NULL); + if (strstr(line, "e100_eeprom_load: EEPROM corrupted") && strstr(line,"e1000")) + report_result("ethernet", FAIL, "E100 EEPROM checksum is invalid, NIC unusable", line, NULL); } -int main(int __unused argc, char __unused **argv) +int main(int argc, char **argv) { FILE *file; char line[4096]; Index: ethernet/Makefile =================================================================== --- ethernet/Makefile (.../release-0) (revision 136) +++ ethernet/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f ethernet.so ethernet.exe - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: dmesg.c =================================================================== --- dmesg.c (.../release-0) (revision 136) +++ dmesg.c (.../release-1) (revision 136) @@ -37,7 +37,7 @@ extern char *current_test; /* boot time dmesg checks to extract useful info from it that is exported to all tests */ -static void check_this_line(gpointer data, gpointer __unused user_data) +static void check_this_line(gpointer data, gpointer user_data) { char *line = (char *)data; @@ -67,9 +67,7 @@ } } - - - +/* obtains dmesg, cleans it up, and adds it to our resource list */ void get_dmesg_buffer(void) { char *dmesg; @@ -86,26 +84,41 @@ memset(dmesg, 0, DMESG_SIZE); klogctl (4, dmesg, DMESG_SIZE); + /* Add to our resource list that we keep. The user + * will have access to this when they look at the + * test results and info, + * see uri.c for implementation */ announce_resource("dmesg://", dmesg, NULL); c1 = dmesg; while (c1) { + /* get next line from dmesg before '\n' + * and put into 'c1' */ c2 = strchr(c1, '\n'); + + /* break if we're at the end of dmesg */ if (c2==NULL) break; + + /* take out extra \n from beginning */ *c2 = 0; c2++; + /* skip the <4> that is in front of each line */ if (strlen(c1)>3 && c1[0]=='<') c1+=3; + /* now append the cleaned-up line to boot_dmesg */ boot_dmesg = g_list_append(boot_dmesg, strdup(c1)); linecount ++; - + + /* put what's left of dmesg back into c1 */ c1 = c2; } + /* send boot_dmesg off to extract useful info */ g_list_foreach(boot_dmesg, check_this_line, NULL); + free(dmesg); e820_register_resource(); @@ -156,6 +169,14 @@ if (strstr(line, "Wrong _BBN value, reboot and use option 'pci=noacpi'")) report_result(NULL, FAIL, "The BIOS has wrong _BBN value, " "which will make PCI root bridge have wrong bus number", line, dmesg_uri); + + if (strstr(line,"ACPI: lapic on CPU ") && strstr(line, " stops in C2[C2]")) + report_result(NULL, FAIL, "The local apic timer incorrectly stops during C2 idle state", + "The local apic timer incorrectly stops during C2 idle state. \n" + "The ACPI specification forbids this and Linux needs the local \n" + "apic timer to work. The most likely cause of this is that the \n" + "firmware uses a hardware C3 or C4 state that is mapped to \n" + "the ACPI C2 state.", dmesg_uri); if (strstr(line, "Invalid _PCT data")!=NULL) { char uri[4096]; Index: suspend/suspend.c =================================================================== --- suspend/suspend.c (.../release-0) (revision 136) +++ suspend/suspend.c (.../release-1) (revision 136) @@ -34,7 +34,7 @@ start_test("suspend", "Suspend/resume testing", "This test checks if suspend-to-ram works"); - +/* file = fopen("/sys/power/state", "w"); if (!file) { report_result("suspend", FAIL, "S3 not supported", NULL, NULL); @@ -42,7 +42,8 @@ } fprintf(file, "mem"); fclose(file); - +*/ + system("/usr/sbin/pm-suspend"); finish_test("suspend"); } Index: suspend/Makefile =================================================================== --- suspend/Makefile (.../release-0) (revision 136) +++ suspend/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -g -I.. LDFLAGS = `pkg-config --libs glib-2.0` @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f suspend.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +24,3 @@ # now add a line to include the dependency list. include .depend - Index: pciresource/pciresource.c =================================================================== --- pciresource/pciresource.c (.../release-0) (revision 136) +++ pciresource/pciresource.c (.../release-1) (revision 136) @@ -124,7 +124,7 @@ report_result("pciresource", FAIL, summary, line, uri); } -static void check_line(gpointer data, gpointer __unused user_data) +static void check_line(gpointer data, gpointer user_data) { char *line = (char *)data; @@ -133,7 +133,7 @@ if (strstr(line, "PCI: Cannot allocate resource region")!=NULL) process_alloc_failure(line); if (strstr(line, "hpet_resources:") && strstr(line,"is busy")) - report_result("pciresources", FAIL, "HPET resources incorrect", line, NULL); + report_result("pciresource", FAIL, "HPET resources incorrect", line, NULL); if (strstr(line, "PCI: Unable to reserve mem region") && strstr(line,"for device")) process_unable_reserve(line); @@ -236,7 +236,8 @@ check_resource_size_against_db(); find_overlapping_resources(); + gather_pci_info(); + finish_test("pciresource"); - gather_pci_info(); } Index: pciresource/Makefile =================================================================== --- pciresource/Makefile (.../release-0) (revision 136) +++ pciresource/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC LDFLAGS = `pkg-config --libs glib-2.0` @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f pciresource.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +24,3 @@ # now add a line to include the dependency list. include .depend - Index: tests.c =================================================================== --- tests.c (.../release-0) (revision 136) +++ tests.c (.../release-1) (revision 136) @@ -37,16 +37,17 @@ char *current_test; +/* find a test in 'all_tests' list, return the test if found, + * and NULL if not. */ struct major_test *find_test(char *testID) { struct major_test *test; GList *list; - if (testID==NULL) + if (testID==NULL) { testID = current_test; - - if (testID==NULL) return NULL; + } list = g_list_first(all_tests); while (list) { @@ -58,13 +59,14 @@ return NULL; } - +/* after the plugin file is executed, 'start_test' is called + * if we're at the beginning of analysing the plugin's output. */ void start_test(char *testID, char *name, char *description) { struct major_test *test; struct detailed_result *res; - /* first check if we're reregistering a test */ + /* first check if we're re-registering a test */ test = find_test(testID); if (test) { /* yes we are: must be interactive, lets not do any ui things */ @@ -77,6 +79,7 @@ memset(test, 0, sizeof(struct major_test)); + /* copy info of current test into 'test' */ if (testID==NULL) { testID=""; } @@ -85,6 +88,7 @@ current_test = test->ID; + /* add this test to the list of all_tests tested so far */ all_tests = g_list_append(all_tests, test); /* if all non-interactive tests have finished, there isn't a central UI anymore */ @@ -99,6 +103,7 @@ res->details = strdup(description); test->description = res; } + } Index: mtrr/mtrr.c =================================================================== --- mtrr/mtrr.c (.../release-0) (revision 136) +++ mtrr/mtrr.c (.../release-1) (revision 136) @@ -153,7 +153,7 @@ while (list) { entry = (struct mtrr_entry*)list->data; - if (entry->end > end && entry->start < end) { + if (entry->end >= end && entry->start < end) { end = entry->start; if (end +#include +#include +#include +#include +#include +#include +#include +#include +#include "../biostest.h" + +#include +#include +#include +#include +#include + +#include +#define HPET_REG_SIZE (0x400) +#define MAX_CLK_PERIOD (100000000) +#define VENDOR_ID_INTEL (0x8086) +extern GList *boot_dmesg; +extern void load_boot_dmesg_buffer(); +static uint64_t hpet_base_p = 0; +static void *hpet_base_v = 0; + +typedef enum { + DMESG_BASE = 1, + DSDT_BASE +} HPET_STATUS; +static GList *dsdt_dsl; +static void get_dsdt_dsl() +{ + char line_buf[4096]; + FILE *file; + memset(line_buf, 0, 4096); + file = fopen("DSDT.dsl", "r"); + if (!file) { + fprintf(stderr, "ERR: failed to open DSDT.dsl\n"); + return; + } + while (!feof(file)) { + if (fgets(line_buf, 4095, file) == NULL) + break; + dsdt_dsl = g_list_append(dsdt_dsl, strdup(line_buf)); + } + fclose(file); +/* read value from dsdt.dsl */ +} + +static void check_hpet_base_dsdt(gpointer data, + gpointer user_data) +{ + char *line = (char *) data; + char *val, *idx; + static int hpet_found = 0; + if (!hpet_found) { + val = strstr(line, "Device (HPET)"); + if (val != NULL) { + hpet_found = 1; + } + } else { + /* HPET section is found, looking for base */ + val = strstr(line, "0x"); + if (val != NULL) { + idx = index(val, ','); + if (idx) + *idx = '\0'; + if ((hpet_base_p != 0) && + (hpet_base_p != + (uint64_t) strtoul(val, NULL, 0x10))) { + char details[4096]; + sprintf(details, "Mismatched HPET base between DSDT (%lx) and the kernel %lx)", + (unsigned long)hpet_base_p, (unsigned long)strtoul(val, NULL, 0x10)); + report_result("chk_hpet", FAIL, + "Mismatched HPET base between DSDT and the kernel", + details, NULL); + return; + } + hpet_base_p = strtoul(val, NULL, 0x10); +// fprintf(stderr, "DSDT HPET base = 0x%08X\n", +// (unsigned int) hpet_base_p); + hpet_found = 0; + } + } +} + +static void check_hpet_base(gpointer data, gpointer user_data) +{ + char *line = (char *) data; + char *val, *c; + if ((val = strstr(line, "ACPI: HPET id:")) != NULL) { + c= strstr(line, "base: "); + if (c) + hpet_base_p = strtoul(c+6, NULL, 0x10); +// fprintf(stderr, "HPET base = 0x%08X\n", +// (unsigned int) hpet_base_p); + *(unsigned int *) user_data = DMESG_BASE; + return; + } +} + +static void hpet_check_ids() +{ + unsigned long long hpet_id; + unsigned long clk_period; + hpet_id = *(unsigned long long *) hpet_base_v; + if (((hpet_id & 0xffff0000) >> 16) != VENDOR_ID_INTEL) { + report_result("chk_hpet", FAIL, + "Invalid VID, at HPET register base", NULL, + NULL); + return; + } + clk_period = hpet_id >> 32; + if ((clk_period > MAX_CLK_PERIOD) || (clk_period == 0)) { + char buffer[4096]; + sprintf(buffer, "Invalid clock period %li, must be non-zero and less than 10^8 fs", clk_period); + report_result("chk_hpet", WARN, buffer, NULL, NULL); + return; + } + hpet_id = *(unsigned long long *) (hpet_base_v + 0x10); +} + +int main(int argc, char ** argv) +{ + int fd, ret; + int hpet_status; + char uri[1024]; + + start_test("chk_hpet", "HPET configuration test", + "This test checks the HPET PCI BAR for each timer block in the timer." + "The base address is passed by the firmware via an ACPI table." + "IRQ routing and initialization is also verified by the test.\n"); + ret = EXIT_SUCCESS; + if (access("DSDT.dat", R_OK)) + ret = system("cat /proc/acpi/dsdt > DSDT.dat"); + if (ret != EXIT_SUCCESS) + return ret; + ret = system("plugins/iasl -d DSDT.dat &>/dev/null"); + if (ret) + printf("iasl returns %i \n", ret); + report_testrun_progress(30); + + memset(uri, 0, 1024); + load_boot_dmesg_buffer(); + + if (boot_dmesg != NULL) + g_list_foreach(boot_dmesg, check_hpet_base, &hpet_status); + else + fprintf(stderr, "ERR: no boot_dmesg list \n"); + if (hpet_status == DMESG_BASE) { + report_result("chk_hpet", WARN, + "HPET driver in the kernel is enabled, inaccurate results follow.", NULL, NULL); + }; + get_dsdt_dsl(); + if (dsdt_dsl != NULL) + g_list_foreach(dsdt_dsl, check_hpet_base_dsdt, + &hpet_status); + if (!hpet_base_p) { + report_result("chk_hpet", FAIL, + "Failed to locate HPET base", "The firmware AML code doesn't advertize the HPET base.\n" + "HPET might be disabled in the bios settings, or not supported by the platform.", NULL); + finish_test("chk_hpet"); + return 0; + } + fd = open("/dev/mem", O_RDONLY); + if (fd <= 0) { + fprintf(stderr, "ERR: Failed to open /dev/mem\n"); + return 0; + } + hpet_base_v = + mmap(NULL, HPET_REG_SIZE, PROT_READ, MAP_SHARED, fd, + hpet_base_p); + hpet_check_ids(); + finish_test("chk_hpet"); + return 0; +} Index: chk_hpet/Makefile =================================================================== --- chk_hpet/Makefile (.../release-0) (revision 0) +++ chk_hpet/Makefile (.../release-1) (revision 136) @@ -0,0 +1,25 @@ +override CFLAGS += -I.. -fPIC `pkg-config --cflags glib-2.0` +LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone -lm + + +all: chk_hpet.exe + +chk_hpet.exe: chk_hpet.o .depend + gcc chk_hpet.o $(LDFLAGS) -o chk_hpet.exe + cp chk_hpet.exe ../plugins + +clean: + rm -rf *~ *.o + rm -f chk_hpet.exe + +# most of the makefile remains as it was before. +# at the bottom, we add these lines: + +# rule for building dependency lists, and writing them to a file +# named ".depend". +.depend: + rm -f .depend + gccmakedep -f- -- $(CFLAGS) -- *.c > .depend + +# now add a line to include the dependency list. +include .depend Index: acpicompile/acpicompile.c =================================================================== --- acpicompile/acpicompile.c (.../release-0) (revision 136) +++ acpicompile/acpicompile.c (.../release-1) (revision 136) @@ -34,16 +34,31 @@ struct dsdt_line { - char *line; - char *locator; - char *untranslated; - int lineno; + char *line; /* actual line in dsdt */ + char *locator; /* parsed and cleaned locator (e.g. \GPE._L01) */ + char *untranslated; /* non-parsed locator (e.g. @\_GPE{_L01) */ + int lineno; /* line # in dsdt */ }; -static GList *dsdt; -static int dsdt_size = 4; +struct SUN_line { + char SUN_hexnum[5]; /* _SUN hex id (e.g. 0x01) */ + int line_num; /* line # in dsdt where Name (_SUN,...) occurs */ +}; +#define SCOPE 1 +#define DEVICE 2 +#define METHOD 3 +#define NAME_SUN 4 + +#define MAX_SSDTS 11 +static GList *ssdt[MAX_SSDTS]; +static int ssdt_size[MAX_SSDTS] = {4,4,4,4,4,4,4,4,4,4,4}; +int current_ssdt; + +struct SUN_line SUN_list[64]; + +/* push () -- adds a '{' to locator string */ static void push(char *s) { if (strlen(s)>8000) { @@ -53,6 +68,7 @@ strcat(s, "{"); } +/* push_name() -- adds label name to locator string */ static void push_name(char *s, char *name) { if (strlen(s)+strlen(name)>8000) { @@ -62,6 +78,9 @@ strcat(s,name); } +/* push_name_scope() -- adds '@' . 'scope name' + * to locator string (using @ to diff between scope + * and label like Method, Device, etc.) */ static void push_name_scope(char *s, char *name) { if (strlen(s)+strlen(name)>8000) { @@ -72,6 +91,7 @@ strcat(s,name); } +/* pop () - chops chars until we reach a '{' */ static void pop(char *s) { if (strlen(s)<1) @@ -83,7 +103,9 @@ chop_lastchar(s); } - +/* translate_locator() -- parses the locator and cleans it up to + * produce the actual AML path. (e.g. @\GPE{_L01 becomes + * \GPE.L01) */ static void translate_locator(char *locator, char *target) { char *c; @@ -125,11 +147,187 @@ } } +/* parses an iasl output line, returns the line no. that + * the error or warning is referencing */ +static int get_line_nr(char *line) +{ + char *c; + if (strlen(line)<10) + return 0; + c = strchr(line, '('); + if (c) + return strtoul(c+1, NULL, 10); + else + return 0; +} + +/* find a certain line in the given dsdt table + * that we represented in the linked-list (ssdt) */ +static struct dsdt_line *find_line(int nr) { + GList *list; + struct dsdt_line *line; + + list = g_list_first(ssdt[current_ssdt]); + while (list) { + line = (struct dsdt_line*) list->data; + + if (line->lineno == nr) + return line; + list = g_list_next(list); + } + return NULL; +} + +/* do_SUN_check() -- check for duplicate hard-coded _SUNs + * + * Parameters + * void + * Returns + * void +*/ +void do_SUN_check() { + + struct SUN_hash { + char SUN_id[5]; /* SUN hex id (e.g. 0x01) */ + int SUN_list_linenums[64]; /* array of line #s that use this SUN id */ + int list_ptr; /* ptr for SUN_list_linenums to track + how many line #s exist that use this _SUN */ + } SUN_hash_list[64]; /* hash table indexed by a _SUN id that holds + how many AML Name functions use a certain + _SUN id */ + + int testres = PASS; + int i=0; + int hash_ptr=0; + + /* Add our first table entry */ + strcpy(SUN_hash_list[0].SUN_id, SUN_list[0].SUN_hexnum); + SUN_hash_list[0].SUN_list_linenums[0] = SUN_list[0].line_num; + SUN_hash_list[0].list_ptr = 1; + i++; + + /* go through our list of Name (_SUN,..) calls and identify + * any duplicates (this list was compiled in parse_dsdt() + * with add_SUN_name() and is contained in SUN_list[]) */ + while(SUN_list[i].line_num) { + int j = 0; + int k = 0; + int dup = 0; + + /* Compare this _SUN with our hash table, see if we have dups */ + for(k = hash_ptr;k>-1;k--) { + /* We have a dup., add to correct hash index */ + if(strcmp(SUN_list[i].SUN_hexnum, SUN_hash_list[j].SUN_id) == 0) { + int cur_ptr = SUN_hash_list[j].list_ptr; + + strcpy(SUN_hash_list[j].SUN_id, SUN_list[i].SUN_hexnum); + SUN_hash_list[j].SUN_list_linenums[cur_ptr] = SUN_list[i].line_num; + SUN_hash_list[j].list_ptr++; + + dup = 1; + break; + } + j++; + } + + /* No dup., create new hash index */ + if(dup == 0) { + hash_ptr++; + strcpy(SUN_hash_list[hash_ptr].SUN_id, SUN_list[i].SUN_hexnum); + SUN_hash_list[hash_ptr].SUN_list_linenums[0] = SUN_list[i].line_num; + SUN_hash_list[hash_ptr].list_ptr++; + } + + + i++; + } + + /* Now go through our hash table and report a warning for every + * duplicate we've encountered */ + i=0; + while(SUN_hash_list[i].list_ptr) { + int j; + char reportmsg[4096]; + char *details; + struct dsdt_line *ds; + + if(SUN_hash_list[i].list_ptr > 1) { + + testres = WARN; + sprintf(reportmsg,"Duplicate hardcoded _SUN \'%s\' found at:", + SUN_hash_list[i].SUN_id); + details = strdup(""); + details = scatprintf(details,"%s",reportmsg); + + for(j=0;j < SUN_hash_list[i].list_ptr;j++) { + + ds = find_line(SUN_hash_list[i].SUN_list_linenums[j]); + details = scatprintf(details,"\n\nAt %s",ds->locator); + details = scatprintf(details,">>> %s", ds->line); + + } + + report_result("acpicompile", testres, reportmsg, details, NULL); + } + i++; + } + + if(testres == PASS) { + report_result("acpicompile", testres, + "Tested _SUN ids; successfully found no duplicates", NULL, NULL); + } +} + +/* add_SUN_name() -- Add a _SUN Name occurance to our list + * (i.e. Name (_SUN, 0x..)) + * + * Parameters + * line - name of table to compile with iasl (usually dsdt.dsl) + * current_SUN - current index for SUN_list[] + * line_no - line # in dsdt where this occurs + * Returns + * void +*/ +void add_SUN_name(char *line, int current_SUN, int line_no) { + + /* Skip , and ' ' until we have the + * the beginning of a hex num (0x..), then + * chop the newline and last chars until we reach ')' + * to get the pure hex num */ + while(*line != '0') + line++; + + chop_newline(line); + + while(line[strlen(line) -1] != ')') + chop_lastchar(line); + chop_lastchar(line); + + /* add to our _SUN list */ + SUN_list[current_SUN].line_num = line_no; + strcpy(SUN_list[current_SUN].SUN_hexnum, line); +} + +/* parse_dsdt () -- parses dsdt.dsl file. Saves the info of each line as + * a list of struct* dsdt_line. + * This makes it easy later on when we recompile the + * DSDT with iasl to identify which line the + * warnings/errors are, and which methods/ + * devices/scope they're located in. + * + * + * Parameters + * filename - usually dsdt.dsl file to parse + * Returns + * void +*/ + static void parse_dsdt(char *filename) { FILE *file; char line[4096]; int lineno = 0; + int current_SUN = 0; char locator[8192]; char translated[8192]; @@ -138,14 +336,18 @@ file = fopen(filename, "r"); if (file==NULL) { - printf("Failed to open DSDT file %s \n", filename); + printf("Failed to open file %s \n", filename); return; } + + /* Parse through dsdt.dsl */ while (!feof(file)) { char *c; + char name[256]; struct dsdt_line *ds; int label = 0; + memset(name, 0, 256); memset(line, 0, 4096); if (fgets(line, 4095, file)==NULL) break; @@ -157,12 +359,12 @@ ds->line = strdup(line); ds->lineno = lineno; + /* We hit a Device label */ c = strstr(line, "Device ("); if (c) { - char name[256]; - memset(name, 0, 256); - label = 1; + /* get the name of the device */ + label = DEVICE; c+=8; while (*c) { if (*c!=')' && *c!=',') @@ -173,12 +375,11 @@ } push_name(&locator[0], name); } + /* We hit a Method label */ c = strstr(line, "Method ("); if (c) { - char name[256]; - memset(name, 0, 256); - label = 1; + label = METHOD; c+=8; while (*c) { if (*c!=')' && *c!=',') @@ -189,13 +390,33 @@ } push_name(&locator[0], name); } + + /* We hit a Name label (looking for _SUN) */ + c = strstr(line, "Name ("); + if (c) { + c+=6; + while (*c) { + if (*c!=')' && *c!=',') + name[strlen(name)]=*c; + else + break; + c++; + } + + if(strcmp(name, "_SUN") == 0) { + label = NAME_SUN; + push_name(&locator[0], name); + add_SUN_name(&c[0], current_SUN, lineno); + current_SUN++; + } + } + + /* We hit a Scope label */ c = strstr(line, "Scope ("); if (c) { - char name[256]; - memset(name, 0, 256); - label = 1; + label = SCOPE; c+=7; while (*c) { if (*c!=')' && *c!=',') @@ -207,8 +428,8 @@ push_name_scope(&locator[0], name); } - - if (!label) { + /* Else if we didn't hit a label */ + if (label == 0) { c = line; while (c && *c) { if (*c=='{') @@ -219,12 +440,11 @@ } } - translate_locator(locator, translated); ds->locator = strdup(translated); ds->untranslated = strdup(locator); - dsdt = g_list_append(dsdt, ds); - dsdt_size += strlen(ds->line); + ssdt[current_ssdt] = g_list_append(ssdt[current_ssdt], ds); + ssdt_size[current_ssdt] += strlen(ds->line); } fclose(file); } @@ -248,7 +468,7 @@ line = (struct dsdt_line*)lst->data; - ptr =buffer = malloc(dsdt_size); + ptr =buffer = malloc(ssdt_size[current_ssdt]); ptr += sprintf(ptr,"--=[ %s ]=--\n\n", line->locator); @@ -294,69 +514,33 @@ static void announce_aml_resources(void) { - if (dsdt) - do_new_resource(dsdt); + if (ssdt[current_ssdt]) + do_new_resource(ssdt[current_ssdt]); + current_ssdt++; } -static int get_line_nr(char *line) -{ - if (strlen(line)<10) - return 0; - return strtoul(line+9, NULL, 10); -} +/* do_table() -- recompiles .dsl file with iasl, parses the output + * and reports the results. + * + * Parameters + * filename - name of table to compile with iasl (usually dsdt.dsl) + * Returns + * void +*/ -static struct dsdt_line *find_line(int nr) { - GList *list; - struct dsdt_line *line; - - list = g_list_first(dsdt); - while (list) { - line = (struct dsdt_line*) list->data; - - if (line->lineno == nr) - return line; - list = g_list_next(list); - } - return NULL; -} - - -static void do_test(void) +static void do_table(char *filename) { FILE *file; char line[4096]; char output[8192]; char uri[4096]; - struct stat before, after; - int ret; + char command[4096]; - if (getuid()!=0) { - printf("FATAL: Need to be root to perform the DSDT AML verification test \n"); - return; - } - start_test("acpicompile", "DSDT AML verification", - "This test first disassembles the DSDT of the BIOS, and then uses the " - "IASL compiler from Intel to recompile the code. The IASL copiler is much " - "stricter in detecting deviations from the ACPI specification and can " - "find numerous defects that other AML compilers cannot find. Fixing these " - "defects increases the probability that the BIOS will operate well with " - "a variety of operating systems." - ); + sprintf(command, "plugins/iasl -vi -vs -w3 %s", filename); - ret = system("cat /proc/acpi/dsdt > dsdt.dat"); - if (ret != EXIT_SUCCESS) - return; - ret = system("plugins/iasl -d dsdt.dat &>/dev/null"); - if (ret) - printf("iasl returns %i \n", ret); - report_testrun_progress(30); - - parse_dsdt("dsdt.dsl"); - - report_testrun_progress(60); - - file = popen("plugins/iasl -vi -vs -w3 dsdt.dsl","r"); + /* analyse output of the iasl compiler */ + file = popen(command,"r"); while (!feof(file)) { char *q; struct dsdt_line *ds; @@ -364,15 +548,18 @@ int f; char *details; int skip = 100; + char key[1024]; memset(line, 0, 4096); if (fgets(line, 4095, file)==NULL) break; + /* only deal with lines that have the filename in it, the rest is program fluff */ + sprintf(key, "%s(", filename); + if (strstr(line,key)==NULL) + continue; - if (strstr(line,"dsdt.dsl(")==NULL) - break; - + /* not a warning we really care about */ if (strstr(line, "Namespace object is not referenced")) continue; @@ -385,6 +572,8 @@ continue; } + /* save the actual warning/error msg (after line no, 'warning', etc.) + * we'll use it later in our test error reporting. */ q = strchr(line, '-'); if (!q) q=line; @@ -411,6 +600,12 @@ ds->locator[strlen(ds->locator)] = 0; } + /* Construct the details of the warning/err by also including + * the prev. 5 lines and the next 4 lines from where this + * occured. */ + + /* first go through and fix spacing by recording what's the least + * amount of spaces you can afford to skip before displaying a line */ details = strdup(""); details = scatprintf(details,"%s\nAt %s\n\n", q, ds->locator); skip = 100; @@ -425,6 +620,8 @@ skip = Q; } + /* now copy these lines to details to include in our test reporting, + * skipping as much un-needed beg. space as we can */ for (f=ds->lineno-5; flineno+5; f++) { struct dsdt_line *d2; d2 = find_line(f); @@ -448,8 +645,79 @@ free(details); } fclose(file); + sprintf(line, "Tested table %s", filename); + report_result("acpicompile", PASS, line, NULL, NULL); +} - ret = stat("dsdt.dat", &before); +/* do_test() -- main workhorse for this plugin. + * + * Parameters + * void + * Returns + * void +*/ + +static void do_test(void) +{ + struct stat before, after; + int ret; + int i; + char filen[1024]; + + /* If DSDT.dat doesn't exist, get it (it usually should exist + * when extract_dsdt_ssdts() is called from main.c) */ + if (access("DSDT.dat", R_OK)) { + ret = system("cat /proc/acpi/dsdt > DSDT.dat"); + + if (ret != EXIT_SUCCESS) + return; + } + + /* Disassemble DSDT.dat with iasl, will create DSDT.dsl */ + ret = system("plugins/iasl -d DSDT.dat &>/dev/null"); + if (ret) + printf("iasl returns %i \n", ret); + + system("plugins/iasl -d -e DSDT.dat SSDT1.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT2.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT3.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT4.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT5.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT6.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT7.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT8.dat &>/dev/null"); + system("plugins/iasl -d -e DSDT.dat SSDT9.dat &>/dev/null"); + + /* current iasl has an issue with arugment counts in SSDT's, work around this */ + system("sed -i -e \"s/^ACPI Error.*Argument count mismatch for method.*//g\" SSDT*.dsl &> /dev/null"); + + report_testrun_progress(20); + + parse_dsdt("DSDT.dsl"); + + report_testrun_progress(40); + + do_table("DSDT.dsl"); + announce_aml_resources(); + + + for (i=1; i<10; i++) { + sprintf(filen, "SSDT%i.dsl", i); + if (!access(filen, R_OK)) { + parse_dsdt(filen); + do_table(filen); + announce_aml_resources(); + } + } + + /* Check duplicate _SUNs */ + do_SUN_check(); + + report_testrun_progress(60); + + /* report how much space would be saved by re-compiling + * DSDT with iasl */ + ret = stat("DSDT.dat", &before); if (!ret) { ret = stat("DSDT.aml", &after); if (!ret) { @@ -462,13 +730,42 @@ report_result("acpicompile", INFO, outbuf, detbuf, NULL); } } + report_testrun_progress(80); - announce_aml_resources(); - finish_test("acpicompile"); + } -int main(int __unused argc, char __unused **argv) +/* main() -- This plugin disassembles DSDT, then recompiles it with the IASL + * compiler. It also checks for duplicate Name (_SUN,...) ids. + * Main() just sets up init and clean exit. + * + * Parameters + * argc & argv + * Returns + * EXIT_SUCCESS upon success of running this plugin + * EXIT_FAILURE upon failure of running this plugin +*/ + +int main(int argc, char **argv) { + + if (getuid()!=0) { + printf("FATAL: Need to be root to perform the DSDT AML verification test \n"); + return EXIT_FAILURE; + } + + start_test("acpicompile", "DSDT AML verification", + "This test first disassembles the DSDT of the BIOS, and then uses the " + "IASL compiler from Intel to recompile the code. The IASL copiler is much " + "stricter in detecting deviations from the ACPI specification and can " + "find numerous defects that other AML compilers cannot find. Fixing these " + "defects increases the probability that the BIOS will operate well with " + "a variety of operating systems." + ); + do_test(); - return 0; + + finish_test("acpicompile"); + return EXIT_SUCCESS; } + Index: acpicompile/Makefile =================================================================== --- acpicompile/Makefile (.../release-0) (revision 136) +++ acpicompile/Makefile (.../release-1) (revision 136) @@ -1,29 +1,44 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += -I.. `pkg-config --cflags glib-2.0` -fPIC LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone -all: acpicompile.exe iasl +all: acpicompile.exe iasl acpixtract acpidump acpicompile.exe: acpicompile.o .depend gcc acpicompile.o $(LDFLAGS) -o acpicompile.exe cp acpicompile.exe ../plugins - - -acpica-unix-20060608.tar.gz: - wget http://www.intel.com/technology/iapc/acpi/downloads/acpica-unix-20060608.tar.gz - cp acpica-unix-20060608.tar.gz ../initramfs/srpms/ - -iasl: acpica-unix-20060608.tar.gz - tar -zxvf acpica-unix-20060608.tar.gz - cd acpica-unix-20060608/compiler ; make -s ; cp iasl ../.. + + +acpica-unix-20060912.tar.gz: + wget http://www.intel.com/technology/iapc/acpi/downloads/acpica-unix-20060912.tar.gz + cp acpica-unix-20060912.tar.gz ../initramfs/srpms/ + +pmtools-20060606.tar.bz2: + wget http://www.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools-20060606.tar.bz2 + cp pmtools-20060606.tar.bz2 ../initramfs/srpms/ + +iasl: acpica-unix-20060912.tar.gz + tar -zxvf acpica-unix-20060912.tar.gz + cd acpica-unix-20060912/compiler ; make -s ; cp iasl ../.. cp iasl ../plugins - rm -rf acpica-unix-20060608 + rm -rf acpica-unix-20060912 +acpixtract: acpica-unix-20060912.tar.gz + tar -zxvf acpica-unix-20060912.tar.gz + cd acpica-unix-20060912/tools/acpixtract/ ; make -s ; cp acpixtract ../../.. + cp acpixtract ../plugins + rm -rf acpica-unix-20060912 + +acpidump: pmtools-20060606.tar.bz2 + tar -jxf pmtools-20060606.tar.bz2 + cd pmtools-20060606 ; make + cp pmtools-20060606/acpidump/acpidump ../plugins + clean: rm -rf *~ *.o rm -f acpicompile.exe acpicompile.so iasl - - + + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -36,4 +51,3 @@ # now add a line to include the dependency list. include .depend - Index: shelltools/Makefile =================================================================== --- shelltools/Makefile (.../release-0) (revision 136) +++ shelltools/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone @@ -12,19 +12,19 @@ report_testrun_progress: ln -s start_test report_testrun_progress - + announce_resource: ln -s start_test announce_resource - - + + install: cp -a start_test report_result finish_test report_testrun_progress announce_resource $(DESTDIR)/usr/bin - + clean: rm -rf *~ *.o rm -f ethernet.so ethernet.exe - - + + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -36,5 +36,3 @@ # now add a line to include the dependency list. include .depend - - Index: shelltools/start_test.c =================================================================== --- shelltools/start_test.c (.../release-0) (revision 136) +++ shelltools/start_test.c (.../release-1) (revision 136) @@ -26,7 +26,7 @@ #include -void do_start_test(int __unused argc, char **argv) +void do_start_test(int argc, char **argv) { start_test(argv[1], argv[2], argv[3]); } @@ -52,12 +52,12 @@ report_result(argv[1], result, argv3, argv4, argv5); } -void do_finish_test(int __unused argc, char **argv) +void do_finish_test(int argc, char **argv) { finish_test(argv[1]); } -void do_report_testrun_progress(int __unused argc, char **argv) +void do_report_testrun_progress(int argc, char **argv) { int percent; Index: amlpoke/Makefile =================================================================== --- amlpoke/Makefile (.../release-0) (revision 136) +++ amlpoke/Makefile (.../release-1) (revision 136) @@ -1,5 +1,5 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. -LDFLAGS = `pkg-config --libs glib-2.0` +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I.. +LDFLAGS = -nodefaultlibs -L../initramfs/data/lib -L../initramfs/data/usr/lib `pkg-config --libs glib-2.0` all: amlpoke.so @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f amlpoke.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: shelltests/Makefile =================================================================== --- shelltests/Makefile (.../release-0) (revision 136) +++ shelltests/Makefile (.../release-1) (revision 136) @@ -1,20 +1,17 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS += -I.. `pkg-config --cflags glib-2.0` LDFLAGS = `pkg-config --libs glib-2.0` -L.. -lstandalone SCRIPTS = test.sh all: install - - install: chmod a+x $(SCRIPTS) cp -a $(SCRIPTS) ../plugins - + clean: rm -rf *~ *.o - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -26,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: pcipoke/Makefile =================================================================== --- pcipoke/Makefile (.../release-0) (revision 136) +++ pcipoke/Makefile (.../release-1) (revision 136) @@ -1,5 +1,5 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. -LDFLAGS = `pkg-config --libs glib-2.0` +override CFLAGS += `pkg-config --cflags glib-2.0` -fPIC -I.. +LDFLAGS = -nodefaultlibs -L../initramfs/data/lib -L../initramfs/data/usr/lib `pkg-config --libs glib-2.0` all: pcipoke.so @@ -11,8 +11,7 @@ clean: rm -rf *~ *.o rm -f pcipoke.so - - + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -24,5 +23,3 @@ # now add a line to include the dependency list. include .depend - - Index: thermal_trip/thermal_trip.sh =================================================================== --- thermal_trip/thermal_trip.sh (.../release-0) (revision 0) +++ thermal_trip/thermal_trip.sh (.../release-1) (revision 136) @@ -0,0 +1,257 @@ +#!/bin/bash +#*************************************************************************** +#* * +#* Check-Tool if acpi passive trip_points are supported * +#* * +#* Copyright (C) 2006 SUSE Linux Products GmbH * +#* * +#* Author(s): Frank Seidel * +#* Modified by: Arjan van de Ven * +#* integration with the LFDK shell API * +#* * +#* This program is free software; you can redistribute it and/or modify it * +#* under the terms of the GNU General Public License as published by the * +#* Free Software Foundation; either version 2 of the License, or (at you * +#* option) any later version. * +#* * +#* This program is distributed in the hope that it will be useful, but * +#* WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +#* General Public License for more details. * +#* * +#* You should have received a copy of the GNU General Public License along * +#* with this program; if not, write to the Free Software Foundation, Inc., * +#* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * +#* * +#***************************************************************************/ + +export THERMALPATH="/proc/acpi/thermal_zone" +export OUTPUTTYPE="d" + +function printhelp () +{ + cat <<-EOHELP + This script tries to determine if the passive trip point (given by + the acpi interace in /proc) does work as expected. + Following options can be given: + + -h This help you are looking at + -s Show only names of supported thermal_zones + -u Show only names of un-supported thermal_zones + -d Debug output (default) +EOHELP +} + + +#eval given opts + +while getopts "hsud" optchar +do + case "$optchar" in + h) + printhelp + exit 0 + ;; + s) + export OUTPUTTYPE="s" + ;; + u) + export OUTPUTTYPE="u" + ;; + d) + export OUTPUTTYPE="d" + ;; + *) + echo "Unknown option" >&2 + printhelp + exit 1 + ;; + esac +done + + +start_test thermal_trip "ACPI passive thermal trip points" \ +"This test determines if the passive trip point works as expected." + +#pretests +for CHECKDIR in $THERMALPATH /proc/acpi/processor /proc/acpi/processor +do + if ! [ -d "$CHECKDIR" ] + then + report_result thermal_trip WARN "Cannot test trip points without existing $CHECKDIR." + finish_test thermal_trip + exit 0 + fi +done + +ls $THERMALPATH/* > /dev/null 2>&1 +if [ $? -ne 0 ]; then + report_result thermal_trip WARN "No thermal zones found." + finish_test thermal_trip + exit 0 +fi + +export THROTTLINGPATH="$(echo /proc/acpi/processor/* |head -n 1)/throttling" +export CPUFREQPATH="$(echo /sys/devices/system/cpu/* |head -n 1)/cpufreq" + +export ZONECOUNT="$(ls -ld $THERMALPATH/* | wc -l)" +export ZONECOUNT=$[ZONECOUNT+1] +export ZONEPERC=$[95/ZONECOUNT] +export CURRPERC=5 + +report_testrun_progress $CURRPERC + +#Go through zones +for ZONE in $THERMALPATH/* +do + #check if passive trip point is shown at all + + if (grep passive "$ZONE/trip_points" &>/dev/null ) + then + #save current temps + CUR_PASSIVE="$(grep passive $ZONE/trip_points |sed -e 's/passive:[^0-9]*\([0-9]*\) C.*/\1/')" + #critical trip point + if (grep critical "$ZONE/trip_points" &>/dev/null) + then + export CUR_CRITICAL="$(grep critical $ZONE/trip_points |sed -e 's/critical (S5):[^0-9]*\([0-9]*\) C.*/\1/')" + else + export CUR_CRITICAL="0" + fi + #hot trip point + if (grep "^hot" "$ZONE/trip_points" &>/dev/null ) + then + export CUR_HOT="$(grep '^hot' $ZONE/trip_points |sed -e 's/hot[^\:]*:[^0-9]*\([0-9]*\) C.*/\1/')" + else + export CUR_HOT="0" + fi + #active trip points + if (grep "^active" "$ZONE/trip_points" &>/dev/null) + then + export CUR_ACTIVES="$(grep '^active' $ZONE/trip_points | sed -e 's/active[^\:]*:[^0-9]*\([0-9]*\) C.*/\1/' | tr '\n' ':')0" + else + export CUR_ACTIVES="0:0" + fi + + + #update progress + export CURRPERC=$[CURRPERC+(ZONEPERC/3)] + report_testrun_progress $CURRPERC + + + #look for current throttling on first cpu + CUR_THROT="$(grep active $THROTTLINGPATH |sed 's/active[^T]*T\([0-9]*\)/\1/')" + + #look for current cpufreq state + if [ -d "$CPUFREQPATH" ] + then + #..and start stressing cpu to to see wheather it gets scaled down + exec 2>/dev/null + cat /dev/zero >/dev/null & + export STRESSPID=$! + + sleep 4 + + #cpu should be stressed now and current freq high + export CUR_CPUFREQ="$( <$CPUFREQPATH/scaling_cur_freq)" + fi + + #update progress + export CURRPERC=$[CURRPERC+(ZONEPERC/3)] + report_testrun_progress $CURRPERC + + #look for current polling frequency + CUR_POLLING="$(sed -e 's/polling[^0-9]*\([0-9]*\) sec.*/\1/' $ZONE/polling_frequency)" + + #set new trip points + echo "$CUR_CRITICAL:$CUR_HOT:20:$CUR_ACTIVES" > $ZONE/trip_points + #mess current polling to get kernels attention + echo 1 >$ZONE/polling_frequency + echo 2 >$ZONE/polling_frequency + echo $CUR_POLLING >$ZONE/polling_frequency &> /dev/null + + #give the kernel some time + sleep 4 + + #update progress + export CURRPERC=$[CURRPERC+(ZONEPERC/3)] + report_testrun_progress $CURRPERC + + #recheck throttling now + NEW_THROT="$(grep active $THROTTLINGPATH |sed 's/active[^T]*T\([0-9]*\)/\1/')" + #recheck cpufreq now + if [ -d "$CPUFREQPATH" ] + then + export NEW_CPUFREQ="$( <$CPUFREQPATH/scaling_cur_freq)" + + #and stop stressing cpu + kill $STRESSPID + set -m + fi + + #check for difference + if ( [ "$NEW_THROT" -gt "$CUR_THROT" ] || [ "$NEW_CPUFREQ" -lt "$CUR_CPUFREQ" ] ) + then + #yes, throttling is effective + case "$OUTPUTTYPE" in + d) + if [ -n "$NEW_CPUFREQ" ] + then + report_result thermal_trip PASS "Zone ${ZONE##*/} supports passive trip point (throttled from T$CUR_THROT to T$NEW_THROT / cpufreq scaling from $CUR_CPUFREQ to $NEW_CPUFREQ kHz)." + else + report_result thermal_trip PASS "Zone ${ZONE##*/} supports passive trip point (throttled from T$CUR_THROT to T$NEW_THROT)." + fi + ;; + s) + echo "${ZONE##*/}" + ;; + u) ;; + *) + echo "Internal error: unknown OUTPUTTYPE $OUTPUTTYPE." >&2 + exit 1 + ;; + esac + else + #no, throttling is not effective + case "$OUTPUTTYPE" in + d) + report_result thermal_trip FAIL "Changing passive trip point seems uneffective in Zone ${ZONE##*/}." + ;; + u) + echo "${ZONE##*/}" + ;; + s) ;; + *) + echo "Internal error: unknown OUTPUTTYPE $OUTPUTTYPE." >&2 + exit 1 + ;; + esac + fi + + #restor old values + echo "$CUR_CRITICAL:$CUR_HOT:$CUR_PASSIVE:$CUR_ACTIVES" >$ZONE/trip_points + echo 1 >$ZONE/polling_frequency + echo 2 >$ZONE/polling_frequency + echo $CUR_POLLING >$ZONE/polling_frequency &> /dev/null + sleep 4 + + else + #cannot check as passive trip points are not supported + case "$OUTPUTTYPE" in + d) + report_result thermal_trip WARN "Zone ${ZONE##*/} doesn't support passive trip point at all." + ;; + u) + echo "${ZONE##*/}" + ;; + s) ;; + *) + echo "Internal error: unknown OUTPUTTYPE $OUTPUTTYPE." >&2 + exit 1 + ;; + esac + fi + + +done + +finish_test thermal_trip Index: thermal_trip/Makefile =================================================================== --- thermal_trip/Makefile (.../release-0) (revision 0) +++ thermal_trip/Makefile (.../release-1) (revision 136) @@ -0,0 +1,15 @@ + +SCRIPTS = thermal_trip.sh + +all: install + + + +install: + chmod a+x $(SCRIPTS) + cp -a $(SCRIPTS) ../plugins + +clean: + rm -rf *~ + + Index: ebda/Makefile =================================================================== --- ebda/Makefile (.../release-0) (revision 136) +++ ebda/Makefile (.../release-1) (revision 136) @@ -1,11 +1,11 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -fPIC -g -I.. +override CFLAGS = `pkg-config --cflags glib-2.0` -I.. LDFLAGS = `pkg-config --libs glib-2.0` all: ebda.so ebda.so: ebda.o .depend - gcc --shared ebda.o $(LDFLAGS) -o ebda.so -lnewt + gcc --shared ebda.o $(LDFLAGS) -o ebda.so cp ebda.so ../plugins clean: Index: edd/Makefile =================================================================== --- edd/Makefile (.../release-0) (revision 136) +++ edd/Makefile (.../release-1) (revision 136) @@ -1,4 +1,4 @@ -CFLAGS = -Wall -W -Os -D_FORTIFY_SOURCE=2 `pkg-config --cflags glib-2.0` -g -I.. +override CFLAGS += `pkg-config --cflags glib-2.0` -I.. -fPIC LDFLAGS = `pkg-config --libs glib-2.0` -L../ -lstandalone @@ -11,8 +11,8 @@ clean: rm -rf *~ *.o rm -f edd.so edd.exe - - + + # most of the makefile remains as it was before. # at the bottom, we add these lines: @@ -25,4 +25,3 @@ # now add a line to include the dependency list. include .depend - Index: edd/edd.c =================================================================== --- edd/edd.c (.../release-0) (revision 136) +++ edd/edd.c (.../release-1) (revision 136) @@ -52,7 +52,7 @@ static GList *disks; -static void check_line(gpointer data, gpointer __unused user_data) +static void check_line(gpointer data, gpointer user_data) { char *line = (char *)data; @@ -86,7 +86,7 @@ (sector[441] << 8) + (sector[440]); sprintf(disk->signature,"0x%x", sig); - sigs = scatprintf(sigs, "Device %s - signature s\n", disk->device, disk->signature); + sigs = scatprintf(sigs, "Device %s - signature %s\n", disk->device, disk->signature); } static void get_pci_dev(struct edd_disk_info *disk) @@ -353,7 +353,7 @@ } -int main(int __unused argc, char __unused **argv) +int main(int argc, char **argv) { start_test("edd", "EDD Boot disk hinting", "This test verifies if the BIOS directs the operating system on which storage " @@ -373,6 +373,7 @@ check_for_dupes(); finish_test("edd"); + return EXIT_SUCCESS; } Index: initramfs/kernel/Makefile =================================================================== --- initramfs/kernel/Makefile (.../release-0) (revision 136) +++ initramfs/kernel/Makefile (.../release-1) (revision 136) @@ -1,18 +1,30 @@ -kernel=2.6.17 +kernel=2.6.19 +patch=patch-2.6.19-rc6.bz2 all: bzImage -bzImage: linux-$(kernel).tar.bz2 + +bzImage: linux-$(kernel).tar.bz2 $(patch) Makefile +# if arch is i*86 (i386, i686, etc.) +ifeq ($(shell uname -m | cut -c1,3,4), i86) tar -jxf linux-$(kernel).tar.bz2 cp ../kernel.config linux-$(kernel)/.config +# cd linux-$(kernel) ; bzcat ../$(patch) | patch -p1 cd linux-$(kernel) ; make ARCH=i386 oldconfig ; make ARCH=i386 -s -j8 bzImage cp linux-$(kernel)/arch/i386/boot/bzImage . cp bzImage ../cdimage/isolinux/vmlinuz +else + touch bzImage +endif linux-$(kernel).tar.bz2: wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-$(kernel).tar.bz2 cp linux-$(kernel).tar.bz2 ../srpms/ +$(patch): + wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/$(patch) + cp $(patch) ../srpms/ + clean: rm -rf *~ *.o rm -rf bzImage linux-$(kernel)* Index: initramfs/files_to_remove =================================================================== --- initramfs/files_to_remove (.../release-0) (revision 136) +++ initramfs/files_to_remove (.../release-1) (revision 136) @@ -1,6 +1,4 @@ -++ newfilelist 2006-02-28 13:56:48.000000000 +0100 ./bin/arch -./bin/basename ./bin/env ./bin/login ./bin/sort @@ -22,18 +20,6 @@ ./etc/skel/.bash_logout ./etc/skel/.bash_profile ./etc/skel/.bashrc -./lib/i686 -./lib/i686/nosegneg -./lib/i686/nosegneg/libc-2.3.90.so -./lib/i686/nosegneg/libc.so.6 -./lib/i686/nosegneg/libm-2.3.90.so -./lib/i686/nosegneg/libm.so.6 -./lib/i686/nosegneg/libpthread-2.3.90.so -./lib/i686/nosegneg/libpthread.so.0 -./lib/i686/nosegneg/librt-2.3.90.so -./lib/i686/nosegneg/librt.so.1 -./lib/i686/nosegneg/libthread_db-1.0.so -./lib/i686/nosegneg/libthread_db.so.1 ./lib/libext2fs.so.2 ./lib/libext2fs.so.2.4 ./sbin/debugfs @@ -4455,3 +4441,172 @@ ./usr/share/doc/syslinux-3.10/memdisk.doc ./usr/share/doc/syslinux-3.10/pxelinux.doc ./usr/share/doc/syslinux-3.10/syslinux.doc +./usr/include/newt.h +./usr/lib/libnewt.a +./usr/share/doc/newt-devel-0.52.2 +./usr/share/doc/newt-devel-0.52.2/peanuts.py +./usr/share/doc/newt-devel-0.52.2/popcorn.py +./usr/share/doc/newt-devel-0.52.2/tutorial.sgml +./usr/include/slang +./usr/include/slang/slang.h +./usr/include/slang/slcurses.h +./usr/lib/libslang-utf8.a +./usr/lib/libslang.a +./usr/include/gnu/stubs-32.h +./usr/lib/Mcrt1.o +./usr/lib/Scrt1.o +./usr/lib/libBrokenLocale.a +./usr/lib/libanl.a +./usr/lib/libbsd-compat.a +./usr/lib/libbsd.a +./usr/lib/libc.a +./usr/lib/libc_stubs.a +./usr/lib/libcrypt.a +./usr/lib/libdl.a +./usr/lib/libg.a +./usr/lib/libieee.a +./usr/lib/libm.a +./usr/lib/libmcheck.a +./usr/lib/libnsl.a +./usr/lib/libresolv.a +./usr/lib/librpcsvc.a +./usr/lib/librt.a +./usr/lib/libutil.a +./usr/lib/syslinux/com32 +./bin/doexec +./bin/ipcalc +./bin/usleep +./etc/X11/prefdm +./etc/adjtime +./etc/initlog.conf +./etc/inittab +./etc/ppp +./etc/ppp/ip-down +./etc/ppp/ip-down.ipv6to4 +./etc/ppp/ip-up +./etc/ppp/ip-up.ipv6to4 +./etc/ppp/ipv6-down +./etc/ppp/ipv6-up +./etc/ppp/peers +./etc/profile.d/lang.csh +./etc/profile.d/lang.sh +./etc/rc.d/rc0.d +./etc/rc.d/rc0.d/S00killall +./etc/rc.d/rc0.d/S01halt +./etc/rc.d/rc1.d +./etc/rc.d/rc1.d/S99single +./etc/rc.d/rc2.d +./etc/rc.d/rc2.d/S99local +./etc/rc.d/rc3.d +./etc/rc.d/rc3.d/S99local +./etc/rc.d/rc4.d +./etc/rc.d/rc4.d/S99local +./etc/rc.d/rc5.d +./etc/rc.d/rc5.d/S99local +./etc/rc.d/rc6.d +./etc/rc.d/rc6.d/S00killall +./etc/rc.d/rc6.d/S01reboot +./etc/rc.local +./etc/rc.sysinit +./etc/rwtab +./etc/rwtab.d +./etc/sysconfig/network-scripts +./etc/sysconfig/network-scripts/ifcfg-lo +./etc/sysconfig/network-scripts/ifdown +./etc/sysconfig/network-scripts/ifdown-bnep +./etc/sysconfig/network-scripts/ifdown-eth +./etc/sysconfig/network-scripts/ifdown-ippp +./etc/sysconfig/network-scripts/ifdown-ipsec +./etc/sysconfig/network-scripts/ifdown-ipv6 +./etc/sysconfig/network-scripts/ifdown-isdn +./etc/sysconfig/network-scripts/ifdown-post +./etc/sysconfig/network-scripts/ifdown-ppp +./etc/sysconfig/network-scripts/ifdown-routes +./etc/sysconfig/network-scripts/ifdown-sit +./etc/sysconfig/network-scripts/ifdown-sl +./etc/sysconfig/network-scripts/ifdown-tunnel +./etc/sysconfig/network-scripts/ifup +./etc/sysconfig/network-scripts/ifup-aliases +./etc/sysconfig/network-scripts/ifup-bnep +./etc/sysconfig/network-scripts/ifup-eth +./etc/sysconfig/network-scripts/ifup-ippp +./etc/sysconfig/network-scripts/ifup-ipsec +./etc/sysconfig/network-scripts/ifup-ipv6 +./etc/sysconfig/network-scripts/ifup-ipx +./etc/sysconfig/network-scripts/ifup-isdn +./etc/sysconfig/network-scripts/ifup-plip +./etc/sysconfig/network-scripts/ifup-plusb +./etc/sysconfig/network-scripts/ifup-post +./etc/sysconfig/network-scripts/ifup-ppp +./etc/sysconfig/network-scripts/ifup-routes +./etc/sysconfig/network-scripts/ifup-sit +./etc/sysconfig/network-scripts/ifup-sl +./etc/sysconfig/network-scripts/ifup-tunnel +./etc/sysconfig/network-scripts/ifup-wireless +./etc/sysconfig/network-scripts/init.ipv6-global +./etc/sysconfig/network-scripts/net.hotplug +./etc/sysconfig/network-scripts/network-functions +./etc/sysconfig/network-scripts/network-functions-ipv6 +./etc/sysconfig/networking +./etc/sysconfig/networking/devices +./etc/sysconfig/networking/profiles +./etc/sysconfig/networking/profiles/default +./etc/sysconfig/readonly-root +./etc/sysctl.conf +./sbin/fstab-decode +./sbin/genhostid +./sbin/getkey +./sbin/ifdown +./sbin/ifup +./sbin/initlog +./sbin/netreport +./sbin/ppp-watch +./sbin/service +./sbin/setsysfont +./usr/sbin/sys-unconfig +./usr/sbin/usernetctl +./usr/share/locale/ +./usr/share/man/man1/consoletype.1.gz +./usr/share/man/man1/doexec.1.gz +./usr/share/man/man1/genhostid.1.gz +./usr/share/man/man1/getkey.1.gz +./usr/share/man/man1/initlog.1.gz +./usr/share/man/man1/ipcalc.1.gz +./usr/share/man/man1/netreport.1.gz +./usr/share/man/man1/usleep.1.gz +./usr/share/man/man5/crypttab.5.gz +./usr/share/man/man8/fstab-decode.8.gz +./usr/share/man/man8/ppp-watch.8.gz +./usr/share/man/man8/service.8.gz +./usr/share/man/man8/sys-unconfig.8.gz +./usr/share/man/man8/usernetctl.8.gz +./var/lib/stateless +./var/lib/stateless/writable +./var/run/netreport +./bin/dumpkeys +./bin/kbd_mode +./bin/loadkeys +./bin/setfont +./bin/unicode_start +./bin/unicode_stop +./etc/pam.d/kbdrate +./etc/security/console.apps/kbdrate +./lib/kbd/consolefonts +./lib/kbd/consoletrans +./lib/kbd/keymaps +./lib/kbd/unimaps +./usr/bin/getkeycodes +./usr/bin/kbdrate +./usr/bin/loadunimap +./usr/bin/mapscrn +./usr/bin/psfaddtable +./usr/bin/psfgettable +./usr/bin/psfstriptable +./usr/bin/psfxtable +./usr/bin/resizecons +./usr/bin/setkeycodes +./usr/bin/setleds +./usr/bin/setmetamode +./usr/bin/showconsolefont +./usr/bin/showkey +./usr/sbin/kbdrate Index: initramfs/rpms/Makefile =================================================================== --- initramfs/rpms/Makefile (.../release-0) (revision 136) +++ initramfs/rpms/Makefile (.../release-1) (revision 136) @@ -1,99 +1,31 @@ -all: bash-3.1-6.2.i386.rpm coreutils-5.93-7.2.i386.rpm e2fsprogs-1.37-4.i386.rpm findutils-4.2.27-4.i386.rpm \ - gawk-3.1.5-6.2.i386.rpm glib2-2.10.1-1.i386.rpm glibc-2.4-4.i686.rpm glibc-common-2.4-4.i386.rpm \ - grep-2.5.1-52.2.i386.rpm hwdata-0.177-1.noarch.rpm libacl-2.2.34-1.2.i386.rpm libattr-2.4.28-1.2.i386.rpm \ - libselinux-1.29.7-1.2.i386.rpm libsepol-1.11.18-2.i386.rpm libtermcap-2.0.8-45.i386.rpm ncurses-5.5-19.i386.rpm \ - net-tools-1.60-62.1.i386.rpm newt-0.51.6-7.i386.rpm pciutils-2.2.1-1.2.i386.rpm pcre-6.3-1.2.1.i386.rpm \ - perl-5.8.8-4.i386.rpm sed-4.1.5-1.2.i386.rpm slang-1.4.9-17.i386.rpm util-linux-2.12p-9.3.i386.rpm \ - SysVinit-2.86-2.2.2.i386.rpm pci.ids gdb-6.3.0.0-1.122.i386.rpm dhclient-3.0.3-26.i386.rpm \ - iproute-2.6.15-1.2.i386.rpm syslinux-3.10-2.2.i386.rpm +all: kernels bash-3.1-16.1.i386.rpm coreutils-5.97-11.i386.rpm e2fsprogs-1.39-7.i386.rpm findutils-4.2.27-4.1.i386.rpm \ + gawk-3.1.5-11.i386.rpm glib2-2.12.3-2.fc6.i386.rpm glibc-2.5-3.i686.rpm glibc-common-2.5-3.i386.rpm \ + grep-2.5.1-54.1.i386.rpm hwdata-0.191-1.noarch.rpm libacl-2.2.39-1.1.i386.rpm libattr-2.4.32-1.1.i386.rpm \ + libselinux-1.30.29-2.i386.rpm libsepol-1.12.27-1.i386.rpm libtermcap-2.0.8-46.1.i386.rpm ncurses-5.5-24.20060715.i386.rpm \ + net-tools-1.60-73.i386.rpm newt-0.52.2-9.i386.rpm pciutils-2.2.3-4.i386.rpm pcre-6.6-1.1.i386.rpm \ + perl-5.8.8-10.i386.rpm sed-4.1.5-5.fc6.i386.rpm slang-2.0.6-3.i386.rpm util-linux-2.13-0.44.fc6.i386.rpm \ + SysVinit-2.86-14.i386.rpm pci.ids gdb-6.5-8.fc6.i386.rpm dhclient-3.0.4-21.fc6.i386.rpm \ + iproute-2.6.16-6.fc6.i386.rpm syslinux-3.11-4.i386.rpm newt-devel-0.52.2-9.i386.rpm \ + slang-devel-2.0.6-3.i386.rpm glibc-devel-2.5-3.i386.rpm e2fsprogs-libs-1.39-7.i386.rpm \ + device-mapper-1.02.07-3.i386.rpm module-init-tools-3.3-0.pre1.4.17.i386.rpm \ + udev-095-14.i386.rpm initscripts-8.45.3-1.i386.rpm microcode_ctl-1.13-1.33.fc6.i386.rpm \ + dmidecode-2.7-1.26.1.fc6.i386.rpm microcode.dat pm-utils-0.19-3.i386.rpm kbd-1.12-18.i386.rpm \ + ftp-0.17-33.fc6.i38