Fix kernel crash on high screen resolution.

Increase MAX_SCREEN_WIDTH=3840 and MAX_SCREEN_HEIGHT=2160.
Replace hardcoded numbers with macros, add runtime checks.

git-svn-id: svn://kolibrios.org@7522 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Baravy 2018-11-02 00:14:46 +00:00
parent babba2a8ce
commit cf7de4af9c
4 changed files with 11 additions and 4 deletions

View File

@ -733,6 +733,9 @@ virtual at OS_BASE + BOOT_VARS
BOOT boot_data
end virtual
MAX_SCREEN_WIDTH = 3840
MAX_SCREEN_HEIGHT = 2160
struct display_t
x dd ?
y dd ?

View File

@ -341,8 +341,8 @@ fpu_data:
fpu_data_size = $ - fpu_data
draw_data:
rb 32*256
BPSLine_calc_area rd 1440
d_width_calc_area rd 1140
BPSLine_calc_area rd MAX_SCREEN_HEIGHT
d_width_calc_area rd MAX_SCREEN_HEIGHT
mouseunder rd 16*24
mem_block_list rd 64*2

View File

@ -45,6 +45,8 @@ init_video:
mov [_display.vrefresh], 60
movzx eax, word [BOOT.x_res]; X max
cmp eax, MAX_SCREEN_WIDTH
ja $
mov [_display.width], eax
mov [ebp+FRB.width], eax
mov [display_width_standard], eax
@ -52,6 +54,8 @@ init_video:
mov [screen_workarea.right], eax
movzx eax, word [BOOT.y_res]; Y max
cmp eax, MAX_SCREEN_HEIGHT
ja $
mov [_display.height], eax
mov [ebp+FRB.height], eax
mov [display_height_standard], eax

View File

@ -21,8 +21,8 @@ $Revision$
uglobal
align 4
bgr_cur_line rd 1920 ; maximum width of screen
bgr_next_line rd 1920
bgr_cur_line rd MAX_SCREEN_WIDTH
bgr_next_line rd MAX_SCREEN_WIDTH
endg
iglobal