Commit in freeldr/freeldr on MAIN
Makefile+21.59 -> 1.60
arch/i386/hwacpi.c+104added 1.1
         /hwapm.c+111added 1.1
         /hardware.c+2-71.24 -> 1.25
         /hardware.h+61.7 -> 1.8
         /hwcpu.c+1-11.2 -> 1.3
         /hwpci.c+6-61.1 -> 1.2
reactos/setupldr.c+61.18 -> 1.19
+238-14
2 added + 6 modified, total 8 files
Detect and report ACPI- and APM-BIOS support.

freeldr/freeldr
Makefile 1.59 -> 1.60
diff -u -r1.59 -r1.60
--- Makefile	28 Nov 2004 22:42:39 -0000	1.59
+++ Makefile	27 Dec 2004 16:13:41 -0000	1.60
@@ -207,6 +207,8 @@
 			i386disk.o	\
 			portio.o	\
 			hardware.o	\
+			hwacpi.o	\
+			hwapm.o		\
 			hwcpu.o		\
 			hwpci.o		\
 			archmach.o	\

freeldr/freeldr/arch/i386
hwacpi.c added at 1.1
diff -N hwacpi.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hwacpi.c	27 Dec 2004 16:13:41 -0000	1.1
@@ -0,0 +1,104 @@
+/*
+ *  FreeLoader
+ *
+ *  Copyright (C) 2004  Eric Kohl
+ *
+ *  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 your 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <freeldr.h>
+#include <arch.h>
+#include <rtl.h>
+#include <debug.h>
+#include <mm.h>
+#include <portio.h>
+
+#include "../../reactos/registry.h"
+#include "hardware.h"
+
+
+static BOOL
+FindAcpiBios(VOID)
+{
+  PU8 Ptr;
+
+  /* Find the 'Root System Descriptor Table Pointer' */
+  Ptr = (PU8)0xE0000;
+  while ((U32)Ptr < 0x100000)
+    {
+      if (!memcmp(Ptr, "RSD PTR ", 8))
+	{
+	  DbgPrint((DPRINT_HWDETECT, "ACPI supported\n"));
+
+	  return TRUE;
+	}
+
+      Ptr = (PU8)((U32)Ptr + 0x10);
+    }
+
+  DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n"));
+
+  return FALSE;
+}
+
+
+VOID
+DetectAcpiBios(HKEY SystemKey, U32 *BusNumber)
+{
+  char Buffer[80];
+  HKEY BiosKey;
+  S32 Error;
+
+  if (FindAcpiBios())
+    {
+      /* Create new bus key */
+      sprintf(Buffer,
+	      "MultifunctionAdapter\\%u", *BusNumber);
+      Error = RegCreateKey(SystemKey,
+			   Buffer,
+			   &BiosKey);
+      if (Error != ERROR_SUCCESS)
+	{
+	  DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
+	  return;
+	}
+
+#if 0
+      /* Set 'Component Information' */
+      SetComponentInformation(BiosKey,
+                              0x0,
+                              0x0,
+                              0xFFFFFFFF);
+#endif
+
+      /* Increment bus number */
+      (*BusNumber)++;
+
+      /* Set 'Identifier' value */
+      Error = RegSetValue(BiosKey,
+			  "Identifier",
+			  REG_SZ,
+			  (PU8)"ACPI BIOS",
+			  10);
+      if (Error != ERROR_SUCCESS)
+	{
+	  DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
+	  return;
+	}
+
+    }
+}
+
+/* EOF */

freeldr/freeldr/arch/i386
hwapm.c added at 1.1
diff -N hwapm.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ hwapm.c	27 Dec 2004 16:13:41 -0000	1.1
@@ -0,0 +1,111 @@
+/*
+ *  FreeLoader
+ *
+ *  Copyright (C) 2004  Eric Kohl
+ *
+ *  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 your 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <freeldr.h>
+#include <arch.h>
+#include <rtl.h>
+#include <debug.h>
+#include <mm.h>
+#include <portio.h>
+
+#include "../../reactos/registry.h"
+#include "hardware.h"
+
+
+static BOOL
+FindApmBios(VOID)
+{
+  REGS  RegsIn;
+  REGS  RegsOut;
+
+  RegsIn.b.ah = 0x53;
+  RegsIn.b.al = 0x00;
+  RegsIn.w.bx = 0x0000;
+
+  Int386(0x15, &RegsIn, &RegsOut);
+
+  if (INT386_SUCCESS(RegsOut))
+    {
+      DbgPrint((DPRINT_HWDETECT, "Found APM BIOS\n"));
+      DbgPrint((DPRINT_HWDETECT, "AH: %x\n", RegsOut.b.ah));
+      DbgPrint((DPRINT_HWDETECT, "AL: %x\n", RegsOut.b.al));
+      DbgPrint((DPRINT_HWDETECT, "BH: %x\n", RegsOut.b.bh));
+      DbgPrint((DPRINT_HWDETECT, "BL: %x\n", RegsOut.b.bl));
+      DbgPrint((DPRINT_HWDETECT, "CX: %x\n", RegsOut.w.cx));
+
+      return TRUE;
+    }
+
+  printf("No APM BIOS found\n");
+
+  return FALSE;
+}
+
+
+VOID
+DetectApmBios(HKEY SystemKey, U32 *BusNumber)
+{
+  char Buffer[80];
+  HKEY BiosKey;
+  S32 Error;
+
+  if (FindApmBios())
+    {
+      /* Create new bus key */
+      sprintf(Buffer,
+	      "MultifunctionAdapter\\%u", *BusNumber);
+      Error = RegCreateKey(SystemKey,
+			   Buffer,
+			   &BiosKey);
+      if (Error != ERROR_SUCCESS)
+	{
+	  DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
+	  return;
+	}
+
+#if 0
+      /* Set 'Component Information' */
+      SetComponentInformation(BiosKey,
+                              0x0,
+                              0x0,
+                              0xFFFFFFFF);
+#endif
+
+      /* Increment bus number */
+      (*BusNumber)++;
+
+      /* Set 'Identifier' value */
+      Error = RegSetValue(BiosKey,
+			  "Identifier",
+			  REG_SZ,
+			  (PU8)"APM",
+			  4);
+      if (Error != ERROR_SUCCESS)
+	{
+	  DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
+	  return;
+	}
+
+    }
+
+  /* FIXME: Add congiguration data */
+}
+
+/* EOF */

