flat assembler
Message board for the users of flat assembler.

Index > Heap > UEFI System Table and Award BIOS DLL module

Author
Thread Post new topic Reply to topic
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
Because we have sheer amount of system programmers around here. I'll post it here.

Has anyone reversed DLL module(s) in recent Award BIOS?

The module is passed with two 32-bit parameters. It's obvious that one of these parameters is a pointer to a data structure. However, I couldn't find the correct data structure until now.

Because I think most of these DLLs are shared between legacy Award BIOS binaries and the new UEFI implementation. It should be some form of data structure described in the UEFI standard, which I think very probably the UEFI System Table. The confusing part is legacy Award BIOS doesn't have the UEFY system table, so it could be SMBIOS table.

Anyone has worked on this thing?

EDIT: There are 2 parameters passed to the module, not one as I mentioned previously.

_________________
Human knowledge belongs to the world


Last edited by Pinczakko on 10 Mar 2010, 19:57; edited 1 time in total
Post 10 Mar 2010, 18:49
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
I did a little, but I am not sure what exactly do you mean by "DLL module".
Post 10 Mar 2010, 19:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
On a closer inspection. The "DLL module" *is* an UEFI driver. The one I inspected initialized the HyperTransport link.

_________________
Human knowledge belongs to the world
Post 10 Mar 2010, 19:50
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
UEFI driver entry point is described in UEFI specification chapter 6.4 (Image Services), and it takes two params: First is image handle, second is pointer to EFI_SYSTEM_TABLE structure. From my experiences, you have to get its structure from browsing C headers.
Post 10 Mar 2010, 20:59
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
I finally nail it down Smile . The DLL header is simply discarded and the DLL file only uses the first parameter passed into it (which is a pointer to AMD-specific data structure). I think the DLL source code very possibly shared for both AMD's HyperTransport UEFI driver for link initialization and for legacy BIOS such as the one I inspected.

_________________
Human knowledge belongs to the world
Post 14 Mar 2010, 21:45
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
In that case, I am not sure it is really a "UEFI driver"... That term should IMO apply only to those drivers which structure as defined in UEFI standard.

Where/how exactly did you get that driver?
Post 15 Mar 2010, 00:44
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
I used Modbin6 utility to extract the DLL from the BIOS binary. The BIOS that I'm inspecting is for Gigabyte GA-MA78GM-US2H.

I read on some "old" Coreboot/LinuxBIOS presentation that AMD uses a code called CIM module to initialize its chipsets. This CIM module is running on a 32-bit flat protected mode environment (without any page tables and with free access to hardware of course).

This particular DLL (the file is HT.DLL when extracted from the Award BIOS mentioned above) is NOT a CIM module. That made me suspicious. However, the DLL runs on 32-bit protected mode just like the CIM module mentioned above. I'm quite sure that the source code of this particular DLL is meant to be compiled to UEFI driver (probably with slight adjustment) because AMD mentioned in its chipset datasheet that the chipset initialization code is provided in 32-bit form because it meant to be used seamlessly in both legacy code BIOS and UEFI-based "BIOS".

Anyway, links to download AMD chipset datasheet are at:
http://www.coreboot.org/AMD_Public_Documents

Just in case you want to check it further Wink

_________________
Human knowledge belongs to the world
Post 15 Mar 2010, 01:13
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Hmm... and is this board compliant to "Platform Initialization" specs, or just UEFI specs?

If the board is fully compliant, then the shared module you mentioned should be loaded from PEI module, DXE driver, or something else that is documented. And that should give you a hint about structure passed to it.

If the board isn't fully compliant, well... I probably can't help.

Thanks for links. I only have experience with Tiano, but if you want, email the DLL to me, and I will check it to see if I get some clue.
Post 15 Mar 2010, 01:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Pinczakko



Joined: 02 May 2004
Posts: 34
Location: Takabonerate National Park, Indonesia
Pinczakko
I found the answer after reversing the BIOS binary for almost two days. I summarized the result at:
Pinczakko's Guide to Reversing Award BIOS DLL Support

Regarding the data structure pointer passed to the DLL module. It's a pointer to data structure in the stack of the entry point function in the HT32GATE.BIN "interface" file.

Anyway, it seems that the DLL module doesn't conform to UEFI specs. It's probably used only as a "back-end" if it's used in an x86/x86-64 UEFI firmware.

_________________
Human knowledge belongs to the world
Post 15 Mar 2010, 14:51
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.