Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset dc41772 in mainline


Ignore:
Timestamp:
2018-11-18T01:00:49Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
ec18e454
Parents:
e131833c
Message:

Revert "Remove dead code" - needs more work

This reverts commit 9a791eb9411b32c4c733f382971ad899794149b1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/boot/multiboot.S

    re131833c rdc41772  
    4949
    5050.code32
     51
     52.macro pm_error msg
     53        movl \msg, %esi
     54        jmp pm_error_halt
     55.endm
    5156
    5257.macro pm_status msg
     
    365370
    366371                        ret
     372
     373/** Print string to EGA display (in light red) and halt.
     374 *
     375 * Should be executed from 32 bit protected mode with paging
     376 * turned off. Stack is not required. This routine is used even
     377 * if CONFIG_EGA is not enabled. Since we are going to halt the
     378 * CPU anyway, it is always better to at least try to print
     379 * some hints.
     380 *
     381 * @param %esi NULL-terminated string to print.
     382 *
     383 */
     384pm_error_halt:
     385        movl $0xb8000, %edi  /* base of EGA text mode memory */
     386        xorl %eax, %eax
     387
     388        /* Read bits 8 - 15 of the cursor address */
     389        movw $0x3d4, %dx
     390        movb $0xe, %al
     391        outb %al, %dx
     392
     393        movw $0x3d5, %dx
     394        inb %dx, %al
     395        shl $8, %ax
     396
     397        /* Read bits 0 - 7 of the cursor address */
     398        movw $0x3d4, %dx
     399        movb $0xf, %al
     400        outb %al, %dx
     401
     402        movw $0x3d5, %dx
     403        inb %dx, %al
     404
     405        /* Sanity check for the cursor on screen */
     406        cmp $2000, %ax
     407        jb err_cursor_ok
     408
     409                movw $1998, %ax
     410
     411        err_cursor_ok:
     412
     413        movw %ax, %bx
     414        shl $1, %eax
     415        addl %eax, %edi
     416
     417        err_ploop:
     418                lodsb
     419
     420                cmp $0, %al
     421                je err_ploop_end
     422
     423                movb $0x0c, %ah  /* black background, light red foreground */
     424                stosw
     425
     426                /* Sanity check for the cursor on the last line */
     427                inc %bx
     428                cmp $2000, %bx
     429                jb err_ploop
     430
     431                /* Scroll the screen (24 rows) */
     432                movl %esi, %edx
     433                movl $0xb80a0, %esi
     434                movl $0xb8000, %edi
     435                movl $960, %ecx
     436                rep movsl
     437
     438                /* Clear the 24th row */
     439                xorl %eax, %eax
     440                movl $40, %ecx
     441                rep stosl
     442
     443                /* Go to row 24 */
     444                movl %edx, %esi
     445                movl $0xb8f00, %edi
     446                movw $1920, %bx
     447
     448                jmp err_ploop
     449        err_ploop_end:
     450
     451        /* Write bits 8 - 15 of the cursor address */
     452        movw $0x3d4, %dx
     453        movb $0xe, %al
     454        outb %al, %dx
     455
     456        movw $0x3d5, %dx
     457        movb %bh, %al
     458        outb %al, %dx
     459
     460        /* Write bits 0 - 7 of the cursor address */
     461        movw $0x3d4, %dx
     462        movb $0xf, %al
     463        outb %al, %dx
     464
     465        movw $0x3d5, %dx
     466        movb %bl, %al
     467        outb %al, %dx
     468
     469        cli
     470        hlt1:
     471                hlt
     472                jmp hlt1
    367473
    368474/** Print string to EGA display (in light green).
Note: See TracChangeset for help on using the changeset viewer.