Changeset 36aec61e in mainline


Ignore:
Timestamp:
2022-01-29T21:24:40Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7fc81da
Parents:
485f899
Message:

Verify fallback VESA mode before attempting to set it

The mode must be listed in the list of supported modes and it
must have the correct attributes (e.g., supported, having linear
frame buffer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/boot/vesa_real.inc

    r485f899 r36aec61e  
    364364
    365365                /* No prefered mode found */
    366 
     366                push %di
     367                mov $e_vesa_init - vesa_init, %di
     368                mov 2 + VESA_MODE_LIST_PTR_OFFSET(%di), %si
     369                mov %si, %gs
     370                mov VESA_MODE_LIST_PTR_OFFSET(%di), %si
     371                pop %di
     372
     373                /* Check if list of supported modes contains fallback mode */
     374        find_fallback_mode:
     375
     376                mov %gs:(%si), %cx
     377
     378                cmp $0x111, %cx
     379                je fallback_mode_listed
     380
     381                cmp $VESA_END_OF_MODES, %cx
     382                je text_mode
     383
     384                inc %si
     385                inc %si
     386                jmp find_fallback_mode /* 16-bit relative jump */
     387
     388        fallback_mode_listed:
     389                /* Make sure fallback mode is really supported */
    367390                mov $0x111, %cx
    368391                push %di
     
    375398                cmp $VESA_OK, %ax
    376399                jnz text_mode
    377                 jz set_mode  /* force relative jump */
     400
     401                /* Verify mode attributes */
     402                and $0x99, %ax
     403                cmp $0x99, %ax
     404                jne text_mode
     405
     406                jmp set_mode  /* 16-bit relative jump */
    378407
    379408        text_mode:
Note: See TracChangeset for help on using the changeset viewer.