Changes in kernel/arch/ia32/src/boot/multiboot.S [bae43dc:9a791eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/boot/multiboot.S
rbae43dc r9a791eb9 38 38 #include <arch/cpu.h> 39 39 40 // TODO: most of this file can be rewritten in C 41 42 // TODO: FB state should be checked dynamically from provided multiboot info. 43 // Currently we only enable EGA statically, which forces us to rebuild 44 // the image to get very early debug output. 45 40 46 #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) 41 47 … … 44 50 .code32 45 51 46 .macro pm_error msg47 movl \msg, %esi48 jmp pm_error_halt49 .endm50 51 52 .macro pm_status msg 52 #if def CONFIG_EGA53 #if defined(CONFIG_EGA) && !defined(CONFIG_FB) 53 54 pushl %esi 54 55 movl \msg, %esi … … 66 67 multiboot_header: 67 68 .long MULTIBOOT_HEADER_MAGIC 69 #ifdef CONFIG_FB 68 70 .long MULTIBOOT_HEADER_FLAGS 69 71 .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) /* checksum */ 72 #else 73 .long MULTIBOOT_HEADER_FLAGS_NOFB 74 .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS_NOFB) /* checksum */ 75 #endif 70 76 .long multiboot_header 71 77 .long unmapped_start … … 73 79 .long 0 74 80 .long multiboot_image_start 81 #ifdef CONFIG_FB 82 .long 0 83 .long CONFIG_BFB_WIDTH 84 .long CONFIG_BFB_HEIGHT 85 .long CONFIG_BFB_BPP 86 #endif 75 87 76 88 SYMBOL(multiboot_image_start) … … 104 116 105 117 pm_status $status_prot 106 107 #include "vesa_prot.inc"108 118 109 119 #ifndef PROCESSOR_i486 … … 356 366 ret 357 367 358 /** Print string to EGA display (in light red) and halt.359 *360 * Should be executed from 32 bit protected mode with paging361 * turned off. Stack is not required. This routine is used even362 * if CONFIG_EGA is not enabled. Since we are going to halt the363 * CPU anyway, it is always better to at least try to print364 * 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, %eax372 373 /* Read bits 8 - 15 of the cursor address */374 movw $0x3d4, %dx375 movb $0xe, %al376 outb %al, %dx377 378 movw $0x3d5, %dx379 inb %dx, %al380 shl $8, %ax381 382 /* Read bits 0 - 7 of the cursor address */383 movw $0x3d4, %dx384 movb $0xf, %al385 outb %al, %dx386 387 movw $0x3d5, %dx388 inb %dx, %al389 390 /* Sanity check for the cursor on screen */391 cmp $2000, %ax392 jb err_cursor_ok393 394 movw $1998, %ax395 396 err_cursor_ok:397 398 movw %ax, %bx399 shl $1, %eax400 addl %eax, %edi401 402 err_ploop:403 lodsb404 405 cmp $0, %al406 je err_ploop_end407 408 movb $0x0c, %ah /* black background, light red foreground */409 stosw410 411 /* Sanity check for the cursor on the last line */412 inc %bx413 cmp $2000, %bx414 jb err_ploop415 416 /* Scroll the screen (24 rows) */417 movl %esi, %edx418 movl $0xb80a0, %esi419 movl $0xb8000, %edi420 movl $960, %ecx421 rep movsl422 423 /* Clear the 24th row */424 xorl %eax, %eax425 movl $40, %ecx426 rep stosl427 428 /* Go to row 24 */429 movl %edx, %esi430 movl $0xb8f00, %edi431 movw $1920, %bx432 433 jmp err_ploop434 err_ploop_end:435 436 /* Write bits 8 - 15 of the cursor address */437 movw $0x3d4, %dx438 movb $0xe, %al439 outb %al, %dx440 441 movw $0x3d5, %dx442 movb %bh, %al443 outb %al, %dx444 445 /* Write bits 0 - 7 of the cursor address */446 movw $0x3d4, %dx447 movb $0xf, %al448 outb %al, %dx449 450 movw $0x3d5, %dx451 movb %bl, %al452 outb %al, %dx453 454 cli455 hlt1:456 hlt457 jmp hlt1458 459 368 /** Print string to EGA display (in light green). 460 369 * … … 685 594 ret 686 595 687 #include "vesa_real.inc"688 689 596 .section K_DATA_START, "aw", @progbits 690 597 … … 720 627 status_non_pse: 721 628 .asciz "[non_pse] " 722 status_vesa_copy:723 .asciz "[vesa_copy] "724 629 status_multiboot_cmdline: 725 630 .asciz "[multiboot_cmdline] " 726 status_vesa_real:727 .asciz "[vesa_real] "728 631 status_prot2: 729 632 .asciz "[prot2] "
Note:
See TracChangeset
for help on using the changeset viewer.