]> Joshua Wise's Git repositories - netwatch.git/blobdiff - hardware/ich7/smm-open-ich7.c
More churn moving files around.
[netwatch.git] / hardware / ich7 / smm-open-ich7.c
diff --git a/hardware/ich7/smm-open-ich7.c b/hardware/ich7/smm-open-ich7.c
new file mode 100644 (file)
index 0000000..2d69e3f
--- /dev/null
@@ -0,0 +1,31 @@
+/* smm-open-ich7.c
+ * SMRAM open utility for Intel 82865 northbridge
+ * NetWatch system management mode administration console
+ *
+ * Copyright (c) 2008 Jacob Potter and Joshua Wise.  All rights reserved.
+ * This program is free software; you can redistribute and/or modify it under
+ * the terms found in the file LICENSE in the root of this source tree. 
+ *
+ */
+
+#include "reg-82865.h"
+
+void main()
+{
+       unsigned char smramc, esmramc;
+       unsigned int toud;
+       
+       smramc = pci_read8(0, 0, 0, SMRAMC);
+       esmramc = pci_read8(0, 0, 0, ESMRAMC);
+       
+       toud = (pci_read16(0, 0, 0, 0xC4) >> 3) << 19;
+       printf("Usable DRAM: %d bytes\n", toud);
+       
+       printf("SMRAMC: %02x\n", smramc);
+       printf("ESMRAMC: %02x\n", smramc);
+       if (smramc & SMRAMC_LOCK)
+       {
+               printf("SMRAM is locked, cannot load anything :-(\n");
+               return;
+       }
+}
This page took 0.024607 seconds and 4 git commands to generate.