1 ;----------------------------------------------------------;
2 ; BOS kernel Christoffer Bubach, 2005. ;
3 ;----------------------------------------------------------;
5 ; Do everything related to 16-bit here... :) ;
7 ;----------------------------------------------------------;
9 ;---------------------;
11 ;---------------------;
13 call getmem ; realmode/mem.inc
16 xor eax, eax ; clear mem for IDT and GDT
17 mov edi, 0x6c00 ; IDT address
18 mov ecx, (0x800 + 0x800)/4
23 mov [gdt.BOS_16code + 2], ax ; Prepare GDT by
24 mov [gdt.BOS_16data + 2], ax ; setting 16-bit base.
26 mov [gdt.BOS_16code + 4], al
27 mov [gdt.BOS_16data + 4], al
28 mov [gdt.BOS_16code + 7], ah
29 mov [gdt.BOS_16data + 7], ah
32 mov edi, 0x7400 ; GDT address
33 mov ecx, (gdt_end - gdt)/4
34 rep movsd ; Move it to final pos.
36 push dword 0 ; clear NT bit