Rev 232 | Rev 279 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 232 | Rev 267 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | 45 | ||
46 | .align 4096 |
46 | .align 4096 |
47 | ap_boot: |
47 | ap_boot: |
48 | .code16 |
48 | .code16 |
49 | cli |
49 | cli |
50 | xorw %ax,%ax |
50 | xorw %ax, %ax |
51 | movw %ax,%ds |
51 | movw %ax, %ds |
52 | 52 | ||
53 | lgdt gdtr # initialize Global Descriptor Table register |
53 | lgdt ap_bootstrap_gdtr # initialize Global Descriptor Table register |
- | 54 | ||
- | 55 | movl %cr0, %eax |
|
- | 56 | orl $1, %eax |
|
- | 57 | movl %eax, %cr0 # switch to protected mode |
|
- | 58 | jmpl $KTEXT, $jump_to_kernel |
|
54 | 59 | ||
55 | movl %cr0,%eax |
- | |
56 | orl $1,%eax |
- | |
57 | movl %eax,%cr0 # switch to protected mode |
- | |
58 | jmpl $KTEXT,$jump_to_kernel |
- | |
59 | jump_to_kernel: |
60 | jump_to_kernel: |
60 | .code32 |
61 | .code32 |
61 | movw $KDATA,%ax |
62 | movw $KDATA, %ax |
62 | movw %ax,%ds |
63 | movw %ax, %ds |
63 | movw %ax,%es |
64 | movw %ax, %es |
64 | movw %ax,%ss |
65 | movw %ax, %ss |
65 | movl $(ctx-0x80000000),%eax # KA2PA((__address) &ctx) |
66 | movl $(ctx-0x80000000), %eax # KA2PA((__address) &ctx) |
66 | movl (%eax),%esp |
67 | movl (%eax), %esp |
67 | subl $0x80000000,%esp # KA2PA(ctx.sp) |
68 | subl $0x80000000, %esp # KA2PA(ctx.sp) |
68 | 69 | ||
69 | call map_kernel # map kernel and turn paging on |
70 | call map_kernel # map kernel and turn paging on |
- | 71 | ||
- | 72 | movb $0xd1, %al # enable A20 using the keyboard controller |
|
- | 73 | outb %al, $0x64 |
|
- | 74 | movb $0xdf, %al |
|
- | 75 | outb %al, $0x60 |
|
70 | 76 | ||
71 | jmpl $KTEXT,$main_ap |
77 | jmpl $KTEXT, $main_ap |
72 | 78 | ||
73 | #endif /* __SMP__ */ |
79 | #endif /* __SMP__ */ |