Laptop enable

From flashrom
Revision as of 20:57, 22 October 2011 by Idwer (talk | contribs) (Adding laptop_enable wiki page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This wiki is retired

Our website is https://www.flashrom.org, instructions on how to add or update documentation are here

All wiki content available in read-only mode at wiki.flashrom.org

Using a laptop BIOS file that is one megabyte large, the TRAILER starts at 0x100001 (1024^2 + 1).


Example of how the disassembly of the trailer looks:

TRAILER:0010 09 00 00 00 00 00 00 00 00 00 00 43 6F 6D 70 61 ..........Compa
TRAILER:0020 6C 20 57 69 6E 50 68 6C 61 73 68 20 2D 20 46 6C l WinPhlash - Fl
TRAILER:0030 61 73 68 69 6E 74 2E 61 73 6D 20 76 30 2E 30 33 ashint.asm v0.03
TRAILER:0040 5A 46 4C 50 46 25 00 00 00 00 00 00 00 59 02 00 ZFLPF%


Facts:

  • ZFLPF is found at 0x40
  • len(ZFLPH) = 5


The location of the entrypoint is stored at 0x51:

0x51 =
position of ZFLPF + len(ZFLPF) + (((position where the string "Compal" starts) >> 1) - 1) =
0x40 + 5 + ((0x1b >> 1) - 1) =
0x40 + 5 + 0xc
Note that the above two formulas can be wrong.


Let's take a look at position 0x51:
TRAILER:0051 DE 02 dw 2DEh


Fact:

  • 0x2de + 0x1b = 0x2f9


TRAILER:02F9  ; ---------------------------------------------------------------------------
TRAILER:02F9 9C pushf
TRAILER:02FA 60 pusha
TRAILER:02FB E8 C2 00 call determine_lpc_pci_id