[coreboot] Question about smm handler bin

Stefan Reinauer stefan.reinauer at coresystems.de
Wed Nov 10 19:01:22 CET 2010

On 10.11.2010, at 09:30, fengwei zhang <namedylan at gmail.com> wrote:

> Hi all,
> I am trying to impelement SMM support for K8/vt8237r, but I am strarking on build smm handler bin. I understand I need to copy real smm handler to location 0xa0000. From the ICH4 example, there are two extern varaibles binary_smm_start and binary_smm_end, I know it defines in /build/cpu/x86/smm/smm_wrap.ramstage.o. but how does that work? 

The SMM handler is built as a separate binary and those external variables are set by the linker so the relocation code can find it.

> Suppose I just want to put RSM instruction in the smmhandler, can I just write instruction "0f aa"(bianry code of RSM) to location 0xa0000 and 0xa0001. I tried this, but my machine went freeze after I invoke SMI. 

Besides what Patrick said about putting the code at 0xa8000
your relocation might went wrong. On power-on the SMM entry point is 0x38000 until it it moved to 0xa8000

> I am thinking I may need to more instructons, because the SMM start with 16 bits real mode, it may not recongnize the instruction, right?
> But I am starking on how to build and copy SMM handler. 

I strongly suggest that you use and enhance the existing SMM handler. You will have to adapt two things
- the code that opens the ASEG for writing from non-SMM (i82801gx_smi.c)
- the north-/southbridge and CPU specific handlers (i82801gx_smihandler.c for example)

> I would really appreciate if some one could help me this out. 
> Best,
> Fengwei


More information about the coreboot mailing list