aboutsummaryrefslogtreecommitdiffstats
path: root/src/boot/boot.stage2.pm.asm
blob: 8897be693d7d72d893b66aceff52cab508d03af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
    ;; boot.stage2.pm.asm


    [bits 16]
    %include "boot.stage2.gdt32.asm"

_enable_pm: 
    cli
    lgdt [GDT32_ptr]
    
    ;; Enable Protected Mode
    mov eax, cr0
    or eax, 1
    mov cr0, eax
    
    jmp CODE_SEG32:_protected_mode

[bits 32]
_protected_mode:    
    mov ax, DATA_SEG32
    mov ds, ax
    mov ss, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    
    ret