Changeset ac88c93 in mainline
- Timestamp:
- 2007-04-08T17:56:58Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eaf6cd6
- Parents:
- 7bcfbbc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/boot.S
r7bcfbbc rac88c93 73 73 movl %ebx, grub_ebx 74 74 75 # Protected 32-bit. We want to reuse the code-seg descriptor, 76 # the Default operand size must not be 1 when entering long mode 77 78 movl $0x80000000, %eax 79 cpuid 80 cmp $0x80000000, %eax # any function > 80000000h? 81 jbe long_mode_unsupported 82 movl $(AMD_CPUID_EXTENDED), %eax # Extended function code 80000001 83 cpuid 84 bt $29, %edx # Test if long mode is supported. 85 jc long_mode_supported 86 87 long_mode_unsupported: 88 movl $long_mode_msg, %esi 89 jmp error_halt 90 91 long_mode_supported: 92 75 93 #ifdef CONFIG_FB 76 mov $vesa_init, %esi ;94 mov $vesa_init, %esi 77 95 mov $VESA_INIT_SEGMENT << 4, %edi 78 96 mov $e_vesa_init - vesa_init, %ecx … … 93 111 mov %bx, KA2PA(vesa_bpp) 94 112 #endif 95 96 # Protected 32-bit. We want to reuse the code-seg descriptor,97 # the Default operand size must not be 1 when entering long mode98 99 movl $0x80000000, %eax100 cpuid101 cmp $0x80000000, %eax # any function > 80000000h?102 jbe long_mode_unsupported103 movl $(AMD_CPUID_EXTENDED), %eax # Extended function code 80000001104 cpuid105 bt $29, %edx # Test if long mode is supported.106 jc long_mode_supported107 108 long_mode_unsupported:109 cli110 hlt111 112 long_mode_supported:113 113 114 114 # Enable 64-bit page transaltion entries - CR4.PAE = 1. … … 446 446 .align 4 447 447 e_vesa_init: 448 #endif 448 #endif 449 450 # Print string from %esi to EGA display (in red) and halt 451 error_halt: 452 movl $0xb8000, %edi # base of EGA text mode memory 453 xorl %eax, %eax 454 455 movw $0x3d4, %dx # read bits 8 - 15 of the cursor address 456 movb $0xe, %al 457 outb %al, %dx 458 459 movw $0x3d5, %dx 460 inb %dx, %al 461 shl $8, %ax 462 463 movw $0x3d4, %dx # read bits 0 - 7 of the cursor address 464 movb $0xf, %al 465 outb %al, %dx 466 467 movw $0x3d5, %dx 468 inb %dx, %al 469 470 cmp $1920, %ax 471 jbe cursor_ok 472 movw $1920, %ax # sanity check for the cursor on the last line 473 cursor_ok: 474 475 movw %ax, %bx 476 shl $1, %eax 477 addl %eax, %edi 478 479 movw $0x0c00, %ax # black background, light red foreground 480 cld 481 482 ploop: 483 lodsb 484 cmp $0, %al 485 je ploop_end 486 stosw 487 inc %bx 488 jmp ploop 489 ploop_end: 490 491 movw $0x3d4, %dx # write bits 8 - 15 of the cursor address 492 movb $0xe, %al 493 outb %al, %dx 494 495 movw $0x3d5, %dx 496 movb %bh, %al 497 outb %al, %dx 498 499 movw $0x3d4, %dx # write bits 0 - 7 of the cursor address 500 movb $0xf, %al 501 outb %al, %dx 502 503 movw $0x3d5, %dx 504 movb %bl, %al 505 outb %al, %dx 506 507 cli 508 hlt 449 509 450 510 .section K_DATA_START, "aw", @progbits … … 514 574 grub_ebx: 515 575 .long 0 576 577 long_mode_msg: 578 .ascii "64 bit long mode not supported. System halted.\0"
Note:
See TracChangeset
for help on using the changeset viewer.