Index: branches/danielkza/doc/BootHelp.txt
===================================================================
--- branches/danielkza/doc/BootHelp.txt (revision 388)
+++ branches/danielkza/doc/BootHelp.txt (revision 389)
@@ -14,8 +14,8 @@
kernel: kernel name (e.g. "mach_kernel" - must be in "/" )
- flags: -v (verbose) -s (single user mode),
- -x (safe mode) -F (ignore boot configuration file)
+ flags: -v (verbose) -s (single user mode) -x (safe mode)
+ -F (ignore "Kernel Flags" specified in boot configuration file)
"Graphics Mode"="WIDTHxHEIGHTxDEPTH" (e.g. "1024x768x32")
Index: branches/danielkza/CHANGES
===================================================================
--- branches/danielkza/CHANGES (revision 388)
+++ branches/danielkza/CHANGES (revision 389)
@@ -1,3 +1,7 @@
+- Added Booter Log Dump Tool
+- Added Booter message Logging (":/boot-log" ioreg property)
+- Removed obsolete -f option, use -x instead
+- Removed -x32 option, use arch=i386 instead
- Added automatic SMBusspeed detection for lga1156 core i5/7 cpus
- Added new iMac11,1 sbios default model for lga1156 core i5/17 mobos
- md0 code. Notified xnu when an md ramdisk is specified
Index: branches/danielkza/artwork/themes/default/font_small.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_hfsraid.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/default/device_hfsraid.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_ext3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_hfsplus.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_selection.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/theme.plist
===================================================================
--- branches/danielkza/artwork/themes/default/theme.plist (revision 388)
+++ branches/danielkza/artwork/themes/default/theme.plist (revision 389)
@@ -13,7 +13,7 @@
screen_textmargin_v
10
screen_bgcolor
- #222334
+ #413F3C
background_pos_x
50%
background_pos_y
@@ -31,7 +31,7 @@
devices_pos_y
devices_bgcolor
- #222334
+ #413F3C
devices_transparency
0
devices_max_visible
@@ -53,7 +53,7 @@
bootprompt_textmargin_v
5
bootprompt_bgcolor
- #222334
+ #413F3C
bootprompt_transparency
1
infobox_pos_x
@@ -69,7 +69,7 @@
infobox_textmargin_v
10
infobox_bgcolor
- #222334
+ #413F3C
infobox_transparency
10
menu_pos_x
@@ -81,7 +81,7 @@
menu_textmargin_v
5
menu_bgcolor
- #222334
+ #413F3C
menu_transparency
1
progressbar_pos_x
Index: branches/danielkza/artwork/themes/default/device_scroll_prev.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_scroll_next.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_cdrom.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/progress_bar_background.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/progress_bar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_ntfs.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_fat.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/default/device_generic.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/text_scroll_prev.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/text_scroll_prev.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/font_small.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/font_small.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/text_scroll_next.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/text_scroll_next.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/logo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/logo.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_ext3.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_ext3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_single_user.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_single_user.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/boot.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/boot.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_hfsplus.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_hfsplus.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_ignore_caches_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_ignore_caches_disabled.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_selection.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_selection.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_video_info.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_video_info.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_memory_info.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_memory_info.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/theme.plist
===================================================================
--- branches/danielkza/artwork/themes/legacy/theme.plist (revision 0)
+++ branches/danielkza/artwork/themes/legacy/theme.plist (revision 389)
@@ -0,0 +1,106 @@
+
+
+
+
+ Enabled
+ no
+ screen_width
+ 1024
+ screen_height
+ 768
+ screen_textmargin_h
+ 10
+ screen_textmargin_v
+ 10
+ screen_bgcolor
+ #222334
+ background_pos_x
+ 50%
+ background_pos_y
+ 0
+ logo_pos_x
+
+ logo_pos_y
+ 3%
+ logo_bgcolor
+ #000000
+ logo_transparency
+ 255
+ devices_pos_x
+
+ devices_pos_y
+
+ devices_bgcolor
+ #222334
+ devices_transparency
+ 0
+ devices_max_visible
+ 5
+ devices_iconspacing
+ 20
+ devices_layout
+ horizontal
+ bootprompt_pos_x
+ %50
+ bootprompt_pos_y
+ -2
+ bootprompt_width
+ 50%
+ bootprompt_height
+ 20
+ bootprompt_textmargin_h
+ 10
+ bootprompt_textmargin_v
+ 5
+ bootprompt_bgcolor
+ #222334
+ bootprompt_transparency
+ 1
+ infobox_pos_x
+
+ infobox_pos_y
+
+ infobox_width
+ 650
+ infobox_height
+ 406
+ infobox_textmargin_h
+ 10
+ infobox_textmargin_v
+ 10
+ infobox_bgcolor
+ #222334
+ infobox_transparency
+ 10
+ menu_pos_x
+
+ menu_pos_y
+ -5%
+ menu_textmargin_h
+ 10
+ menu_textmargin_v
+ 5
+ menu_bgcolor
+ #222334
+ menu_transparency
+ 1
+ progressbar_pos_x
+
+ progressbar_pos_y
+ -30%
+ progressbar_width
+ 100
+ progressbar_height
+ 40
+ countdown_pos_x
+
+ countdown_pos_y
+ -20%
+ boot_width
+ 1024
+ boot_height
+ 768
+ boot_bgcolor
+ #AAAAAA
+
+
Index: branches/danielkza/artwork/themes/legacy/menu_selection.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_selection.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_scroll_prev.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_scroll_prev.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_scroll_next.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_scroll_next.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_help.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_help.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_ignore_caches.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_ignore_caches.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/background.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/background.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_verbose_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_verbose_disabled.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_cdrom.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_cdrom.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_boot.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_boot.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/progress_bar_background.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/progress_bar_background.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/font_console.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/font_console.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/progress_bar.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/progress_bar.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_ntfs.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_ntfs.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_fat.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_fat.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_verbose.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_verbose.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/menu_single_user_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/menu_single_user_disabled.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/artwork/themes/legacy/device_generic.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/danielkza/artwork/themes/legacy/device_generic.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: branches/danielkza/i386/libsaio/console.c
===================================================================
--- branches/danielkza/i386/libsaio/console.c (revision 388)
+++ branches/danielkza/i386/libsaio/console.c (revision 389)
@@ -52,6 +52,68 @@
bool gVerboseMode;
bool gErrors;
+/* Kabyl: BooterLog */
+#define BOOTER_LOG_SIZE (64 * 1024)
+#define SAFE_LOG_SIZE 80
+
+char *msgbuf = 0;
+char *cursor = 0;
+
+struct putc_info {
+ char * str;
+ char * last_str;
+};
+
+static void sputc(int c, struct putc_info * pi)
+{
+ if (pi->last_str)
+ if (pi->str == pi->last_str)
+ {
+ *(pi->str) = '\0';
+ return;
+ }
+ *(pi->str)++ = c;
+}
+
+void initBooterLog(void)
+{
+ msgbuf = malloc(BOOTER_LOG_SIZE);
+ bzero(msgbuf, BOOTER_LOG_SIZE);
+ cursor = msgbuf;
+}
+
+void msglog(const char * fmt, ...)
+{
+ va_list ap;
+ struct putc_info pi;
+
+ if (!msgbuf)
+ return;
+
+ if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE)))
+ return;
+
+ va_start(ap, fmt);
+ pi.str = cursor;
+ pi.last_str = 0;
+ prf(fmt, ap, sputc, &pi);
+ *pi.str = '\0';
+ va_end(ap);
+ cursor += (pi.str - cursor);
+}
+
+void setupBooterLog(void)
+{
+ if (!msgbuf)
+ return;
+
+ Node *node = DT__FindNode("/", false);
+ if (node)
+ DT__AddProperty(node, "boot-log", strlen((char *)msgbuf) + 1, msgbuf);
+}
+/* Kabyl: !BooterLog */
+
+
/*
* write one character to console
*/
@@ -103,6 +165,23 @@
prf(fmt, ap, putchar, 0);
else
vprf(fmt, ap);
+
+ {
+ /* Kabyl: BooterLog */
+ struct putc_info pi;
+
+ if (!msgbuf)
+ return 0;
+
+ if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE)))
+ return 0;
+ pi.str = cursor;
+ pi.last_str = 0;
+ prf(fmt, ap, sputc, &pi);
+ *pi.str = '\0';
+ cursor += (pi.str - cursor);
+ }
+
va_end(ap);
return 0;
}
@@ -111,15 +190,32 @@
{
va_list ap;
+ va_start(ap, fmt);
if (gVerboseMode)
{
- va_start(ap, fmt);
if (bootArgs->Video.v_display == VGA_TEXT_MODE)
prf(fmt, ap, putchar, 0);
else
vprf(fmt, ap);
- va_end(ap);
}
+
+ {
+ /* Kabyl: BooterLog */
+ struct putc_info pi;
+
+ if (!msgbuf)
+ return 0;
+
+ if (((cursor - msgbuf) > (BOOTER_LOG_SIZE - SAFE_LOG_SIZE)))
+ return 0;
+ pi.str = cursor;
+ pi.last_str = 0;
+ prf(fmt, ap, sputc, &pi);
+ *pi.str = '\0';
+ cursor += (pi.str - cursor);
+ }
+
+ va_end(ap);
return(0);
}
Index: branches/danielkza/i386/libsaio/ntfs_private.h
===================================================================
--- branches/danielkza/i386/libsaio/ntfs_private.h (revision 388)
+++ branches/danielkza/i386/libsaio/ntfs_private.h (revision 389)
@@ -275,7 +275,9 @@
cn_t bf_mftmirrcn; /* $MFTMirr cn */
u_int8_t bf_mftrecsz; /* MFT record size (clust) */
/* 0xF6 inducates 1/4 */
- u_int32_t bf_ibsz; /* index buffer size */
+ u_int8_t reserved5[3];
+ u_int8_t bf_ibsz; /* index buffer size */
+ u_int8_t reserved6[3];
u_int64_t bf_volsn; /* volume ser. num. */
};
Index: branches/danielkza/i386/libsaio/acpi_patcher.c
===================================================================
--- branches/danielkza/i386/libsaio/acpi_patcher.c (revision 388)
+++ branches/danielkza/i386/libsaio/acpi_patcher.c (revision 389)
@@ -386,8 +386,7 @@
get_acpi_cpu_names((void*)dsdt, dsdt->Length);
if (acpi_cpu_count > 0)
- {
-
+ {
struct p_state initial, maximum, minimum, p_states[32];
uint8_t p_states_count = 0;
@@ -397,9 +396,11 @@
{
switch (Platform.CPU.Model)
{
- case 0x0F: // Intel Core (65nm)
- case 0x17: // Intel Core (45nm)
- case 0x1C: // Intel Atom (45nm)
+ case 0x0D: // ?
+ case CPU_MODEL_YONAH: // Yonah
+ case CPU_MODEL_MEROM: // Merom
+ case CPU_MODEL_PENRYN: // Penryn
+ case CPU_MODEL_ATOM: // Intel Atom (45nm)
{
bool cpu_dynamic_fsb = false;
@@ -515,12 +516,13 @@
p_states_count -= invalid;
}
} break;
- case 0x1A: // Intel Core i7 LGA1366 (45nm)
- case 0x1E: // Intel Core i5, i7 LGA1156 (45nm)
- case 0x1F:
- case 0x25: // Intel Core i3, i5, i7 LGA1156 (32nm)
- case 0x2C: // Intel Core i7 LGA1366 (32nm) 6 Core
- case 0x2F:
+ case CPU_MODEL_FIELDS:
+ case CPU_MODEL_DALES:
+ case CPU_MODEL_DALES_32NM:
+ case CPU_MODEL_NEHALEM:
+ case CPU_MODEL_NEHALEM_EX:
+ case CPU_MODEL_WESTMERE:
+ case CPU_MODEL_WESTMERE_EX:
default:
verbose ("Unsupported CPU: P-States not generated !!!\n");
break;
@@ -529,7 +531,6 @@
}
// Generating SSDT
-
if (p_states_count > 0)
{
int i;
Index: branches/danielkza/i386/libsaio/spd.c
===================================================================
--- branches/danielkza/i386/libsaio/spd.c (revision 388)
+++ branches/danielkza/i386/libsaio/spd.c (revision 389)
@@ -317,7 +317,7 @@
slot->Frequency = freq;
}
- printf("Slot: %d Type %d %dMB (%s) %dMHz Vendor=%s\n PartNo=%s SerialNo=%s\n",
+ verbose("Slot: %d Type %d %dMB (%s) %dMHz Vendor=%s\n PartNo=%s SerialNo=%s\n",
i,
(int)slot->Type,
slot->ModuleSize,
Index: branches/danielkza/i386/libsaio/smbios_patcher.c
===================================================================
--- branches/danielkza/i386/libsaio/smbios_patcher.c (revision 388)
+++ branches/danielkza/i386/libsaio/smbios_patcher.c (revision 389)
@@ -10,6 +10,7 @@
#include "fake_efi.h"
#include "platform.h"
#include "smbios_patcher.h"
+#include "pci.h"
#ifndef DEBUG_SMBIOS
#define DEBUG_SMBIOS 0
@@ -88,34 +89,49 @@
// defaults for a Mac Pro
static const SMStrEntryPair const sm_macpro_defaults[]={
- {"SMbiosvendor", "Apple Computer, Inc." },
- {"SMbiosversion", "MP31.88Z.006C.B05.0802291410" },
- {"SMbiosdate", "04/01/2008" },
- {"SMmanufacter", "Apple Computer, Inc." },
- {"SMproductname", "MacPro3,1" },
- {"SMsystemversion", "1.0" },
- {"SMserial", "SOMESRLNMBR" },
- {"SMfamily", "MacPro" },
- {"SMboardmanufacter", "Apple Computer, Inc." },
- {"SMboardproduct", "Mac-F4208DC8" },
+ {"SMbiosvendor", "Apple Computer, Inc." },
+ {"SMbiosversion", "MP31.88Z.006C.B05.0802291410" },
+ {"SMbiosdate", "04/01/2008" },
+ {"SMmanufacter", "Apple Computer, Inc." },
+ {"SMproductname", "MacPro3,1" },
+ {"SMsystemversion", "1.0" },
+ {"SMserial", "SOMESRLNMBR" },
+ {"SMfamily", "MacPro" },
+ {"SMboardmanufacter", "Apple Computer, Inc." },
+ {"SMboardproduct", "Mac-F4208DC8" },
{ "","" }
};
-// defaults for an iMac11,1 core i5/i7
-static const SMStrEntryPair const sm_imacCore_i5_i7_defaults[]={
- {"SMbiosvendor", "Apple Inc." },
- {"SMbiosversion", "IM111.0034.B00" },
- {"SMbiosdate", "06/01/2009" },
- {"SMmanufacter", "Apple Inc." },
- {"SMproductname", "iMac11,1" },
- {"SMsystemversion", "1.0" },
- {"SMserial", "SOMESRLNMBR" },
- {"SMfamily", "iMac" },
- {"SMboardmanufacter","Apple Computer, Inc." },
- {"SMboardproduct", "Mac-F2268DAE" },
+// defaults for an iMac11,1 core i3/i5/i7
+static const SMStrEntryPair const sm_imac_core_defaults[]={
+ {"SMbiosvendor", "Apple Inc." },
+ {"SMbiosversion", "IM111.88Z.0034.B00.0802091538" },
+ {"SMbiosdate", "06/01/2009" },
+ {"SMmanufacter", "Apple Inc." },
+ {"SMproductname", "iMac11,1" },
+ {"SMsystemversion", "1.0" },
+ {"SMserial", "SOMESRLNMBR" },
+ {"SMfamily", "iMac" },
+ {"SMboardmanufacter", "Apple Computer, Inc." },
+ {"SMboardproduct", "Mac-F2268DAE" },
{ "","" }
};
+// defaults for a Mac Pro 4,1 core i7/Xeon
+static const SMStrEntryPair const sm_macpro_core_defaults[]={
+ {"SMbiosvendor", "Apple Computer, Inc." },
+ {"SMbiosversion", "MP41.88Z.0081.B04.0903051113" },
+ {"SMbiosdate", "11/06/2009" },
+ {"SMmanufacter", "Apple Computer, Inc." },
+ {"SMproductname", "MacPro4,1" },
+ {"SMsystemversion", "1.0" },
+ {"SMserial", "SOMESRLNMBR" },
+ {"SMfamily", "MacPro" },
+ {"SMboardmanufacter", "Apple Computer, Inc." },
+ {"SMboardproduct", "Mac-F4208DC8" },
+ { "","" }
+};
+
static const char* sm_get_defstr(const char * key, int table_num)
{
int i;
@@ -144,11 +160,18 @@
{
switch (Platform.CPU.Model)
{
- case 0x19: // Intel Core i5 650
- case 0x1E: // Intel Core i7 LGA1156 (45nm)
- case 0x1F: // Intel Core i5 LGA1156 (45nm)
- sm_defaults=sm_imacCore_i5_i7_defaults;
+ case CPU_MODEL_FIELDS: // Intel Core i5, i7 LGA1156 (45nm)
+ case CPU_MODEL_DALES: // Intel Core i5, i7 LGA1156 (45nm) ???
+ case CPU_MODEL_DALES_32NM: // Intel Core i3, i5, i7 LGA1156 (32nm) (Clarkdale, Arrandale)
+ case 0x19: // Intel Core i5 650 @3.20 Ghz
+ sm_defaults=sm_imac_core_defaults;
break;
+ case CPU_MODEL_NEHALEM:
+ case CPU_MODEL_NEHALEM_EX:
+ case CPU_MODEL_WESTMERE:
+ case CPU_MODEL_WESTMERE_EX:
+ sm_defaults=sm_macpro_core_defaults;
+ break;
default:
sm_defaults=sm_macpro_defaults;
break;
@@ -186,20 +209,6 @@
return Platform.CPU.CPUFrequency/1000000;
}
-static int sm_get_simplecputype()
-{
- if (Platform.CPU.NoCores >= 4)
- {
- return 0x0501; // Quad-Core Xeon
- }
- else if (Platform.CPU.NoCores == 1)
- {
- return 0x0201; // Core Solo
- };
-
- return 0x0301; // Core 2 Duo
-}
-
static int sm_get_bus_speed (const char *name, int table_num)
{
if (Platform.CPU.Vendor == 0x756E6547) // Intel
@@ -210,21 +219,65 @@
{
switch (Platform.CPU.Model)
{
- case 0x0F: // Intel Core (65nm)
- case 0x17: // Intel Core (45nm)
- case 0x1C: // Intel Atom (45nm)
+ case 0x0D: // ?
+ case CPU_MODEL_YONAH: // Yonah 0x0E
+ case CPU_MODEL_MEROM: // Merom 0x0F
+ case CPU_MODEL_PENRYN: // Penryn 0x17
+ case CPU_MODEL_ATOM: // Atom 45nm 0x1C
return 0; // TODO: populate bus speed for these processors
+
+// case CPU_MODEL_FIELDS: // Intel Core i5, i7 LGA1156 (45nm)
+// if (strstr(Platform.CPU.BrandString, "Core(TM) i5"))
+// return 2500; // Core i5
+// return 4800; // Core i7
+
+// case CPU_MODEL_NEHALEM: // Intel Core i7 LGA1366 (45nm)
+// case CPU_MODEL_NEHALEM_EX:
+// case CPU_MODEL_DALES: // Intel Core i5, i7 LGA1156 (45nm) ???
+// return 4800; // GT/s / 1000
+//
+ case CPU_MODEL_WESTMERE_EX: // Intel Core i7 LGA1366 (45nm) 6 Core ???
+ return 0; // TODO: populate bus speed for these processors
+
+// case 0x19: // Intel Core i5 650 @3.20 Ghz
+// return 2500; // why? Intel spec says 2.5GT/s
+
case 0x19: // Intel Core i5 650 @3.20 Ghz
- return 3600; // GT/s / 1000
- case 0x1A: // Intel Core i7 LGA1366 (45nm)
- case 0x1E: // Intel Core i5, i7 LGA1156 (45nm)
- case 0x1F: // Intel Core i5, i7 LGA1156 (45nm) ???
- return 4800; // GT/s / 1000
- case 0x25: // Intel Core i3, i5, i7 LGA1156 (32nm)
- return 0; // TODO: populate bus speed for these processors
- case 0x2C: // Intel Core i7 LGA1366 (32nm) 6 Core
- case 0x2E: // Intel Core i7 LGA1366 (45nm) 6 Core ???
- return 0; // TODO: populate bus speed for these processors
+ case CPU_MODEL_NEHALEM: // Intel Core i7 LGA1366 (45nm)
+ case CPU_MODEL_FIELDS: // Intel Core i5, i7 LGA1156 (45nm)
+ case CPU_MODEL_DALES: // Intel Core i5, i7 LGA1156 (45nm) ???
+ case CPU_MODEL_DALES_32NM: // Intel Core i3, i5, i7 LGA1156 (32nm)
+ case CPU_MODEL_WESTMERE: // Intel Core i7 LGA1366 (32nm) 6 Core
+ case CPU_MODEL_NEHALEM_EX: // Intel Core i7 LGA1366 (45nm) 6 Core ???
+ { // thanks to dgobe for i3/i5/i7 bus speed detection
+ int nhm_bus = 0x3F;
+ static long possible_nhm_bus[] = {0xFF, 0x7F, 0x3F};
+ unsigned long did, vid;
+ int i;
+
+ // Nehalem supports Scrubbing
+ // First, locate the PCI bus where the MCH is located
+ for(i = 0; i < sizeof(possible_nhm_bus); i++)
+ {
+ vid = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), 0x00);
+ did = pci_config_read16(PCIADDR(possible_nhm_bus[i], 3, 4), 0x02);
+ vid &= 0xFFFF;
+ did &= 0xFF00;
+
+ if(vid == 0x8086 && did >= 0x2C00)
+ nhm_bus = possible_nhm_bus[i];
+ }
+
+ unsigned long qpimult, qpibusspeed;
+ qpimult = pci_config_read32(PCIADDR(nhm_bus, 2, 1), 0x50);
+ qpimult &= 0x7F;
+ DBG("qpimult %d\n", qpimult);
+ qpibusspeed = (qpimult * 2 * (Platform.CPU.FSBFrequency/1000000));
+ // Rek: rounding decimals to match original mac profile info
+ if (qpibusspeed%100 != 0)qpibusspeed = ((qpibusspeed+50)/100)*100;
+ DBG("qpibusspeed %d\n", qpibusspeed);
+ return qpibusspeed;
+ }
}
}
}
@@ -232,6 +285,20 @@
return 0;
}
+static int sm_get_simplecputype()
+{
+ if (Platform.CPU.NoCores >= 4)
+ {
+ return 0x0501; // Quad-Core Xeon
+ }
+ else if (Platform.CPU.NoCores == 1)
+ {
+ return 0x0201; // Core Solo
+ };
+
+ return 0x0301; // Core 2 Duo
+}
+
static int sm_get_cputype (const char *name, int table_num)
{
static bool done = false;
@@ -239,7 +306,7 @@
if (Platform.CPU.Vendor == 0x756E6547) // Intel
{
if (!done) {
- verbose("CPU is Intel, family 0x%x, model 0x%x, ext.model 0x%x\n", Platform.CPU.Family, Platform.CPU.Model, Platform.CPU.ExtModel);
+ verbose("CPU is %s, family 0x%x, model 0x%x\n", Platform.CPU.BrandString, Platform.CPU.Family, Platform.CPU.Model);
done = true;
}
@@ -249,23 +316,39 @@
{
switch (Platform.CPU.Model)
{
- case 0x0F: // Intel Core (65nm)
- case 0x17: // Intel Core (45nm)
- case 0x1C: // Intel Atom (45nm)
+ case 0x0D: // ?
+ case CPU_MODEL_YONAH: // Yonah
+ case CPU_MODEL_MEROM: // Merom
+ case CPU_MODEL_PENRYN: // Penryn
+ case CPU_MODEL_ATOM: // Intel Atom (45nm)
return sm_get_simplecputype();
- case 0x1A: // Intel Core i7 LGA1366 (45nm)
- return 0x0701;
- case 0x1E: // Intel Core i5, i7 LGA1156 (45nm)
- // get this opportunity to fill the known processor interconnect speed for cor i5/i7 in GT/s
- return 0x0701;
+
+ case CPU_MODEL_NEHALEM: // Intel Core i7 LGA1366 (45nm)
+ return 0x0701; // Core i7
+
+ case CPU_MODEL_FIELDS: // Lynnfield, Clarksfield, Jasper
+ if (strstr(Platform.CPU.BrandString, "Core(TM) i5"))
+ return 0x601; // Core i5
+ return 0x701; // Core i7
+
+ case CPU_MODEL_DALES: // Intel Core i5, i7 LGA1156 (45nm) (Havendale, Auburndale)
+ if (strstr(Platform.CPU.BrandString, "Core(TM) i5"))
+ return 0x601; // Core i5
+ return 0x0701; // Core i7
+
+ case CPU_MODEL_DALES_32NM: // Intel Core i3, i5, i7 LGA1156 (32nm) (Clarkdale, Arrandale)
+ if (strstr(Platform.CPU.BrandString, "Core(TM) i3"))
+ return 0x901; // Core i3
+ if (strstr(Platform.CPU.BrandString, "Core(TM) i5"))
+ return 0x601; // Core i5
+ return 0x0701; // Core i7
+
+ case CPU_MODEL_WESTMERE: // Intel Core i7 LGA1366 (32nm) 6 Core (Gulftown, Westmere-EP, Westmere-WS)
+ case CPU_MODEL_WESTMERE_EX: // Intel Core i7 LGA1366 (45nm) 6 Core ???
+ return 0x0701; // Core i7
+
case 0x19: // Intel Core i5 650 @3.20 Ghz
- case 0x1F: // Intel Core i5, i7 LGA1156 (45nm) ???
- return 0x0601;
- case 0x25: // Intel Core i3, i5, i7 LGA1156 (32nm)
- return 0x0301;
- case 0x2C: // Intel Core i7 LGA1366 (32nm) 6 Core
- case 0x2E: // Intel Core i7 LGA1366 (45nm) 6 Core ???
- return 0x0601;
+ return 0x601; // Core i5
}
}
}
Index: branches/danielkza/i386/libsaio/ntfs.c
===================================================================
--- branches/danielkza/i386/libsaio/ntfs.c (revision 388)
+++ branches/danielkza/i386/libsaio/ntfs.c (revision 389)
@@ -300,7 +300,7 @@
bool NTFSProbe(const void*);
struct bootfile *boot;
- void *buf = malloc(MAX_CLUSTER_SIZE);
+ void *buf = malloc(MAX_BLOCK_SIZE);
if (!buf)
return -1;
@@ -313,14 +313,17 @@
Seek(ih, 0);
Read(ih, (long)buf, MAX_BLOCK_SIZE);
- if(!NTFSProbe(buf))
+ boot = (struct bootfile *) buf;
+
+ // Check for NTFS signature
+ if ( memcmp((void*)boot->bf_sysid, NTFS_BBID, NTFS_BBIDLEN) != 0 )
return -1;
- boot = (struct bootfile *) buf;
+ // Check for non-null volume serial number
if(!boot->bf_volsn)
return -1;
-
- return CreateUUIDString((uint8_t*)(&boot->bf_volsn), sizeof(boot->bf_volsn), uuidStr);
+
+ return CreateUUIDString((uint8_t*)&(boot->bf_volsn), sizeof(boot->bf_volsn), uuidStr);
}
bool NTFSProbe(const void * buffer)
@@ -334,6 +337,4 @@
result = true;
return result;
-}
-
-
+}
\ No newline at end of file
Index: branches/danielkza/i386/libsaio/nvidia.c
===================================================================
--- branches/danielkza/i386/libsaio/nvidia.c (revision 388)
+++ branches/danielkza/i386/libsaio/nvidia.c (revision 389)
@@ -663,20 +663,43 @@
return 0;
}
+unsigned long long mem_detect(volatile uint8_t *regs, uint8_t nvCardType, pci_dt_t *nvda_dev)
+{
+ unsigned long long vram_size = 0;
+
+ if (nvCardType < NV_ARCH_50) {
+ vram_size = REG32(NV04_PFB_FIFO_DATA);
+ vram_size &= NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK;
+ }
+ else if (nvCardType >= NV_ARCH_C0) {
+ vram_size = REG32(NVC0_MEM_CTRLR_COUNT);
+ vram_size *= REG32(NVC0_MEM_CTRLR_RAM_AMOUNT);
+ vram_size <<= 20;
+ }
+ else {
+ vram_size = REG32(NV04_PFB_FIFO_DATA);
+ vram_size |= (vram_size & 0xff) << 32;
+ vram_size &= 0xffffffff00ll;
+ }
+
+ return vram_size;
+}
+
bool setup_nvidia_devprop(pci_dt_t *nvda_dev)
{
struct DevPropDevice *device;
- char *devicepath;
+ char *devicepath;
struct pci_rom_pci_header_t *rom_pci_header;
- volatile uint8_t *regs;
+ volatile uint8_t *regs;
uint8_t *rom;
uint8_t *nvRom;
- uint32_t videoRam;
+ uint8_t nvCardType;
+ unsigned long long videoRam;
uint32_t nvBiosOveride;
uint32_t bar[7];
uint32_t boot_display;
- int nvPatch;
- int len;
+ int nvPatch;
+ int len;
char biosVersion[32];
char nvFilename[32];
char kNVCAP[12];
@@ -687,31 +710,20 @@
devicepath = get_pci_dev_path(nvda_dev);
bar[0] = pci_config_read32(nvda_dev->dev.addr, 0x10 );
regs = (uint8_t *) (bar[0] & ~0x0f);
+
+ delay(50);
+
+ // get card type
+ nvCardType = (REG32(0) >> 20) & 0x1ff;
// Amount of VRAM in kilobytes
- videoRam = (REG32(0x10020c) & 0xfff00000) >> 10;
+ videoRam = mem_detect(regs, nvCardType, nvda_dev);
model = get_nvidia_model((nvda_dev->vendor_id << 16) | nvda_dev->device_id);
-
- // FIXME: dirty fermi hack
- if((nvda_dev->device_id & 0xFFE0) == 0x06C0 ||
- (nvda_dev->device_id & 0xFFE0) == 0x0E20) {
- switch (nvda_dev->device_id) {
- case 0x06C0: videoRam = 1572864; break; // gtx 480
- case 0x06CD: videoRam = 1310720; break; // gtx 470
- case 0x06C4: videoRam = 1048576; break; // gtx 465
- case 0x06CA: videoRam = 2097152; break; // gtx 480m
- case 0x0E22: videoRam = 1048576; break; // gtx 460
- case 0x0E24: videoRam = 1048576; break; // gtx 460
- case 0x06D1: videoRam = 3145728; break; // tesla c2050/c2070
- case 0x06DE: videoRam = 3145728; break; // tesla m2050/m2070
- default: break;
- }
- }
verbose("nVidia %s %dMB NV%02x [%04x:%04x] :: %s\n",
- model, (videoRam / 1024),
- (REG32(0) >> 20) & 0x1ff, nvda_dev->vendor_id, nvda_dev->device_id,
- devicepath);
+ model, (uint32_t)(videoRam / 1024 / 1024),
+ (REG32(0) >> 20) & 0x1ff, nvda_dev->vendor_id, nvda_dev->device_id,
+ devicepath);
rom = malloc(NVIDIA_ROM_SIZE);
sprintf(nvFilename, "/Extra/%04x_%04x.rom", (uint16_t)nvda_dev->vendor_id, (uint16_t)nvda_dev->device_id);
@@ -797,10 +809,41 @@
uint8_t built_in = 0x01;
devprop_add_value(device, "@0,built-in", &built_in, 1);
}
+
+ // get bios version
+ const int MAX_BIOS_VERSION_LENGTH = 32;
+ char* version_str = (char*)malloc(MAX_BIOS_VERSION_LENGTH);
+ memset(version_str, 0, MAX_BIOS_VERSION_LENGTH);
+ int i, version_start;
+ int crlf_count = 0;
+ // only search the first 384 bytes
+ for(i = 0; i < 0x180; i++) {
+ if(rom[i] == 0x0D && rom[i+1] == 0x0A) {
+ crlf_count++;
+ // second 0x0D0A was found, extract bios version
+ if(crlf_count == 2) {
+ if(rom[i-1] == 0x20) i--; // strip last " "
+ for(version_start = i; version_start > (i-MAX_BIOS_VERSION_LENGTH); version_start--) {
+ // find start
+ if(rom[version_start] == 0x00) {
+ version_start++;
+
+ // strip "Version "
+ if(strncmp((const char*)rom+version_start, "Version ", 8) == 0) {
+ version_start += 8;
+ }
+
+ strncpy(version_str, (const char*)rom+version_start, i-version_start);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ sprintf(biosVersion, "%s", (nvBiosOveride > 0) ? nvFilename : version_str);
- videoRam *= 1024;
- sprintf(biosVersion, "xx.xx.xx - %s", (nvBiosOveride > 0) ? nvFilename : "internal");
-
sprintf(kNVCAP, "NVCAP_%04x", nvda_dev->device_id);
if (getValueForKey(kNVCAP, &value, &len, &bootInfo->bootConfig) && len == NVCAP_LEN * 2) {
uint8_t new_NVCAP[NVCAP_LEN];
Index: branches/danielkza/i386/libsaio/nvidia.h
===================================================================
--- branches/danielkza/i386/libsaio/nvidia.h (revision 388)
+++ branches/danielkza/i386/libsaio/nvidia.h (revision 389)
@@ -67,10 +67,15 @@
uint8_t size; /* Size in multiples of 512 */
};
-#define NV_PROM_OFFSET 0x300000
-#define NV_PROM_SIZE 0x0000ffff
-#define NV_PRAMIN_OFFSET 0x00700000
-#define NV_PRAMIN_SIZE 0x00100000
+#define NV_PROM_OFFSET 0x300000
+#define NV_PROM_SIZE 0x0000ffff
+#define NV_PRAMIN_OFFSET 0x00700000
+#define NV_PRAMIN_SIZE 0x00100000
+#define NV04_PFB_FIFO_DATA 0x0010020c
+#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_MASK 0xfff00000
+#define NV10_PFB_FIFO_DATA_RAM_AMOUNT_MB_SHIFT 20
+#define NVC0_MEM_CTRLR_COUNT 0x00121c74
+#define NVC0_MEM_CTRLR_RAM_AMOUNT 0x0010f20c
#define NV_PBUS_PCI_NV_20 0x00001850
#define NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED (0 << 0)
@@ -87,6 +92,7 @@
#define NV_ARCH_30 0x30
#define NV_ARCH_40 0x40
#define NV_ARCH_50 0x50
+#define NV_ARCH_C0 0xC0
#define CHIPSET_NV03 0x0010
#define CHIPSET_NV04 0x0020
Index: branches/danielkza/i386/libsaio/cpu.c
===================================================================
--- branches/danielkza/i386/libsaio/cpu.c (revision 388)
+++ branches/danielkza/i386/libsaio/cpu.c (revision 389)
@@ -14,7 +14,7 @@
#if DEBUG_CPU
#define DBG(x...) printf(x)
#else
-#define DBG(x...)
+#define DBG(x...) msglog(x)
#endif
/*
@@ -120,6 +120,8 @@
}
#endif
p->CPU.Vendor = p->CPU.CPUID[CPUID_0][1];
+ p->CPU.Signature = p->CPU.CPUID[CPUID_1][0];
+ p->CPU.Stepping = bitfield(p->CPU.CPUID[CPUID_1][0], 3, 0);
p->CPU.Model = bitfield(p->CPU.CPUID[CPUID_1][0], 7, 4);
p->CPU.Family = bitfield(p->CPU.CPUID[CPUID_1][0], 11, 8);
p->CPU.ExtModel = bitfield(p->CPU.CPUID[CPUID_1][0], 19, 16);
@@ -128,7 +130,37 @@
p->CPU.NoCores = bitfield(p->CPU.CPUID[CPUID_4][0], 31, 26) + 1;
p->CPU.Model += (p->CPU.ExtModel << 4);
-
+
+ /* get brand string (if supported) */
+ /* Copyright: from Apple's XNU cpuid.c */
+ if (p->CPU.CPUID[CPUID_80][0] > 0x80000004) {
+ uint32_t reg[4];
+ char str[128], *s;
+ /*
+ * The brand string 48 bytes (max), guaranteed to
+ * be NUL terminated.
+ */
+ do_cpuid(0x80000002, reg);
+ bcopy((char *)reg, &str[0], 16);
+ do_cpuid(0x80000003, reg);
+ bcopy((char *)reg, &str[16], 16);
+ do_cpuid(0x80000004, reg);
+ bcopy((char *)reg, &str[32], 16);
+ for (s = str; *s != '\0'; s++) {
+ if (*s != ' ') break;
+ }
+
+ strlcpy(p->CPU.BrandString, s, sizeof(p->CPU.BrandString));
+
+ if (!strncmp(p->CPU.BrandString, CPU_STRING_UNKNOWN, min(sizeof(p->CPU.BrandString), strlen(CPU_STRING_UNKNOWN) + 1))) {
+ /*
+ * This string means we have a firmware-programmable brand string,
+ * and the firmware couldn't figure out what sort of CPU we have.
+ */
+ p->CPU.BrandString[0] = '\0';
+ }
+ }
+
/* setup features */
if ((bit(23) & p->CPU.CPUID[CPUID_1][3]) != 0) {
p->CPU.Features |= CPU_FEATURE_MMX;
@@ -265,7 +297,7 @@
p->CPU.TSCFrequency = tscFrequency;
p->CPU.FSBFrequency = fsbFrequency;
p->CPU.CPUFrequency = cpuFrequency;
-#if DEBUG_CPU
+
DBG("CPU: Vendor/Model/ExtModel: 0x%x/0x%x/0x%x\n", p->CPU.Vendor, p->CPU.Model, p->CPU.ExtModel);
DBG("CPU: Family/ExtFamily: 0x%x/0x%x\n", p->CPU.Family, p->CPU.ExtFamily);
DBG("CPU: MaxCoef/CurrCoef: 0x%x/0x%x\n", p->CPU.MaxCoef, p->CPU.CurrCoef);
@@ -275,6 +307,7 @@
DBG("CPU: CPUFreq: %dMHz\n", p->CPU.CPUFrequency / 1000000);
DBG("CPU: NoCores/NoThreads: %d/%d\n", p->CPU.NoCores, p->CPU.NoThreads);
DBG("CPU: Features: 0x%08x\n", p->CPU.Features);
+#if DEBUG_CPU
pause();
#endif
}
Index: branches/danielkza/i386/libsaio/platform.h
===================================================================
--- branches/danielkza/i386/libsaio/platform.h (revision 388)
+++ branches/danielkza/i386/libsaio/platform.h (revision 389)
@@ -23,6 +23,18 @@
#define CPUID_81 6
#define CPUID_MAX 7
+#define CPU_MODEL_YONAH 0x0E
+#define CPU_MODEL_MEROM 0x0F
+#define CPU_MODEL_PENRYN 0x17
+#define CPU_MODEL_NEHALEM 0x1A
+#define CPU_MODEL_ATOM 0x1C
+#define CPU_MODEL_FIELDS 0x1E /* Lynnfield, Clarksfield, Jasper */
+#define CPU_MODEL_DALES 0x1F /* Havendale, Auburndale */
+#define CPU_MODEL_DALES_32NM 0x25 /* Clarkdale, Arrandale */
+#define CPU_MODEL_WESTMERE 0x2C /* Gulftown, Westmere-EP, Westmere-WS */
+#define CPU_MODEL_NEHALEM_EX 0x2E
+#define CPU_MODEL_WESTMERE_EX 0x2F
+
/* CPU Features */
#define CPU_FEATURE_MMX 0x00000001 // MMX Instruction Set
#define CPU_FEATURE_SSE 0x00000002 // SSE Instruction Set
@@ -36,9 +48,9 @@
#define CPU_FEATURE_MSR 0x00000200 // MSR Support
/* SMBIOS Memory Types */
-#define SMB_MEM_TYPE_UNDEFINED 0
+#define SMB_MEM_TYPE_UNDEFINED 0
#define SMB_MEM_TYPE_OTHER 1
-#define SMB_MEM_TYPE_UNKNOWN 2
+#define SMB_MEM_TYPE_UNKNOWN 2
#define SMB_MEM_TYPE_DRAM 3
#define SMB_MEM_TYPE_EDRAM 4
#define SMB_MEM_TYPE_VRAM 5
@@ -93,6 +105,8 @@
struct CPU {
uint32_t Features; // CPU Features like MMX, SSE2, VT, MobileCPU
uint32_t Vendor; // Vendor
+ uint32_t Signature; // Signature
+ uint32_t Stepping; // Stepping
uint32_t Model; // Model
uint32_t ExtModel; // Extended Model
uint32_t Family; // Family
@@ -106,7 +120,7 @@
uint64_t TSCFrequency; // TSC Frequency Hz
uint64_t FSBFrequency; // FSB Frequency Hz
uint64_t CPUFrequency; // CPU Frequency Hz
- uint32_t BrandString[16]; // 48 Byte Branding String
+ char BrandString[48]; // 48 Byte Branding String
uint32_t CPUID[CPUID_MAX][4]; // CPUID 0..4, 80..81 Raw Values
} CPU;
@@ -120,7 +134,7 @@
uint8_t Channels; // Channel Configuration Single,Dual or Triple
uint8_t NoSlots; // Maximum no of slots available
uint8_t Type; // Standard SMBIOS v2.5 Memory Type
- RamSlotInfo_t DIMM[MAX_RAM_SLOTS]; // Information about each slot
+ RamSlotInfo_t DIMM[MAX_RAM_SLOTS]; // Information about each slot
} RAM;
struct DMI {
Index: branches/danielkza/i386/libsaio/disk.c
===================================================================
--- branches/danielkza/i386/libsaio/disk.c (revision 388)
+++ branches/danielkza/i386/libsaio/disk.c (revision 389)
@@ -80,7 +80,6 @@
#include "efi.h"
#include "efi_tables.h"
-#define BPS 512 /* sector size of the device */
#define PROBEFS_SIZE BPS * 4 /* buffer size for filesystem probe */
#define CD_BPS 2048 /* CD-ROM block size */
#define N_CACHE_SECS (BIOS_LEN / BPS) /* Must be a multiple of 4 for CD-ROMs */
@@ -1717,7 +1716,6 @@
if(temp && bvr->description) {
bvr->description(bvr, temp, 63);
printf("Volume: UUID=%s, Label=%s\n", testStr, temp);
- pause();
}
}
Index: branches/danielkza/i386/libsaio/cpu.h
===================================================================
--- branches/danielkza/i386/libsaio/cpu.h (revision 388)
+++ branches/danielkza/i386/libsaio/cpu.h (revision 389)
@@ -14,6 +14,8 @@
#define bitmask(h,l) ((bit(h)|(bit(h)-1)) & ~(bit(l)-1))
#define bitfield(x,h,l) (((x) & bitmask(h,l)) >> l)
+#define CPU_STRING_UNKNOWN "Unknown CPU Typ"
+
#define MSR_IA32_PERF_STATUS 0x198
#define MSR_IA32_PERF_CONTROL 0x199
#define MSR_IA32_EXT_CONFIG 0x00EE
Index: branches/danielkza/i386/libsaio/saio_types.h
===================================================================
--- branches/danielkza/i386/libsaio/saio_types.h (revision 388)
+++ branches/danielkza/i386/libsaio/saio_types.h (revision 389)
@@ -147,6 +147,7 @@
char * i_buf; /* file load address */
};
+#define BPS 512 /* sector size of the device */
#define F_READ 0x1 /* file opened for reading */
#define F_WRITE 0x2 /* file opened for writing */
#define F_ALLOC 0x4 /* buffer allocated */
Index: branches/danielkza/i386/libsaio/msdos.c
===================================================================
--- branches/danielkza/i386/libsaio/msdos.c (revision 388)
+++ branches/danielkza/i386/libsaio/msdos.c (revision 389)
@@ -54,8 +54,7 @@
#include "msdos.h"
#define LABEL_LENGTH 11
-#define MAX_DOS_BLOCKSIZE 2048
-#define MAX_CACHE_BLOCKSIZE 32768
+#define MSDOS_CACHE_BLOCKSIZE BPS
#define CLUST_FIRST 2/* reserved cluster range */
#define CLUST_RSRVD32 0x0ffffff8 /* reserved cluster range */
@@ -75,7 +74,6 @@
static CICell msdoscurrent = 0;
static int msdosrootcluster = 0;
static int msdosfatbits = 0;
-static int msdosCacheBlockSize = 0;
#if UNUSED
/*
@@ -153,7 +151,7 @@
if (msdoscurrent == ih)
{
- CacheInit(ih, msdosCacheBlockSize);
+ CacheInit(ih, MSDOS_CACHE_BLOCKSIZE);
return 0;
}
@@ -223,26 +221,34 @@
msdosclustersize = msdosbps * spc;
msdoscurrent = ih;
-
- msdosCacheBlockSize = (msdosclustersize > MAX_CACHE_BLOCKSIZE) ? msdosclustersize : MAX_CACHE_BLOCKSIZE;
- CacheInit(ih, msdosCacheBlockSize);
+
+ CacheInit(ih, MSDOS_CACHE_BLOCKSIZE);
free (buf);
return 0;
}
static int
-readSectorAligned(CICell ih, off_t readOffset, char *buf, int size)
+readSector(CICell ih, off_t readOffset, char *buf, int size)
{
- long long sectorOffset = (uint64_t)readOffset / msdosCacheBlockSize * msdosCacheBlockSize;
- long relOffset = readOffset % msdosCacheBlockSize;
- char *cacheBuffer;
+ // Caching only FAT entries (4 bytes) by utlizing the cache with sector aligned read requests.
+ if (size < BPS)
+ {
+ long long sectorOffset = (uint64_t)readOffset / BPS * BPS;
+ long relOffset = readOffset % BPS;
+ char *cacheBuffer;
+
+ cacheBuffer = malloc(MSDOS_CACHE_BLOCKSIZE);
+ CacheRead(ih, cacheBuffer, sectorOffset, MSDOS_CACHE_BLOCKSIZE, true);
+ bcopy(cacheBuffer + relOffset, buf, size);
+ free(cacheBuffer);
+ }
+ else
+ {
+ Seek(ih, readOffset);
+ Read(ih, (long)buf, size);
+ }
- cacheBuffer = malloc(msdosCacheBlockSize);
- CacheRead(ih, cacheBuffer, sectorOffset, msdosCacheBlockSize, true);
- bcopy(cacheBuffer + relOffset, buf, size);
- free(cacheBuffer);
-
- return 0;
+ return 0;
}
static int
@@ -281,7 +287,8 @@
/* Read in "cluster" */
if (buf)
{
- readSectorAligned(ih, readOffset, (char *)buf, size);
+ Seek(ih, readOffset);
+ Read(ih, (long)buf, size);
}
/* Find first sector of FAT */
@@ -291,7 +298,7 @@
readOffset += ((uint64_t)*cluster * (uint64_t)msdosfatbits) / 8;
/* Read one sector of the FAT */
- readSectorAligned(ih, readOffset, tmpbuf, 4);
+ readSector(ih, readOffset, tmpbuf, 4);
switch (msdosfatbits) {
case 32:
Index: branches/danielkza/i386/libsaio/saio_internal.h
===================================================================
--- branches/danielkza/i386/libsaio/saio_internal.h (revision 388)
+++ branches/danielkza/i386/libsaio/saio_internal.h (revision 389)
@@ -89,8 +89,11 @@
/* console.c */
extern bool gVerboseMode;
extern bool gErrors;
+extern void initBooterLog(void);
+extern void setupBooterLog(void);
extern void putchar(int ch);
extern int getchar(void);
+extern void msglog(const char * format, ...);
extern int printf(const char *format, ...);
extern int error(const char *format, ...);
extern int verbose(const char *format, ...);
Index: branches/danielkza/i386/boot1/boot1.asm
===================================================================
--- branches/danielkza/i386/boot1/boot1.asm (revision 388)
+++ branches/danielkza/i386/boot1/boot1.asm (revision 389)
@@ -1,390 +0,0 @@
-; boot1.asm - boot1 written for turbo assembler, since gas only
-; generates 32 bit code and this must run in real mode.
-; To compile as hard disk boot1:
-; tasm /m3 /dBOOTDEV=HDISK boot1
-; tlink boot1
-; exe2bin boot1
-; ren boot1.bin boot1
-; To compile as floppy boot1f:
-; tasm /m3 /dBOOTDEV=FLOPPY boot1 ,boot1f
-; tlink boot1f
-; exe2bin boot1f
-; ren boot1f.bin boot1f
-
-;***********************************************************************
-; This is the code for the NeXT boot1 bootsector.
-;***********************************************************************
-
- P486 ;enable i386 instructions
- IDEAL
- SEGMENT CSEG
- ASSUME CS:CSEG,DS:CSEG
-
- SDEBUG = 0
-
-;BOOTSEG = 100h ; boot will be loaded at 4k
-;BOOTOFF = 0000h
-BOOTSEG = 00h
-BOOTOFF = 1000h
-BUFSZ = 2000h ; 8K disk transfer buffer
-
-; FDISK partition table in sector 0
-PARTSTART = 1beh ; starting address of partition table
-NUMPART = 4 ; number of partitions in partition table
-PARTSZ = 16 ; each partition table entry is 16 bytes
-BOOT_IND = 0 ; offset of boot indicator in partition table
-BEG_HEAD = 1 ; offset of beginning head
-BEG_SEC = 2 ; offset of beginning sector
-BEG_CYL = 3 ; offset of beginning cylinder
-NAME_OFFSET = 4 ; offset of partition name
-PARTSEC = 8 ; offset of partition sector specifier
-NEXTNAME = 0A7h ; value of boot_ind, means bootable partition
-
-LOADSZ = 88 ; maxiumum possible size of unix boot
-- 44k
-
-FLOPPY = 0
-HDISK = 80h
-
-;BOOTDEV = ? ; set to 00h for floppy, 80h for hard disk
- ; (use a command line switch to set)
-
-; NeXT disk label
-DISKLABEL = 15 ; sector num of 2nd disk label, 1st is trashed by bootsec
-DL_DISKTAB = 44
-
-; We support disk label version 3 "3Vld" in our little endian world
-DL_V3 = 33566c64h
-
-; NeXT disktab
-DT_SECSIZE = 48
-DT_BOOT0_BLKNO = 80
-
-
-; This code is a replacement for boot1. It is loaded at 0x0:0x7c00
-
-start:
- mov ax,BOOTSEG
- cli ; interrupts off
- mov ss,ax ; set up stack seg
- mov sp,0fff0h
- sti ; reenable interrupts
-
- xor ax,ax
- mov es,ax
- mov ds,ax
- mov si,7C00h
- cld ; so pointers will get updated
- mov di,0E000h ; relocate boot program to 0xE000
- mov cx,100h ; copy 256x2 bytes
- repnz movsw ; move it
- off1 = 0E000h + (a1 - start)
- jmp FAR 0000:off1 ; jump to a1 in relocated place
-
-a1:
- mov ax,0E00h
- mov ds,ax
- mov ax,BOOTSEG
- mov es,ax
-
- ; load the boot loader (boot2) into BOOTSEG:BUFSZ
- call loadboot
-
- ; ljmp to the second stage boot loader (boot2).
- ; After ljmp, cs is BOOTSEG and boot1 (BUFSZ bytes) will be used
- ; as an internal buffer "intbuf".
-
- xor edx,edx ; bootdev = 0 for hard disk
-IF ( BOOTDEV EQ FLOPPY )
- inc edx ; bootdev = 1 for floppy disk
-ENDIF
-
- ;boot2 immediately follows disk buffer; 4K + BUFSZ
- jmp FAR BOOTSEG:(BOOTOFF + BUFSZ)
- ; jump to boot2 in loaded location
-
-
-
-loadboot:
- mov si, OFFSET intro
- call message ; display intro message
-
- ; load second stage boot from fixed disk
- ; get boot drive parameters
- ; Note: I believe that the bootsector read may not be necessary;
- ; at least some blk0 bootsectors leave a pointer to the active
- ; partition entry in si (assuming there was another blk0 bootsec)
-
- call getinfo
-
-
-IF ( BOOTDEV EQ HDISK )
-
- ; read sector 0 into BOOTSEG:0 by using BIOS call (INT 13H 02H)
- ; this gets info on the disk's actual partition table
- ; However, in the case of multiple partitions, this may not
- ; be the same as the sector with the code here.
-
- mov di,5 ; try 5 times to read bootsector
-
-retry_disk:
- xor bx, bx ; buffer is BOOTSEG:0
- mov ax,201h
- mov cx,bx
- mov dx,bx
- mov bx,BOOTOFF ; actually, it's 0:BOOTOFF
- inc cx ; cyl 0, sector 1
- mov dl,BOOTDEV ; target 0, head 0
-
- push di
- int 13h ; read the bootsector
- pop di
-
- jnb read_success1
-
- ; woops, bios failed to read sector
- xor ax,ax
- int 13h ; reset disk
- dec di
- jne retry_disk
-
- jmp read_error ; disk failed
-
-
-read_success1: ; find the NeXT partition
- mov bx,PARTSTART
- mov cx,NUMPART
-
-again:
- mov al, [es:(bx+BOOTOFF)+NAME_OFFSET]
- ; get partition name
- cmp al, NEXTNAME ; is it NeXT partition?
- jne cont ; nope, keep looking
-
-foundNextPart: ; found it, get label location
-
- mov eax, [es:(bx+BOOTOFF)+PARTSEC]
- ; offset to NeXT partition
- add eax, DISKLABEL ; add offset to the label
- jmp getLabl ; fetch that label
-
-cont:
- add bx, PARTSZ
- loop again ; if more part table entries,
- ; keep looking
-
- ; fall through, didn't find NeXT disk partition entry
-
-no_fdisk:
-ENDIF
- ; Read NeXT disk label
- mov eax, DISKLABEL ; Get block number of label
-getLabl:
- mov bx,BOOTOFF ; read into load area
- mov cx,1
- call readSectors
-
- ; we used to think about testing the disk label version here...
-
- mov bx,BOOTOFF ; point to beginning of label
-
- ; Use values from label to read entire boot program
- ; Get block number of boot
- ; Get dl_secsize and dl_boot0_blkno[0]
- mov edx, [es:(bx + DL_DISKTAB+DT_SECSIZE)]
- bswap edx ; edx -> sector size
-
- mov eax, [es:(bx + DL_DISKTAB+DT_BOOT0_BLKNO)]
- bswap eax ; eax -> block #
-
- ; Compute dl_secsize * dt_boot0_blkno[0] / 512
- shr edx, 9 ; divide dl_secsize by 512
- mul edx ; multiply boot block loc
- ; by dl_secsize/512
- ; eax has secno
- mov bx, (BUFSZ + BOOTOFF) ; read boot2 into BOOTSEG:BUFSZ
- mov edi, LOADSZ ; read this many sectors
-nexsec:
- push eax ; push sector #
- push bx ; push buffer address
- mov ecx, edi ; max number of sectors to read
-
- call readSectors
- pop bx
- pop eax
- add eax, ecx ; add number of sectors read
- sub di, cx
- shl cx, 9 ; multiply by 512 bytes per sector
- add bx, cx
-
- cmp di, 0
- jne nexsec
-
- ret
-
-spt: DW 0 ; sectors;track (one-based)
-spc: DW 0 ; tracks;cylinder (zero-based)
-nsec: DW 0 ; number of sectors to read
-
-readSectors: ; eax has starting block #, bx has offset from BOOTSEG
- ; cx has maximum number of sectors to read
- ; Trashes ax, bx, cx, dx
-
- ; BIOS call "INT 0x13 Function 0x2" to read sectors
- ; ah = 0x2 al = number of sectors
- ; ch = cylinder cl = sector
- ; dh = head dl = drive (0x80=hard disk, 0=floppy disk)
- ; es:bx = segment:offset of buffer
-
-IF ( BOOTDEV EQ FLOPPY )
- push eax
- mov al,'.'
- call putchr
- pop eax
-ENDIF
-
- push bx ; save offset
- mov [WORD nsec], cx
-
- mov ebx, eax ; bx -> block #
- xor ecx, ecx
- mov cx, [WORD spc] ; cx -> sectors/cyl
-
- xor edx,edx ; prepare for division
- div ecx ; eax = cyl, edx=remainder
- push ax ; save cylinder #, sec/spc
-
- mov eax, edx
- mov cx, [WORD spt] ; ecx -> sectors/track
- xor edx,edx ; prepare for division
- div ecx ; eax = head
- push ax ; save head, (secspc)/spt
-
- mov eax, ebx ; reload block #
- xor edx, edx ; prepare for division
- div ecx ; edx has sector #
-
- sub cx, dx ;cx now has number of sectors to read
- cmp cx, [WORD nsec]
- jge last ; use the minimum of bx and cx
- mov [WORD nsec], cx
-last:
-
- mov cx, dx ; cl -> sector
- inc cl ; starts @ 1
- pop ax ; get head
- mov dh, al ; dh -> head
-
- pop ax ; get cyl
- mov ch, al ; ch -> cyl
- mov dl, BOOTDEV ; floppy disk
-
- xor al,al
- shr ax,2
- or cl,al ; retain pesky big cyl bits
-
-; mov al, 1 ; get # of sectors
-;pop ax ; number of sectors to read
-mov ax, [WORD nsec]
- pop bx ; get buffer
- mov ah, 2 ; bios read function
-
- int 13h
-
- jb read_error
-mov cx, [WORD nsec] ; return number of sectors read
- ret
-
-
-getinfo: ; get some drive parameters
- mov dl, BOOTDEV ; boot drive is drive C
- mov ah, 8h
- push es
- int 13h
- pop es
-
- mov al, dh ; max head #
- inc al ; al -> tracks/cyl
- and cx, 3fh ; cl -> secs/track
- mul cl ; ax -> secs/cyl
- mov [WORD spc], ax
- mov [WORD spt], cx
-
- ret
-
-
-message: ; write the error message in ds:esi
- ; to console
- push es
- mov ax,ds
- mov es,ax
-
- mov bx, 1 ; bh=0, bl=1 (blue)
- cld
-
-nextb:
- lodsb ; load a byte into al
- cmp al, 0
- je done
- mov ah, 0eh ; bios int 10, function 0xe
- int 10h ; bios display a byte in tty mode
- jmp nextb
-done: pop es
- ret
-
-putchr:
- push bx
- mov bx, 1 ; bh=0, bl=1 (blue)
- mov ah, 0eh ; bios int 10, function 0xe
- int 10h ; bios display a byte in tty mode
- pop bx
- ret
-
-IF SDEBUG
-hexout:
- ; print ebx as hex number
- push cx
- push ax
- mov cx,8 ;output 8 nibbles
-
-htop:
- rol ebx,4
- mov al,bl
- and al,0fh
- cmp al,0ah
- jb o_digit
- add al,'A'-10
- jmp o_print
-o_digit: add al,'0'
-o_print: call putchr
- dec cx
- jne htop
-; mov al,10
-; call putchr
-; mov al,13
-; call putchr
- mov al,' '
- call putchr
- pop ax
- pop cx
- ret
-ENDIF
-
-
-read_error:
- mov si, OFFSET eread
-boot_exit: ; boot_exit: write error message and halt
- call message ; display error message
-halt: jmp halt
-
-
-intro: db 10,'NEXTSTEP boot1 vXX.XX.XX.XX.XX',10,13,0
-eread: db 'Read error',10,13,0
-
-; the last 2 bytes in the sector contain the signature
-d1:
- a2 = 510 - (d1 - start)
- DB a2 dup (0)
- DW 0AA55h
- ENDS
- END
Index: branches/danielkza/i386/boot2/graphics.c
===================================================================
--- branches/danielkza/i386/boot2/graphics.c (revision 388)
+++ branches/danielkza/i386/boot2/graphics.c (revision 389)
@@ -1127,7 +1127,7 @@
params[1] = 25;
}
- setVESATextMode( params[0], params[1], 4 );
+ setVESATextMode( params[0], params[1], 4 );
bootArgs->Video.v_display = VGA_TEXT_MODE;
}
@@ -1193,21 +1193,24 @@
return;
}
- if (gVerboseMode) {
- currentTickTime = time18(); // late binding
- if (currentTickTime < lastTickTime + MIN_TICKS) {
- return;
- } else {
- lastTickTime = currentTickTime;
- }
-
- if (getVideoMode() == VGA_TEXT_MODE) {
- if (currentIndicator >= sizeof(indicator)) {
- currentIndicator = 0;
- }
- printf("%c\b", indicator[currentIndicator++]);
- }
- }
+ currentTickTime = time18(); // late binding
+ if (currentTickTime < lastTickTime + MIN_TICKS)
+ {
+ return;
+ }
+ else
+ {
+ lastTickTime = currentTickTime;
+ }
+
+ if (getVideoMode() == VGA_TEXT_MODE)
+ {
+ if (currentIndicator >= sizeof(indicator))
+ {
+ currentIndicator = 0;
+ }
+ printf("%c\b", indicator[currentIndicator++]);
+ }
}
void
Index: branches/danielkza/i386/boot2/boot.c
===================================================================
--- branches/danielkza/i386/boot2/boot.c (revision 388)
+++ branches/danielkza/i386/boot2/boot.c (revision 389)
@@ -193,6 +193,8 @@
else
drawBootGraphics();
+ setupBooterLog();
+
finalizeBootStruct();
// Jump to kernel's entry point. There's no going back now.
@@ -249,6 +251,8 @@
// Initialize boot info structure.
initKernBootStruct();
+ initBooterLog();
+
// Setup VGA text mode.
// Not sure if it is safe to call setVideoMode() before the
// config table has been loaded. Call video_mode() instead.
@@ -320,13 +324,14 @@
getc();
#endif
- useGUI = true;
- // Override useGUI default
- getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig);
- if (useGUI) {
- /* XXX AsereBLN handle error */
- initGUI();
- }
+ useGUI = true;
+ // Override useGUI default
+ getBoolForKey(kGUIKey, &useGUI, &bootInfo->bootConfig);
+ if (useGUI && initGUI())
+ {
+ // initGUI() returned with an error, disabling GUI.
+ useGUI = false;
+ }
setBootGlobals(bvChain);
@@ -372,17 +377,13 @@
bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount);
setBootGlobals(bvChain);
+ setupDeviceList(&bootInfo->themeConfig);
}
continue;
}
// Other status (e.g. 0) means that we should proceed with boot.
- if( bootArgs->Video.v_display == GRAPHICS_MODE )
- drawBackground();
-
- // Found and loaded a config file. Proceed with boot.
-
// Turn off any GUI elements
if( bootArgs->Video.v_display == GRAPHICS_MODE )
{
@@ -390,6 +391,7 @@
gui.bootprompt.draw = false;
gui.menu.draw = false;
gui.infobox.draw = false;
+ gui.logo.draw = false;
drawBackground();
updateVRAM();
}
@@ -414,10 +416,7 @@
archCpuType = CPU_TYPE_I386;
}
}
- if (getValueForKey(k32BitModeFlag, &val, &len, &bootInfo->bootConfig)) {
- archCpuType = CPU_TYPE_I386;
- }
-
+
if (!getBoolForKey (kWake, &tryresume, &bootInfo->bootConfig)) {
tryresume = true;
tryresumedefault = true;
@@ -563,12 +562,8 @@
if (ret <= 0) {
printf("Can't find %s\n", bootFile);
- if(gui.initialised) {
- sleep(1);
- drawBackground();
- gui.devicelist.draw = true;
- gui.redraw = true;
- }
+ sleep(1);
+
if (gBootFileType == kNetworkDeviceType) {
// Return control back to PXE. Don't unload PXE base code.
gUnloadPXEOnExit = false;
Index: branches/danielkza/i386/boot2/boot.h
===================================================================
--- branches/danielkza/i386/boot2/boot.h (revision 388)
+++ branches/danielkza/i386/boot2/boot.h (revision 389)
@@ -99,10 +99,8 @@
*/
#define kVerboseModeFlag "-v"
#define kSafeModeFlag "-x"
-#define kOldSafeModeFlag "-f"
#define kIgnoreBootFileFlag "-F"
#define kSingleUserModeFlag "-s"
-#define k32BitModeFlag "-x32"
/*
* Booter behavior control
Index: branches/danielkza/i386/boot2/gui.c
===================================================================
--- branches/danielkza/i386/boot2/gui.c (revision 388)
+++ branches/danielkza/i386/boot2/gui.c (revision 389)
@@ -417,6 +417,18 @@
return 0;
}
+int freeWindowBuffer( window_t *window )
+{
+ if (window->pixmap && window->pixmap->pixels)
+ {
+ free(window->pixmap->pixels);
+ free(window->pixmap);
+ return 0;
+ }
+
+ return 1;
+}
+
void fillPixmapWithColor(pixmap_t *pm, uint32_t color)
{
int x,y;
@@ -439,21 +451,87 @@
blend( images[iBackground].image, gui.screen.pixmap, gui.background.pos );
// draw logo.png into background buffer
- blend( images[iLogo].image, gui.screen.pixmap, gui.logo.pos);
+ if (gui.logo.draw)
+ {
+ blend( images[iLogo].image, gui.screen.pixmap, gui.logo.pos);
+ }
memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 );
}
-void loadThemeValues(config_file_t *theme, bool overide)
+void setupDeviceList(config_file_t *theme)
{
- unsigned int screen_width = gui.screen.width;
- unsigned int screen_height = gui.screen.height;
unsigned int pixel;
int alpha; // transparency level 0 (obligue) - 255 (transparent)
uint32_t color; // color value formatted RRGGBB
int val, len;
const char *string;
+ if(getIntForKey("devices_max_visible", &val, theme ))
+ gui.maxdevices = MIN( val, gDeviceCount );
+
+ if(getIntForKey("devices_iconspacing", &val, theme ))
+ gui.devicelist.iconspacing = val;
+
+ // check layout for horizontal or vertical
+ gui.layout = HorizontalLayout;
+ if(getValueForKey( "devices_layout", &string, &len, theme)) {
+ if (!strcmp (string, "vertical")) {
+ gui.layout = VerticalLayout;
+ }
+ }
+
+ switch (gui.layout) {
+ case VerticalLayout:
+ gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing);
+ gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing);
+
+ if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) )
+ gui.devicelist.pos.x = pixel;
+
+ if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) )
+ gui.devicelist.pos.y = pixel;
+ break;
+
+ case HorizontalLayout:
+ default:
+ gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing);
+ gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing);
+
+ if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) )
+ gui.devicelist.pos.x = pixel;
+ else
+ gui.devicelist.pos.x = ( gui.screen.width - gui.devicelist.width ) / 2;
+
+ if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , images[iSelection].image->height ) )
+ gui.devicelist.pos.y = pixel;
+ else
+ gui.devicelist.pos.y = ( gui.screen.height - gui.devicelist.height ) / 2;
+ break;
+ }
+
+ if(getColorForKey("devices_bgcolor", &color, theme))
+ gui.devicelist.bgcolor = (color & 0x00FFFFFF);
+
+ if(getIntForKey("devices_transparency", &alpha, theme))
+ gui.devicelist.bgcolor = gui.devicelist.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24);
+
+ if (gui.devicelist.pixmap)
+ {
+ freeWindowBuffer(&gui.devicelist);
+ createWindowBuffer(&gui.devicelist);
+ }
+}
+
+void loadThemeValues(config_file_t *theme)
+{
+ unsigned int screen_width = gui.screen.width;
+ unsigned int screen_height = gui.screen.height;
+ unsigned int pixel;
+ int alpha; // transparency level 0 (obligue) - 255 (transparent)
+ uint32_t color; // color value formatted RRGGBB
+ int val;
+
/*
* Parse screen parameters
*/
@@ -502,58 +580,11 @@
if(getDimensionForKey("countdown_pos_y", &pixel, theme, screen_height , 0 ) )
gui.countdown.pos.y = pixel;
- /*
+ /*
* Parse devicelist parameters
*/
- if(getIntForKey("devices_max_visible", &val, theme ))
- gui.maxdevices = MIN( val, gDeviceCount );
+ setupDeviceList(theme);
- if(getIntForKey("devices_iconspacing", &val, theme ))
- gui.devicelist.iconspacing = val;
-
- // check layout for horizontal or vertical
- gui.layout = HorizontalLayout;
- if(getValueForKey( "devices_layout", &string, &len, theme)) {
- if (!strcmp (string, "vertical")) {
- gui.layout = VerticalLayout;
- }
- }
-
- switch (gui.layout) {
- case VerticalLayout:
- gui.devicelist.height = ((images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->height + images[iDeviceScrollNext].image->height) + gui.devicelist.iconspacing);
- gui.devicelist.width = (images[iSelection].image->width + gui.devicelist.iconspacing);
-
- if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , images[iSelection].image->width ) )
- gui.devicelist.pos.x = pixel;
-
- if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , gui.devicelist.height ) )
- gui.devicelist.pos.y = pixel;
- break;
-
- case HorizontalLayout:
- default:
- gui.devicelist.width = ((images[iSelection].image->width + gui.devicelist.iconspacing) * MIN(gui.maxdevices, gDeviceCount) + (images[iDeviceScrollPrev].image->width + images[iDeviceScrollNext].image->width) + gui.devicelist.iconspacing);
- gui.devicelist.height = (images[iSelection].image->height + font_console.chars[0]->height + gui.devicelist.iconspacing);
-
- if(getDimensionForKey("devices_pos_x", &pixel, theme, gui.screen.width , gui.devicelist.width ) )
- gui.devicelist.pos.x = pixel;
- else
- gui.devicelist.pos.x = ( gui.screen.width - gui.devicelist.width ) / 2;
-
- if(getDimensionForKey("devices_pos_y", &pixel, theme, gui.screen.height , images[iSelection].image->height ) )
- gui.devicelist.pos.y = pixel;
- else
- gui.devicelist.pos.y = ( gui.screen.height - gui.devicelist.height ) / 2;
- break;
- }
-
- if(getColorForKey("devices_bgcolor", &color, theme))
- gui.devicelist.bgcolor = (color & 0x00FFFFFF);
-
- if(getIntForKey("devices_transparency", &alpha, theme))
- gui.devicelist.bgcolor = gui.devicelist.bgcolor | (( 255 - ( alpha & 0xFF) ) << 24);
-
/*
* Parse infobox parameters
*/
@@ -689,7 +720,7 @@
// load graphics otherwise fail and return
if (loadGraphics() == 0) {
- loadThemeValues(&bootInfo->themeConfig, true);
+ loadThemeValues(&bootInfo->themeConfig);
colorFont(&font_small, gui.screen.font_small_color);
colorFont(&font_console, gui.screen.font_console_color);
@@ -699,7 +730,8 @@
if (createWindowBuffer(&gui.devicelist) == 0) {
if (createWindowBuffer(&gui.bootprompt) == 0) {
if (createWindowBuffer(&gui.infobox) == 0) {
- if (createWindowBuffer(&gui.menu) == 0) {
+ if (createWindowBuffer(&gui.menu) == 0) {
+ gui.logo.draw = true;
drawBackground();
// lets copy the screen into the back buffer
memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 );
@@ -754,8 +786,12 @@
}
}
- // Use the next (device_*_o) image for the selected item.
- if (isSelected) devicetype++;
+ // Draw the selection image and use the next (device_*_o) image for the selected item.
+ if (isSelected)
+ {
+ blend(images[iSelection].image, buffer, centeredAt(images[iSelection].image, p));
+ devicetype++;
+ }
// draw icon
blend( images[devicetype].image, buffer, centeredAt( images[devicetype].image, p ));
@@ -827,8 +863,6 @@
if(gui.menu.draw)
drawInfoMenuItems();
- blend( images[iSelection].image, gui.devicelist.pixmap, centeredAt( images[iSelection].image, p ) );
-
#if DEBUG
gui.debug.cursor = pos( 10, 100);
dprintf( &gui.screen, "label %s\n", param->label );
@@ -1784,6 +1818,7 @@
int pos;
int length;
const char *dummyVal;
+ int oldScreenWidth, oldScreenHeight;
bool legacy_logo;
uint16_t x, y;
@@ -1805,16 +1840,23 @@
screen_params[1] = DEFAULT_SCREEN_HEIGHT;
}
+ // Save current screen resolution.
+ oldScreenWidth = gui.screen.width;
+ oldScreenHeight = gui.screen.height;
+
gui.screen.width = screen_params[0];
gui.screen.height = screen_params[1];
// find best matching vesa mode for our requested width & height
getGraphicModeParams(screen_params);
- if (bootArgs->Video.v_display == VGA_TEXT_MODE) {
+ // Set graphics mode if the booter was in text mode or the screen resolution has changed.
+ if (bootArgs->Video.v_display == VGA_TEXT_MODE
+ || (screen_params[0] != oldScreenWidth && screen_params[1] != oldScreenHeight) )
+ {
setVideoMode(GRAPHICS_MODE, 0);
}
-
+
if (getValueForKey("-checkers", &dummyVal, &length, &bootInfo->bootConfig)) {
drawCheckerBoard();
} else {
Index: branches/danielkza/i386/boot2/gui.h
===================================================================
--- branches/danielkza/i386/boot2/gui.h (revision 388)
+++ branches/danielkza/i386/boot2/gui.h (revision 389)
@@ -134,6 +134,7 @@
int initGUI();
void drawBackground();
+void setupDeviceList(config_file_t *theme);
void drawDeviceIcon(BVRef device, pixmap_t *buffer, position_t p, bool isSelected);
void drawDeviceList(int start, int end, int selection);
void drawProgressBar(pixmap_t *blendInto, uint16_t width, position_t p, uint8_t progress);
Index: branches/danielkza/i386/boot2/options.c
===================================================================
--- branches/danielkza/i386/boot2/options.c (revision 388)
+++ branches/danielkza/i386/boot2/options.c (revision 389)
@@ -112,7 +112,7 @@
char dummy[80];
getBootVolumeDescription( gBootVolume, dummy, sizeof(dummy)-1, true );
- drawDeviceIcon( gBootVolume, gui.screen.pixmap, p, false );
+ drawDeviceIcon( gBootVolume, gui.screen.pixmap, p, true );
drawStrCenteredAt( (char *) msg, &font_small, gui.screen.pixmap, gui.countdown.pos );
// make this screen the new background
@@ -442,7 +442,7 @@
gVerboseMode = false;
gBootMode = kBootModeNormal;
*gBootArgsPtr++ = '-';
- *gBootArgsPtr++ = 'f';
+ *gBootArgsPtr++ = 'x';
break;
case BOOT_SINGLEUSER:
@@ -866,6 +866,7 @@
if (bootArgs->Video.v_display == GRAPHICS_MODE) {
// redraw the background buffer
+ gui.logo.draw = true;
drawBackground();
gui.devicelist.draw = true;
gui.redraw = true;
@@ -1304,24 +1305,20 @@
strncpy(&argP[cnt], cp, userCnt);
argP[cnt+userCnt] = '\0';
- if(!shouldboot)
- {
- gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->bootConfig ) ||
- getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->bootConfig );
+ if(!shouldboot)
+ {
+ gVerboseMode = getValueForKey( kVerboseModeFlag, &val, &cnt, &bootInfo->bootConfig ) ||
+ getValueForKey( kSingleUserModeFlag, &val, &cnt, &bootInfo->bootConfig );
+
+ gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) ?
+ kBootModeSafe : kBootModeNormal;
+ }
- gBootMode = ( getValueForKey( kSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) ?
- kBootModeSafe : kBootModeNormal;
+ if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) )
+ {
+ strlcpy(gMKextName, val, cnt + 1);
+ }
- if ( getValueForKey( kOldSafeModeFlag, &val, &cnt, &bootInfo->bootConfig ) ) {
- gBootMode = kBootModeSafe;
- }
-
- if ( getValueForKey( kMKextCacheKey, &val, &cnt, &bootInfo->bootConfig ) ) {
- strlcpy(gMKextName, val, cnt + 1);
- }
-
- }
-
free(configKernelFlags);
free(valueBuffer);
Index: branches/danielkza/i386/util/bdmesg.c
===================================================================
--- branches/danielkza/i386/util/bdmesg.c (revision 0)
+++ branches/danielkza/i386/util/bdmesg.c (revision 389)
@@ -0,0 +1,38 @@
+/*
+ * BooterLog Dump Tool, part of the Chameleon Boot Loader Project
+ *
+ * Copyright 2010 by Islam M. Ahmed Zaid. All rights reserved.
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#include "IOKit/IOKitLib.h"
+
+
+int main(int argc, char *argv[])
+{
+ io_registry_entry_t root = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/");
+ if (!root)
+ {
+ printf("IORegistryEntry \"IOIOService:/\" not found.\n");
+ return 0;
+ }
+
+ CFTypeRef bootLog = IORegistryEntryCreateCFProperty(root, CFSTR("boot-log"), kCFAllocatorDefault, 0);
+ if (!bootLog)
+ {
+ printf("\"boot-log\" property not found.\n");
+ return 0;
+ }
+ //CFShow(bootLog);
+ const UInt8 *msglog = CFDataGetBytePtr((CFDataRef)bootLog);
+ if (msglog)
+ printf("%s\n", msglog);
+
+ return 0;
+}
+
Index: branches/danielkza/i386/util/Makefile
===================================================================
--- branches/danielkza/i386/util/Makefile (revision 388)
+++ branches/danielkza/i386/util/Makefile (revision 389)
@@ -18,7 +18,7 @@
CFILES = machOconv.c
ALLSRC = $(CFILES) $(MFILES) $(HFILES) $(EXPORT_HFILES)
-PROGRAMS = machOconv
+PROGRAMS = machOconv bdmesg
OUTFILES = $(PROGRAMS)
@@ -29,6 +29,9 @@
machOconv: machOconv.o
$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $(SYMROOT)/$(@F) machOconv.o
+bdmesg: bdmesg.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -framework IOKit -framework CoreFoundation -o $(SYMROOT)/$(@F) bdmesg.o
+
include ../MakeInc.dir
#dependencies
Property changes on: branches/danielkza
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk:r300-388