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
78 mov edi, [dataptr+4] ; clear BSS
82 mov dx, 0xCFC ; restore smramc
89 mov dx, 0xCF8 ; restore the old config value
93 mov al, 0x40 ; ack the periodic IRQ
99 or al, 0x02 ; now ack the SMI itself
113 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
114 db 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x93, 0xCF, 0x00 ; data segment
115 db 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9B, 0xCF, 0x00 ; code segment
116 db 0xFF, 0xFF, 0x00, 0x80, 0x0A, 0x9B, 0xCF, 0x00 ; code segment for trampoline
121 TIMES 512-($-$$) DB 0
123 ; 4 bytes of stack top
124 ; 4 bytes of BSS start
125 ; 4 bytes of BSS length
126 ; 4 bytes of C entry point