Ignore:
File:
1 edited

Legend:

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

    r8be3230 r36aec61e  
    2121#define VESA_END_OF_MODES  0xffff
    2222
    23 #define VESA_OK  0x4f
     23#define VESA_OK  0x004f
    2424
    2525#define VESA_GET_INFO       0x4f00
     
    180180
    181181        pop %di
    182         cmp $VESA_OK, %al
     182        cmp $VESA_OK, %ax
    183183        jnz no_mode
    184184
     
    207207                pop %di
    208208                pop %cx
    209                 cmp $VESA_OK, %al
     209                cmp $VESA_OK, %ax
    210210                jne no_mode
    211211
     
    254254
    255255                pop %di
    256                 cmp $VESA_OK, %al
     256                cmp $VESA_OK, %ax
    257257                jnz no_mode
    258258
     
    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
     
    373396                pop %cx
    374397                pop %di
    375                 cmp $VESA_OK, %al
     398                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.