IwYvI

干了这碗鸡汤

; fixup GDT base in descriptor
 MOV ECX,EDX
 MOV [EDX].bas_0_15+GDT_DESC_OFF,CX
 ROR ECX,16
 MOV [EDX].bas_16_23+GDT_DESC_OFF,CL
 MOV [EDX].bas_24_31+GDT_DESC_OFF,CH

 ; copy EPROM IDT to ram at:
 ; RAM_START+size(STARTUP_DATA)+SIZE (EPROM GDT)
 MOV ECX, CS_BASE
 ADD ECX, OFFSET (IDT_EPROM)
 MOV ESI, [ECX].table_linear
 MOV EDI,EAX
 MOVZX ECX, [ECX].table_lim
 MOV APP_IDT_ram[EBX].table_lim,CX
 INC ECX
 MOV APP_IDT_ram[EBX].table_linear,EAX
 MOV EBX,EAX
 ADD EAX,ECX
 REP MOVS BYTE PTR ES:[EDI],BYTE PTR DS:[ESI]