Changes in kernel/arch/ia32/src/boot/multiboot.S [9a791eb9:bae43dc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/boot/multiboot.S
r9a791eb9 rbae43dc 38 38 #include <arch/cpu.h> 39 39 40 // TODO: most of this file can be rewritten in C41 42 // TODO: FB state should be checked dynamically from provided multiboot info.43 // Currently we only enable EGA statically, which forces us to rebuild44 // the image to get very early debug output.45 46 40 #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) 47 41 … … 50 44 .code32 51 45 46 .macro pm_error msg 47 movl \msg, %esi 48 jmp pm_error_halt 49 .endm 50 52 51 .macro pm_status msg 53 #if defined(CONFIG_EGA) && !defined(CONFIG_FB)52 #ifdef CONFIG_EGA 54 53 pushl %esi 55 54 movl \msg, %esi … … 67 66 multiboot_header: 68 67 .long MULTIBOOT_HEADER_MAGIC 69 #ifdef CONFIG_FB70 68 .long MULTIBOOT_HEADER_FLAGS 71 69 .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) /* checksum */ 72 #else73 .long MULTIBOOT_HEADER_FLAGS_NOFB74 .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS_NOFB) /* checksum */75 #endif76 70 .long multiboot_header 77 71 .long unmapped_start … … 79 73 .long 0 80 74 .long multiboot_image_start 81 #ifdef CONFIG_FB82 .long 083 .long CONFIG_BFB_WIDTH84 .long CONFIG_BFB_HEIGHT85 .long CONFIG_BFB_BPP86 #endif87 75 88 76 SYMBOL(multiboot_image_start) … … 116 104 117 105 pm_status $status_prot 106 107 #include "vesa_prot.inc" 118 108 119 109 #ifndef PROCESSOR_i486 … … 366 356 ret 367 357 358 /** Print string to EGA display (in light red) and halt. 359 * 360 * Should be executed from 32 bit protected mode with paging 361 * turned off. Stack is not required. This routine is used even 362 * if CONFIG_EGA is not enabled. Since we are going to halt the 363 * CPU anyway, it is always better to at least try to print 364 * some hints. 365 * 366 * @param %esi NULL-terminated string to print. 367 * 368 */ 369 pm_error_halt: 370 movl $0xb8000, %edi /* base of EGA text mode memory */ 371 xorl %eax, %eax 372 373 /* Read bits 8 - 15 of the cursor address */ 374 movw $0x3d4, %dx 375 movb $0xe, %al 376 outb %al, %dx 377 378 movw $0x3d5, %dx 379 inb %dx, %al 380 shl $8, %ax 381 382 /* Read bits 0 - 7 of the cursor address */ 383 movw $0x3d4, %dx 384 movb $0xf, %al 385 outb %al, %dx 386 387 movw $0x3d5, %dx 388 inb %dx, %al 389 390 /* Sanity check for the cursor on screen */ 391 cmp $2000, %ax 392 jb err_cursor_ok 393 394 movw $1998, %ax 395 396 err_cursor_ok: 397 398 movw %ax, %bx 399 shl $1, %eax 400 addl %eax, %edi 401 402 err_ploop: 403 lodsb 404 405 cmp $0, %al 406 je err_ploop_end 407 408 movb $0x0c, %ah /* black background, light red foreground */ 409 stosw 410 411 /* Sanity check for the cursor on the last line */ 412 inc %bx 413 cmp $2000, %bx 414 jb err_ploop 415 416 /* Scroll the screen (24 rows) */ 417 movl %esi, %edx 418 movl $0xb80a0, %esi 419 movl $0xb8000, %edi 420 movl $960, %ecx 421 rep movsl 422 423 /* Clear the 24th row */ 424 xorl %eax, %eax 425 movl $40, %ecx 426 rep stosl 427 428 /* Go to row 24 */ 429 movl %edx, %esi 430 movl $0xb8f00, %edi 431 movw $1920, %bx 432 433 jmp err_ploop 434 err_ploop_end: 435 436 /* Write bits 8 - 15 of the cursor address */ 437 movw $0x3d4, %dx 438 movb $0xe, %al 439 outb %al, %dx 440 441 movw $0x3d5, %dx 442 movb %bh, %al 443 outb %al, %dx 444 445 /* Write bits 0 - 7 of the cursor address */ 446 movw $0x3d4, %dx 447 movb $0xf, %al 448 outb %al, %dx 449 450 movw $0x3d5, %dx 451 movb %bl, %al 452 outb %al, %dx 453 454 cli 455 hlt1: 456 hlt 457 jmp hlt1 458 368 459 /** Print string to EGA display (in light green). 369 460 * … … 594 685 ret 595 686 687 #include "vesa_real.inc" 688 596 689 .section K_DATA_START, "aw", @progbits 597 690 … … 627 720 status_non_pse: 628 721 .asciz "[non_pse] " 722 status_vesa_copy: 723 .asciz "[vesa_copy] " 629 724 status_multiboot_cmdline: 630 725 .asciz "[multiboot_cmdline] " 726 status_vesa_real: 727 .asciz "[vesa_real] " 631 728 status_prot2: 632 729 .asciz "[prot2] "
Note:
See TracChangeset
for help on using the changeset viewer.