freeldr/freeldr/arch/i386
hardware.c 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- hardware.c	18 Dec 2004 19:53:30 -0000	1.24
+++ hardware.c	27 Dec 2004 16:13:41 -0000	1.25
@@ -2276,15 +2276,10 @@
 
   /* Detect buses */
   DetectPciBios(SystemKey, &BusNumber);
-#if 0
-  DetectApmBios(&BusNumber);
-#endif
+  DetectApmBios(SystemKey, &BusNumber);
   DetectPnpBios(SystemKey, &BusNumber);
   DetectIsaBios(SystemKey, &BusNumber);
-#if 0
-  DetectAcpiBios(&BusNumber);
-#endif
-
+  DetectAcpiBios(SystemKey, &BusNumber);
 
   DbgPrint((DPRINT_HWDETECT, "DetectHardware() Done\n"));
 

freeldr/freeldr/arch/i386
hardware.h 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- hardware.h	9 Nov 2004 23:36:19 -0000	1.7
+++ hardware.h	27 Dec 2004 16:13:41 -0000	1.8
@@ -167,6 +167,12 @@
 			     U32 Key,
 			     U32 Affinity);
 
+/* hwacpi.c */
+VOID DetectAcpiBios(HKEY SystemKey, U32 *BusNumber);
+
+/* hwapm.c */
+VOID DetectApmBios(HKEY SystemKey, U32 *BusNumber);
+
 /* hwcpu.c */
 VOID DetectCPUs(HKEY SystemKey);
 

freeldr/freeldr/arch/i386
hwcpu.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- hwcpu.c	20 Dec 2003 12:34:00 -0000	1.2
+++ hwcpu.c	27 Dec 2004 16:13:41 -0000	1.3
@@ -30,7 +30,7 @@
 
 
 #define MP_FP_SIGNATURE 0x5F504D5F	/* "_MP_" */
-#define MP_CT_SIGNATURE 0x504D4350	/* "_MP_" */
+#define MP_CT_SIGNATURE 0x504D4350	/* "PCMP" */
 
 
 typedef struct _MP_FLOATING_POINT_TABLE

freeldr/freeldr/arch/i386
hwpci.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- hwpci.c	30 Aug 2004 10:50:13 -0000	1.1
+++ hwpci.c	27 Dec 2004 16:13:41 -0000	1.2
@@ -123,12 +123,12 @@
 
   if (INT386_SUCCESS(RegsOut) && RegsOut.d.edx == 0x20494350 && RegsOut.b.ah == 0)
     {
-//      printf("Found PCI bios\n");
+      DbgPrint((DPRINT_HWDETECT, "Found PCI bios\n"));
 
-//      printf("AL: %x\n", RegsOut.b.al);
-//      printf("BH: %x\n", RegsOut.b.bh);
-//      printf("BL: %x\n", RegsOut.b.bl);
-//      printf("CL: %x\n", RegsOut.b.cl);
+      DbgPrint((DPRINT_HWDETECT, "AL: %x\n", RegsOut.b.al));
+      DbgPrint((DPRINT_HWDETECT, "BH: %x\n", RegsOut.b.bh));
+      DbgPrint((DPRINT_HWDETECT, "BL: %x\n", RegsOut.b.bl));
+      DbgPrint((DPRINT_HWDETECT, "CL: %x\n", RegsOut.b.cl));
 
       BusData->BusCount = RegsOut.b.cl + 1;
       BusData->PciVersion = RegsOut.w.bx;
@@ -138,7 +138,7 @@
     }
 
 
-//  printf("No PCI bios found\n");
+  DbgPrint((DPRINT_HWDETECT, "No PCI bios found\n"));
 
   return FALSE;
 }

freeldr/freeldr/reactos
setupldr.c 1.18 -> 1.19
diff -u -r1.18 -r1.19
--- setupldr.c	28 Nov 2004 22:42:40 -0000	1.18
+++ setupldr.c	27 Dec 2004 16:13:41 -0000	1.19
@@ -507,6 +507,12 @@
     }
 
 #if 0
+  /* Load acpi.sys */
+  if (!LoadDriver(SourcePath, "acpi.sys"))
+    return;
+#endif
+
+#if 0
   /* Load isapnp.sys */
   if (!LoadDriver(SourcePath, "isapnp.sys"))
     return;
CVSspam 0.2.8