Changeset 9a791eb9 in mainline
- Timestamp:
- 2018-11-12T20:54:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e3fa1720
- Parents:
- 17aa6d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/boot/multiboot.S
r17aa6d1 r9a791eb9 49 49 50 50 .code32 51 52 .macro pm_error msg53 movl \msg, %esi54 jmp pm_error_halt55 .endm56 51 57 52 .macro pm_status msg … … 370 365 371 366 ret 372 373 /** Print string to EGA display (in light red) and halt.374 *375 * Should be executed from 32 bit protected mode with paging376 * turned off. Stack is not required. This routine is used even377 * if CONFIG_EGA is not enabled. Since we are going to halt the378 * CPU anyway, it is always better to at least try to print379 * some hints.380 *381 * @param %esi NULL-terminated string to print.382 *383 */384 pm_error_halt:385 movl $0xb8000, %edi /* base of EGA text mode memory */386 xorl %eax, %eax387 388 /* Read bits 8 - 15 of the cursor address */389 movw $0x3d4, %dx390 movb $0xe, %al391 outb %al, %dx392 393 movw $0x3d5, %dx394 inb %dx, %al395 shl $8, %ax396 397 /* Read bits 0 - 7 of the cursor address */398 movw $0x3d4, %dx399 movb $0xf, %al400 outb %al, %dx401 402 movw $0x3d5, %dx403 inb %dx, %al404 405 /* Sanity check for the cursor on screen */406 cmp $2000, %ax407 jb err_cursor_ok408 409 movw $1998, %ax410 411 err_cursor_ok:412 413 movw %ax, %bx414 shl $1, %eax415 addl %eax, %edi416 417 err_ploop:418 lodsb419 420 cmp $0, %al421 je err_ploop_end422 423 movb $0x0c, %ah /* black background, light red foreground */424 stosw425 426 /* Sanity check for the cursor on the last line */427 inc %bx428 cmp $2000, %bx429 jb err_ploop430 431 /* Scroll the screen (24 rows) */432 movl %esi, %edx433 movl $0xb80a0, %esi434 movl $0xb8000, %edi435 movl $960, %ecx436 rep movsl437 438 /* Clear the 24th row */439 xorl %eax, %eax440 movl $40, %ecx441 rep stosl442 443 /* Go to row 24 */444 movl %edx, %esi445 movl $0xb8f00, %edi446 movw $1920, %bx447 448 jmp err_ploop449 err_ploop_end:450 451 /* Write bits 8 - 15 of the cursor address */452 movw $0x3d4, %dx453 movb $0xe, %al454 outb %al, %dx455 456 movw $0x3d5, %dx457 movb %bh, %al458 outb %al, %dx459 460 /* Write bits 0 - 7 of the cursor address */461 movw $0x3d4, %dx462 movb $0xf, %al463 outb %al, %dx464 465 movw $0x3d5, %dx466 movb %bl, %al467 outb %al, %dx468 469 cli470 hlt1:471 hlt472 jmp hlt1473 367 474 368 /** Print string to EGA display (in light green).
Note:
See TracChangeset
for help on using the changeset viewer.