Rev 105 | Rev 112 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 105 | Rev 110 | ||
---|---|---|---|
Line 60... | Line 60... | ||
60 | meeting_point: |
60 | meeting_point: |
61 | .code32 |
61 | .code32 |
62 | 62 | ||
63 | lidt idtr |
63 | lidt idtr |
64 | 64 | ||
- | 65 | call map_kernel |
|
- | 66 | ||
- | 67 | movl $_hardcoded_ktext_size, hardcoded_ktext_size |
|
- | 68 | movl $_hardcoded_kdata_size, hardcoded_kdata_size |
|
- | 69 | movl $_hardcoded_load_address, hardcoded_load_address |
|
- | 70 | ||
- | 71 | call main_bsp # never returns |
|
- | 72 | ||
- | 73 | cli |
|
- | 74 | hlt |
|
- | 75 | ||
- | 76 | .global map_kernel |
|
- | 77 | map_kernel: |
|
65 | # |
78 | # |
66 | # Here we setup mapping for both the unmapped and mapped sections of the kernel. |
79 | # Here we setup mapping for both the unmapped and mapped sections of the kernel. |
67 | # For simplicity, we set only one 4M page for 0x00000000 and one for 0x80000000. |
80 | # For simplicity, we set only one 4M page for 0x00000000 and one for 0x80000000. |
68 | # |
81 | # |
69 | movl %cr4, %ecx |
82 | movl %cr4, %ecx |
Line 81... | Line 94... | ||
81 | 94 | ||
82 | # turn on paging |
95 | # turn on paging |
83 | movl %cr0, %ebx |
96 | movl %cr0, %ebx |
84 | orl $(1<<31), %ebx |
97 | orl $(1<<31), %ebx |
85 | movl %ebx, %cr0 |
98 | movl %ebx, %cr0 |
- | 99 | ret |
|
86 | 100 | ||
87 | movl $_hardcoded_ktext_size, hardcoded_ktext_size |
- | |
88 | movl $_hardcoded_kdata_size, hardcoded_kdata_size |
- | |
89 | movl $_hardcoded_load_address, hardcoded_load_address |
- | |
90 | - | ||
91 | call main_bsp # never returns |
- | |
92 | - | ||
93 | cli |
- | |
94 | hlt |
- | |
95 | 101 | ||
96 | .section K_DATA_START |
102 | .section K_DATA_START |
97 | 103 | ||
98 | .align 4096 |
104 | .align 4096 |
99 | page_directory: |
105 | page_directory: |