17.05.2015 Views

TI486 Microprocessor - Al Kossow's Bitsavers

TI486 Microprocessor - Al Kossow's Bitsavers

TI486 Microprocessor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Testing/Debugging SMM Code<br />

sgdt<br />

COMMENT A<br />

fixup code for smi base<br />

A<br />

fword ptr cl: [gdtsave]<br />

ipatch gdt<br />

mov eax,cs<br />

shl eax,4<br />

mov ebx,offset gdt<br />

add ebx,eax<br />

mov dword ptr [gdtnew+2],ebx<br />

ipatch far jump into protected mode<br />

mov ebx,offset $nextO<br />

add ebx, eax<br />

mov dword ptr cs: [patchi] , ebx<br />

ipatch far jump back to real mode<br />

mov word ptr cs: [patch2],cs<br />

isegment of us here<br />

ioffset to here<br />

idefine gdt base<br />

start here<br />

COMMENT A<br />

extend the limits for the code segment<br />

A<br />

db 66h<br />

19dt fword ptr [gdtnew]<br />

mov eax,crO<br />

or al,i<br />

mov crO,eax<br />

db 66h<br />

db Oeah<br />

patchidd ?<br />

dw g_code<br />

$nextO: mov<br />

mov ss,bx<br />

mov ds,bx<br />

mov es,bx<br />

mov fs,bx<br />

mov gs,bx<br />

xor al,i<br />

mov crO,eax<br />

db Oeah<br />

dw offset $nexti<br />

patch2 dw ?<br />

$nexti:<br />

iextend the limits of the data segments<br />

iback to real mode<br />

ifar jump to set cs and writable bit<br />

COMMENT A<br />

define a valid stack<br />

A<br />

mov<br />

mov<br />

mov<br />

ax, cs<br />

ss, ax<br />

esp, offset stacksmi<br />

A-25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!