5 mov ds, ax ; Take us out of flat unreal mode, and
6 mov es, ax ; put us in true real mode.
10 jmp 0xA800:(entry2-0xA8000) ; Long jump to a correct cs.
12 lgdt [(gdtr-0xA8000)] ; Set up a new GDT.
14 mov cr0, eax ; ... and enter pmode!
15 jmp long 0x10:continue ; Now longjmp into the new code.
18 mov ax, 0x08 ; Set up segment selectors.
31 mov dx, 0xCF8 ; save off the old config value
35 mov eax, 0x80000070 ; load in smramc
40 and al, 0xF3 ; Allow graphics access
47 mov [esp-6], al ; save off the old VGA command
59 add eax, 0xB8000 ; yay
61 mov byte [eax+1], 0x1F
63 mov byte [eax+3], 0x1F
65 mov byte [eax+5], 0x1F
67 mov byte [eax+7], 0x1F
69 mov byte [eax+9], 0x1F
70 mov byte [eax+10], '2'
71 mov byte [eax+11], 0x1F
73 mov dx, 0x3D4 ; restore the old stuff
77 mov dx, 0xCFC ; restore smramc
81 mov dx, 0xCF8 ; restore the old PCI config value
95 mov eax, [dataptr+12] ; jump into C
98 mov al, 0x40 ; ack the periodic IRQ
102 mov dx, 0x830 ; now ack the SMI itself
121 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
122 db 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x93, 0xCF, 0x00 ; data segment
123 db 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9B, 0xCF, 0x00 ; code segment
124 db 0xFF, 0xFF, 0x00, 0x80, 0x0A, 0x9B, 0xCF, 0x00 ; code segment for trampoline
129 TIMES 512-($-$$) DB 0
131 ; 4 bytes of stack top
132 ; 4 bytes of BSS start
133 ; 4 bytes of BSS length
134 ; 4 bytes of C entry point