summaryrefslogtreecommitdiff
path: root/boot/mp.asm
blob: 497a0a828fe2103f4fefe3f0c4f03e68d847b6a3 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
; other processors will enter here!

[org 0x7000]

jmp switch_to_pm

%include "boot/GDT.asm"

[bits 16]
switch_to_pm:

    cli				;switch off interrupts!
    lgdt [gdt_descriptor]	;load descriptor table!

    ;switch on 32-bit protected mode
    mov eax, cr0
    or eax,0x1 
    mov cr0, eax

    jmp 0x8:init_pm

[bits 32]
init_pm:

    mov ax, 0x10
    mov ds, ax
    mov ss, ax
    mov es, ax
    mov fs, ax
    mov gs, ax

    mov ebp, 0x95000
    mov esp, ebp

    call boot_32_pm	    ;continue booting in 32-bit protected mode

boot_32_pm:

     mov eax,1
;
    call 0x1000			        ;jump into our Kernel!