Changes in kernel/arch/amd64/src/boot/multiboot2.S [17af882:4bf0926e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/multiboot2.S
r17af882 r4bf0926e 27 27 */ 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/boot/boot.h> 30 31 #include <arch/mm/page.h> … … 41 42 42 43 .align 8 43 .global multiboot2_image_start44 44 multiboot2_header_start: 45 45 .long MULTIBOOT2_HEADER_MAGIC … … 49 49 50 50 /* Information request tag */ 51 .align 8 51 52 tag_info_req_start: 52 53 .word MULTIBOOT2_TAG_INFO_REQ … … 61 62 62 63 /* Address tag */ 64 .align 8 63 65 tag_address_start: 64 66 .word MULTIBOOT2_TAG_ADDRESS … … 72 74 73 75 /* Entry address tag */ 76 .align 8 74 77 tag_entry_address_start: 75 78 .word MULTIBOOT2_TAG_ENTRY_ADDRESS … … 80 83 81 84 /* Flags tag */ 85 .align 8 82 86 tag_flags_start: 83 87 .word MULTIBOOT2_TAG_FLAGS … … 89 93 #ifdef CONFIG_FB 90 94 /* Framebuffer tag */ 95 .align 8 91 96 tag_framebuffer_start: 92 97 .word MULTIBOOT2_TAG_FRAMEBUFFER … … 100 105 101 106 /* Module alignment tag */ 107 .align 8 102 108 tag_module_align_start: 103 109 .word MULTIBOOT2_TAG_MODULE_ALIGN … … 108 114 109 115 /* Tag terminator */ 116 .align 8 110 117 tag_terminator_start: 111 118 .word MULTIBOOT2_TAG_TERMINATOR … … 115 122 multiboot2_header_end: 116 123 117 multiboot2_image_start: 124 SYMBOL(multiboot2_image_start) 118 125 cli 119 126 cld … … 202 209 203 210 movl %cr4, %eax 204 btsl $5, %eax211 orl $CR4_PAE, %eax 205 212 movl %eax, %cr4 206 213 … … 210 217 211 218 /* Enable long mode */ 212 movl $ EFER_MSR_NUM, %ecx219 movl $AMD_MSR_EFER, %ecx 213 220 rdmsr /* read EFER */ 214 btsl $AMD_LME_FLAG, %eax/* set LME = 1 */221 orl $AMD_LME, %eax /* set LME = 1 */ 215 222 wrmsr 216 223 217 224 /* Enable paging to activate long mode (set CR0.PG = 1) */ 218 225 movl %cr0, %eax 219 btsl $31, %eax226 orl $CR0_PG, %eax 220 227 movl %eax, %cr0 221 228 … … 243 250 movq %rsp, %rbp 244 251 245 /* Call a rch_pre_main(multiboot_eax, multiboot_ebx) */252 /* Call amd64_pre_main(multiboot_eax, multiboot_ebx) */ 246 253 movl multiboot_eax, %edi 247 254 movl multiboot_ebx, %esi 248 callq arch_pre_main 255 256 #ifdef MEMORY_MODEL_large 257 movabsq $amd64_pre_main, %rax 258 callq *%rax 259 #else 260 callq amd64_pre_main 261 #endif 249 262 250 263 /* Call main_bsp() */ 251 callq main_bsp 264 #ifdef MEMORY_MODEL_large 265 movabsq $main_bsp, %rax 266 callq *%rax 267 #else 268 callq main_bsp 269 #endif 252 270 253 271 /* Not reached */
Note:
See TracChangeset
for help on using the changeset viewer.