Import backup from 2003-08-17_2

This commit is contained in:
Josh Holtrop 2003-08-17 22:01:00 -04:00
parent 43f3ea24f8
commit 9ee980bc94
2 changed files with 44 additions and 4 deletions

View File

@ -16,7 +16,6 @@
%define BOOT_VESA_OEM 0x0004 ;258 - null-terminated OEM identification string %define BOOT_VESA_OEM 0x0004 ;258 - null-terminated OEM identification string
%define BOOT_VESA_VBE 0x0106 ;512 - copy of VESA VBEInfoBlock %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_INFO 0x0306 ;256 - copy of VESA ModeInfoBlock for selected mode
%define BOOT_VESA_LFB 0x0406 ;1 - boolean: are we using LFB or not

View File

@ -195,7 +195,16 @@ copydisk_loop:
loop read_cylinder 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 xor ax, ax
mov gs, ax mov gs, ax
mov ds, ax mov ds, ax
@ -389,6 +398,7 @@ vesa_getchoice:
mov si, cx ;ds:si points to word containing selected mode# mov si, cx ;ds:si points to word containing selected mode#
lodsw lodsw
mov cx, ax mov cx, ax
mov dx, ax ;cx and dx hold mode#
mov ax, VESA_MODEINFO_SEG mov ax, VESA_MODEINFO_SEG
mov es, ax mov es, ax
@ -397,11 +407,40 @@ vesa_getchoice:
int 0x10 int 0x10
call checkvesa call checkvesa
mov dx, 20 mov ax, VESA_MODEINFO_SEG
call vesa_showmodeinfo 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: vesa_consolemode_only:
mov ax, BOOT_DATA_SEG
mov es, ax
mov word [es:BOOT_VESA], 0
jmp vesa_done jmp vesa_done
@ -493,6 +532,8 @@ checkmode:
jz vesa_modenogood jz vesa_modenogood
test al, 0x10 ;graphics mode test al, 0x10 ;graphics mode
jz vesa_modenogood jz vesa_modenogood
test al, 0x80 ;Linear Frame Buffer supported
jz vesa_modenogood
mov al, [es:di+25] ;BitsPerPixel mov al, [es:di+25] ;BitsPerPixel
cmp al, 16 cmp al, 16
jz vesa_bppok jz vesa_bppok