Jump to content

Digging For Buried Treasure


Recommended Posts

Greetings! I've added code to access the System Management BIOS information in r9195.

Among other things, this tells us the approximate CPU frequency (required during timer initialization), memory clock and the exact size (the value reported by the OS is usually slightly off because some memory isn't reported).

If you're curious as to what all this can report (and what hidden wonders lurk in your computer case), have a look at the bottom of %appdata%\0ad\logs\system_info.txt. I'd also appreciate if you would post your file here so I can sanity-check the values.

Unfortunately this currently only works on Windows - it requires a small platform-specific part to retrieve the SMBIOS table. It looks like the address of the table is given in /sys/firmware/efi/systab ; the dmidecode project contains some code to peek at (can't be copied, though, due to GPL).

Anyone up for implementing the equivalent of GetTable? It'd be nice to have access to this information on non-Windows systems as well.

Link to comment
Share on other sites

I don't have a /sys/firmware/efi on my Linux machine (probably since I have no EFI support), so it looks like dmidecode does its "Fallback to memory scan" thing. But it fails when run as non-root ("/dev/mem: Permission denied") which doesn't make it sound especially feasible for the game :(

Link to comment
Share on other sites

hrm. It looks like EFI is much less common than hoped, and I agree memory scanning (as root) is bad.

Thanks for trying, though!

Incidentally, it looks like Windows got this one mostly right. The GetSystemFirmwareTables API was expressly added to avoid the need for /dev/mem accesses.

Update: historic_bruno: thanks for your log! Looks good - however, do you really have FIVE PCIe slots in use PLUS 2 PCI?

Link to comment
Share on other sites

(@Philip: Sorry about that crash - I've just changed it to always return a valid Structures, which I think was the original intent)

hrm. I've double-checked the SystemSlot structure definition and a field was indeed missing. That explains the device/function numbers = 31 and 7, but the usage enum is not affected. Looks like we can't trust the in_use indicator, which is a major bummer.

Link to comment
Share on other sites

Thanks, that one looks good except for maxError. Not sure why it's getting past the comparison against numeric_limits min and max.

Could you add a if(!strcmp(name, "maxError")) debug_break(); before line 584 and verify 1) that that's the function from which it is displayed (static analysis, cued by the '%', says either that or the Handle specialization are the only possibilities) 2) check why the min/max comparison fails?

Link to comment
Share on other sites

Just built the game today and got the below error when running the game:

Function call failed: return value was -100101 (Case 1)
Location: smbios.cpp:54 (SMBIOS::GetTable)

Call stack:

SMBIOS::GetTable (smbios.cpp:54)
table = (unavailable)
tableIds = (error -100500 while analyzing vector<size_t >)

SMBIOS::InitStructures (smbios.cpp:392)
table = (error -100500 while analyzing vector<unsigned char >)
strings = (error -100500 while analyzing vector<char const * >)
next = 0x00000000

ModuleInit (module_init.cpp:47)
initState = 0x0063CF04 -> 100004 (0x000186A4)
init = 0x00446610 -> (SMBIOS::InitStructures)

SMBIOS::GetStructures (smbios.cpp:665)
initState = 100004 (0x000186A4)

os_cpu_MemorySize (os_cpu.cpp:73)
memorySize = 3327 (0x00000CFF)

RunHardwareDetection (hwdetect.cpp:223)
err = 1075221626 (0x4016947A)
caps3 = 25624576 (0x01870000)
un =
sysname = "ƒERIK-11D29BC4D4"
nodename = "29BC4D4"
release = "‰5.1.2600"
version = [16] { 0, 1, 0, 0, 11, 1, 8, 83 ('S'), 73 ('I'), 65 ('A'), 45 ('-'), 51 ('3'), 50 ('2'), 0, 0, 249 }
machine = [9] { 18, 0, 13, 163, 97 ('a'), 98 ('b'), 112 ('p'), 203, 99 ('c') }

file =
m_Buffer =
px = 0x000016A4
pn =
pi_ = 0x00000000


m_BufferSize = 3779571220 (0xE147AE14)

code = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)
LINE_126_ =
m_t0 = 1.23038e-303 (0x010B0000005F46B4)
m_description = 0x7C90E920 -> [8] { 35669, 33772, 2284, 22099, 21847, 35836, 3165, 17803 }

caps0 = 4294967295 (0xFFFFFFFF)
settings =
m_Val =
px = 0x0000000A
pn =
pi_ = 0x0012F778 ->
use_count_ = 2089877600 (0x7C910060)
weak_count_ = 4294967295 (0xFFFFFFFF)




caps2 = 2089877600 (0x7C910060)
caps1 = 17557312 (0x010BE740)

InitGraphics (gamesetup.cpp:866)
args = 0x00000002
flags = 4260 (0x000010A4)
setup_vmode = false
buf = "ﵴ"
setup_gui = (bool)0x88
e =



(error -100406 while analyzing exception)
m_msg = 0x0012FCE0 -> [8] { 184, 254, 18, 0, 11, 238, 90 ('Z'), 0 }





RunGameOrAtlas (main.cpp:491)
argc = 1 (0x00000001)
argv = 0x010B5AD8 -> 0x010B5AE8 -> "H:\0ad\binaries\system\pyrogenesis.exe"
args =
m_Args = (error -100500 while analyzing vector<pair<CStr8,CStr8> >)
m_Arg0 = { (error -100500 while analyzing string >) }

paths =
m_root =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_rdata =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_data =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_config =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_cache =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_logs =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)


replay =
m_Stream = 0x00000000

mod =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

zip =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

paths =
m_root =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_rdata =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_data =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_config =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_cache =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)

m_logs =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)


builder =
m_VFS =
px = 0x7C90E920 (see above)
pn =
pi_ = 0x7C9101E0 ->
use_count_ = 0 (0x00000000)
weak_count_ = 2090061965 (0x7C93D08D)



m_Files = (error -100500 while analyzing vector<Path >)
m_TempDir =
path = (error -100500 while analyzing basic_string<wchar_t,char_traits<wchar_t> >)



main (main.cpp:512)
argc = 1 (0x00000001)
argv = 0x010B5AD8 (see above)

wmain (wseh.cpp:373)
argc = 1 (0x00000001)
argv = 0x010B5950 -> 0x010B5958 -> "H:\0ad\binaries\system\pyrogenesis.exe"
utf8_argv = (error -100500 while analyzing vector<char * >)
ret = 6557736 (0x00641028)
utf8 = (error -100500 while analyzing string >)

__tmainCRTStartup (crtexe.c:583)
nested = 0 (0x00000000)

CallStartupWithinTryBlock (wseh.cpp:386)
ret = 1489232791 (0x58C3E397)

RegisterWaitForInputIdle (:0)


errno = 0 (?)
OS error = 0 (no error code was set)

After I pressed Continue the game started, curiously in windowed mode, but that could be something on my end for all I know :) Attached is the system_info.txt though I don't know how relevant it is if the SMBIOS thing didn't work :-/

system_info.txt

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...