From 9ee980bc94c6415f9a21f314c257ea4b87b2eec6 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 17 Aug 2003 22:01:00 -0400 Subject: [PATCH] Import backup from 2003-08-17_2 --- bootdef.inc | 1 - stage2.asm | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/bootdef.inc b/bootdef.inc index 4829168..47e4e1e 100644 --- a/bootdef.inc +++ b/bootdef.inc @@ -16,7 +16,6 @@ %define BOOT_VESA_OEM 0x0004 ;258 - null-terminated OEM identification string %define BOOT_VESA_VBE 0x0106 ;512 - copy of VESA VBEInfoBlock %define BOOT_VESA_INFO 0x0306 ;256 - copy of VESA ModeInfoBlock for selected mode -%define BOOT_VESA_LFB 0x0406 ;1 - boolean: are we using LFB or not diff --git a/stage2.asm b/stage2.asm index b67b614..5e2b356 100644 --- a/stage2.asm +++ b/stage2.asm @@ -195,7 +195,16 @@ copydisk_loop: loop read_cylinder ;------------------------------------------------------ -no_rd: ;done with ram disk, on to vesa info... +no_rd: + xor ax, ax + mov ds, ax + mov dx, 4 ;we'll assume the system has 4 megabytes of RAM... + mov esi, 0x3FFFFC ;4 bytes under 4 MB + + + + + ;on to vesa info... xor ax, ax mov gs, ax mov ds, ax @@ -389,6 +398,7 @@ vesa_getchoice: mov si, cx ;ds:si points to word containing selected mode# lodsw mov cx, ax + mov dx, ax ;cx and dx hold mode# mov ax, VESA_MODEINFO_SEG mov es, ax @@ -397,11 +407,40 @@ vesa_getchoice: int 0x10 call checkvesa - mov dx, 20 - call vesa_showmodeinfo + mov ax, VESA_MODEINFO_SEG + mov ds, ax + xor si, si + mov ax, BOOT_DATA_SEG + mov es, ax + mov di, BOOT_VESA_INFO + mov cx, 256 +vesa_copymodeinfo_loop: + lodsb + stosb + loop vesa_copymodeinfo_loop ;store ModeInfoBlock for current + mov [es:BOOT_VESA], dx ;store mode# for kernel + + mov ax, 0xb800 + mov es, ax + xor di, di + mov al, dh + call puthex2 + mov al, dl + call puthex2 + + mov bx, dx + or bx, 0x4000 ;set "use LFB" bit of mode# + mov ax, 0x4F02 + int 0x10 ;switch to graphics mode!!! + call checkvesa + + jmp vesa_done vesa_consolemode_only: + mov ax, BOOT_DATA_SEG + mov es, ax + mov word [es:BOOT_VESA], 0 jmp vesa_done @@ -493,6 +532,8 @@ checkmode: jz vesa_modenogood test al, 0x10 ;graphics mode jz vesa_modenogood + test al, 0x80 ;Linear Frame Buffer supported + jz vesa_modenogood mov al, [es:di+25] ;BitsPerPixel cmp al, 16 jz vesa_bppok