Changes in kernel/arch/amd64/src/boot/boot.S [64f6ef04:304342e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/boot.S
r64f6ef04 r304342e 31 31 #include <arch/boot/boot.h> 32 32 #include <arch/boot/memmap.h> 33 #include <arch/mm/page.h> 33 #include <arch/mm/page.h> 34 34 #include <arch/mm/ptl.h> 35 35 #include <arch/pm.h> … … 172 172 xorq %rsi, %rsi 173 173 movl grub_ebx, %esi 174 175 movabsq $arch_pre_main, %rax 176 callq *%rax 174 call arch_pre_main 177 175 178 176 # create the first stack frame 179 177 pushq $0 180 178 movq %rsp, %rbp 181 182 movabsq $main_bsp, %rax 183 call *%rax 179 180 call main_bsp 184 181 185 182 # not reached … … 259 256 # 260 257 # Macro for generating initial page table contents. 261 # @param cnt Number of entries to generat e. Must be multiple of 8.258 # @param cnt Number of entries to generat. Must be multiple of 8. 262 259 # @param g Number of GB that will be added to the mapping. 263 260 # 264 .macro ptl2gen cnt g 265 266 ptl2gen "\cnt - 8" \g267 268 269 270 271 272 273 274 275 261 .macro ptl2gen cnt g 262 .if \cnt 263 ptl2gen "\cnt - 8" \g 264 .quad ((\cnt - 8) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 265 .quad ((\cnt - 7) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 266 .quad ((\cnt - 6) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 267 .quad ((\cnt - 5) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 268 .quad ((\cnt - 4) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 269 .quad ((\cnt - 3) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 270 .quad ((\cnt - 2) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 271 .quad ((\cnt - 1) * 0x200000) + (\g * 1024 * 1024 * 1024) | (PTL_WRITABLE | PTL_PRESENT | PTL_2MB_PAGE) 272 .endif 276 273 .endm 277 274 278 # Page table for pages in the 1st gigabyte. 279 .align 4096 280 ptl_2_0g: 275 # Page table for pages in the first gigabyte. 276 .align 4096 277 .global ptl_2_0g 278 ptl_2_0g: 281 279 ptl2gen 512 0 282 280 283 # Page table for pages in the 2nd gigabyte. 284 .align 4096 281 # Page table for pages in the second gigabyte. 282 .align 4096 283 .global ptl_2_1g 285 284 ptl_2_1g: 286 285 ptl2gen 512 1 287 286 288 # Page table for pages in the 3rd gigabyte. 289 .align 4096 287 # Page table for pages in the third gigabyte. 288 .align 4096 289 .global ptl_2_2g 290 290 ptl_2_2g: 291 291 ptl2gen 512 2 292 292 293 # Page table for pages in the 4th gigabyte. 294 .align 4096 293 # Page table for pages in the fourth gigabyte. 294 .align 4096 295 .global ptl_2_3g 295 296 ptl_2_3g: 296 297 ptl2gen 512 3 297 298 298 # Page table for pages in the 5th gigabyte. 299 .align 4096 300 ptl_2_4g: 301 ptl2gen 512 3 302 303 # Page table for pages in the 6th gigabyte. 304 .align 4096 305 ptl_2_5g: 306 ptl2gen 512 3 307 308 # Page table for pages in the 7th gigabyte. 309 .align 4096 310 ptl_2_6g: 311 ptl2gen 512 3 312 313 # Page table for pages in the 8th gigabyte. 314 .align 4096 315 ptl_2_7g: 316 ptl2gen 512 3 317 318 .align 4096 299 .align 4096 300 .global ptl_1 319 301 ptl_1: 320 # Identity mapping for [0; 8G)302 # Identity mapping for [0; 4G) 321 303 .quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT) 322 .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT) 304 .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT) 323 305 .quad ptl_2_2g + (PTL_WRITABLE | PTL_PRESENT) 324 306 .quad ptl_2_3g + (PTL_WRITABLE | PTL_PRESENT) 325 .quad ptl_2_4g + (PTL_WRITABLE | PTL_PRESENT) 326 .quad ptl_2_5g + (PTL_WRITABLE | PTL_PRESENT) 327 .quad ptl_2_6g + (PTL_WRITABLE | PTL_PRESENT) 328 .quad ptl_2_7g + (PTL_WRITABLE | PTL_PRESENT) 329 .fill 504, 8, 0 307 .fill 506, 8, 0 308 # Mapping of [0; 1G) at -2G 309 .quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT) 310 .fill 1, 8, 0 330 311 331 312 .align 4096 … … 333 314 ptl_0: 334 315 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 335 .fill 255, 8,0316 .fill 255,8,0 336 317 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 337 .fill 255, 8, 0 318 .fill 254,8,0 319 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 338 320 339 321 .section K_DATA_START, "aw", @progbits … … 351 333 352 334 extended_cpuid_msg: 353 .asciz "E rror: Extended CPUID not supported -- CPU is not 64-bit. System halted."335 .asciz "Extended CPUID not supported. System halted." 354 336 long_mode_msg: 355 .asciz " Error: 64-bit long mode not supported. System halted."337 .asciz "64 bit long mode not supported. System halted." 356 338 noexecute_msg: 357 .asciz " Error:No-execute pages not supported. System halted."339 .asciz "No-execute pages not supported. System halted." 358 340 fx_msg: 359 .asciz " Error:FXSAVE/FXRESTORE instructions not supported. System halted."341 .asciz "FXSAVE/FXRESTORE instructions not supported. System halted." 360 342 sse2_msg: 361 .asciz " Error:SSE2 instructions not supported. System halted."343 .asciz "SSE2 instructions not supported. System halted."
Note:
See TracChangeset
for help on using the changeset viewer.