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
14 mov [ram_amount - 0x10000], eax
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 - 0x10000 + 2], ax ; Prepare GDT by
24 mov [gdt.BOS_16data - 0x10000 + 2], ax ; setting 16-bit base.
26 mov [gdt.BOS_16code - 0x10000 + 4], al
27 mov [gdt.BOS_16data - 0x10000 + 4], al
28 mov [gdt.BOS_16code - 0x10000 + 7], ah
29 mov [gdt.BOS_16data - 0x10000 + 7], ah
31 lea esi, [gdt - 0x10000]
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