diff --git a/kernel/trunk/boot/bootcode.inc b/kernel/trunk/boot/bootcode.inc index d8e01a44c0..f0ccdc7336 100644 --- a/kernel/trunk/boot/bootcode.inc +++ b/kernel/trunk/boot/bootcode.inc @@ -105,6 +105,7 @@ sayerr_plain: ; ;========================================================================= +include 'bootvesa.inc' ;Include source for boot vesa start_of_code: cld @@ -285,6 +286,23 @@ wait_loop: ; variant 2 ; wait until 8042 controller is ready loopnz wait_loop +;;;/diamond today 5.02.2008 +; set keyboard typematic rate & delay + mov al, 0xf3 + out 0x60, al + xor cx, cx +@@: + in al, 64h + test al, 2 + loopnz @b + mov al, 0 + out 0x60, al + xor cx, cx +@@: + in al, 64h + test al, 2 + loopnz @b +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; --------------- APM --------------------- and word [es:0x9044], 0 ; ver = 0.0 (APM not found) mov ax, 0x5300 @@ -321,78 +339,46 @@ wait_loop: ; variant 2 apm_end: _setcursor d80x25_top_num, 0 -; DISPLAY VESA INFORMATION +;CHECK current of code + cmp [cfgmanager.loader_block], -1 + jz noloaderblock + les bx, [cfgmanager.loader_block] + cmp byte [es:bx], 1 + mov si, loader_block_error + jnz sayerr + +noloaderblock: +; DISPLAY VESA INFORMATION + call print_vesa_info + call calc_vmodes_table + call check_first_parm ;check and enable cursor_pos - mov ax, 0x4f00 - mov di, 0xa000 - int 0x10 - cmp ax, 0x004f - mov si, novesa - jnz @f - mov ax, [es:di+4] - add ax, '0'*256+'0' - mov si, vervesa - mov [si+vervesa_off], ah - mov [si+vervesa_off+2], al -@@: call print ; \begin{diamond}[30.11.2005] cfgmanager: ; settings: ; a) preboot_graph = graphical mode ; preboot_gprobe = probe this mode? -; b) preboot_biosdisk = use BIOS disks through V86 emulation? +; b) preboot_dma = use DMA access? ; c) preboot_vrrm = use VRR? ; d) preboot_device = from what boot? - mov di, preboot_graph -; check bootloader block - cmp [.loader_block], -1 - jz .noloaderblock - les bx, [.loader_block] - cmp byte [es:bx], 1 - mov si, loader_block_error - jnz sayerr - test byte [es:bx+1], 1 - jz @f -; image in memory present - cmp [di+preboot_device-preboot_graph], 0 - jnz @f - mov [di+preboot_device-preboot_graph], 3 -@@: -.noloaderblock: + ; determine default settings mov [.bSettingsChanged], 0 - cmp byte [di], 0 - jnz .preboot_gr_end - mov [di+preboot_gprobe-preboot_graph], 0 - mov al, [vervesa+vervesa_off] - cmp al, 'x' - jz .novesa - cmp al, '1' - jz .vesa12 - mov [di+preboot_gprobe-preboot_graph], 2 - mov al, 3 - jmp @f -.vesa12: - mov al, 7 - jmp @f -.novesa: - mov al, 10 -@@: - mov [di], al -.preboot_gr_end: -; following 8 lines set variables to 1 if its current value is 0 - cmp [di+preboot_dma-preboot_graph], 1 - adc [di+preboot_dma-preboot_graph], 0 - cmp [di+preboot_biosdisk-preboot_graph], 1 - adc [di+preboot_biosdisk-preboot_graph], 0 - cmp [di+preboot_vrrm-preboot_graph], 1 - adc [di+preboot_vrrm-preboot_graph], 0 - cmp [di+preboot_device-preboot_graph], 1 - adc [di+preboot_device-preboot_graph], 0 + +;.preboot_gr_end: +; following 6 lines set variables to 1 if its current value is 0 + cmp byte[preboot_dma], 1 + adc byte[preboot_dma], 0 + cmp byte[preboot_vrrm], 1 + adc byte[preboot_vrrm], 0 + cmp byte[preboot_device], 1 + adc byte[preboot_device], 0 ; notify user + _setcursor 5,2 + mov si, linef - call print + call printplain mov si, start_msg call print mov si, time_msg @@ -408,48 +394,9 @@ cfgmanager: call print mov si, curvideo_msg call print - mov al, [preboot_graph] - cmp al, 8 - ja .pnovesa - mov dl, al - and eax, 3 - mov si, [modes_msg+eax*2] - call printplain - mov si, modevesa20 - cmp dl, 4 - jbe @f - mov si, modevesa12 -@@: - call printplain - cmp dl, 4 - ja .x - mov si, probeno_msg - cmp [preboot_gprobe], 2 - jnz @f - mov si, probeok_msg -@@: - call printplain -.x: - jmp .c -.pnovesa: - cmp al, 9 - mov si, mode9 - jz @b - mov si, mode10 - jmp @b -.c: - mov si, linef - call printplain -; mov si, dma_msg -; call print -; cmp [preboot_dma], 2 -; mov si, on_msg -; jb @f -; mov si, off_msg -; ja @f -; mov si, readonly_msg -;@@: -; call printplain + + call draw_current_vmode + mov si, usebd_msg cmp [preboot_biosdisk], 1 call .say_on_off @@ -468,18 +415,22 @@ cfgmanager: cli push 0 pop es - mov eax, [es:8*4] - mov [.oldtimer], eax - mov eax, [.timer] - mov [es:8*4], eax + push dword [es:8*4] + pop dword [.oldtimer] + push dword [.timer] + pop dword [es:8*4] +; mov eax, [es:8*4] +; mov [.oldtimer], eax +; mov eax, [.timer] +; mov [es:8*4], eax sti ; wait for keypressed - mov ah, 0 + xor ax,ax int 16h push ax ; restore timer interrupt - push 0 - pop es +; push 0 +; pop es mov eax, [.oldtimer] mov [es:8*4], eax mov [.timer], eax @@ -508,31 +459,38 @@ cfgmanager: _setcursor 13,0 .d: mov [.bSettingsChanged], 1 - mov si, space_msg - call printplain - _setcursor 15,0 - mov cx, 6 -@@: - call printplain - loop @b + call clear_vmodes_table ;clear vmodes_table jmp .printcfg .change_a: - _setcursor 15,0 - mov si, gr_mode - call printplain - mov bx, '09' - call getkey - mov [preboot_graph], al - cmp al, 4 - ja @f - mov si, probetext - call printplain - mov bx, '12' - call getkey - mov [preboot_gprobe], al -@@: - _setcursor 10,0 +.loops: + call draw_vmodes_table + + xor ax,ax + int 0x16 +; call clear_table_cursor ;clear current position of cursor + + mov si,word [cursor_pos] + + cmp ah,0x48;x,0x48E0 ; up + jne .down + cmp si,modes_table + jbe .loops + sub word [cursor_pos],size_of_step + jmp .loops + +.down: cmp ah,0x50;x,0x50E0 ; down + jne .enter + cmp word[es:si+10],-1 + je .loops + add word [cursor_pos],size_of_step + jmp .loops + +.enter: cmp al,0x0D;x,0x1C0D ; enter + jne .loops + push word [cursor_pos] + pop word [preboot_graph] ;save choose jmp .d + .change_b: _setcursor 15,0 ; mov si, ask_dma @@ -556,6 +514,7 @@ cfgmanager: mov [preboot_vrrm], al _setcursor 12,0 jmp .d +;;;;;;;;;;;;;;;;;;;;;;;;;;;; .say_on_off: pushf call print @@ -687,115 +646,7 @@ end if ; ASK GRAPHICS MODE - movzx ax, [preboot_graph] - push 0 - pop es -; address is gr_table+6*(ax-1) - add ax, ax - lea si, [gr_table + eax + eax*2 - 6] - mov bx, [si+0] - mov cx, [si+2] - mov dx, [si+4] - cmp al, 9*2 - mov al, 32 ; BPP - jb @f - mov [es:0x9000], al - or dword [es:0x9018], 0xFFFFFFFF; 0x800000 -@@: - mov [es:0x9008], bx - mov [es:0x900A], cx - mov [es:0x900C], dx - test bh, bh - jz nov - -; USE DEFAULTS OR PROBE - -; bx - mode : cx - x size : dx - y size - cmp [preboot_gprobe], 1 - jz noprobe - - mov bx, 0x100 - newprobe: - inc bx - cmp bx, 0x17f - mov si, prnotfnd - jz invalid_video_mode - - probemore: - push cx - mov ax, 0x4f01 - mov cx, bx - mov di, 0xa000 - int 0x10 - pop cx - - test byte [es:di], 80h ; lfb? - jz newprobe - cmp [es:di+0x12], cx ; x size? - jnz newprobe - cmp [es:di+0x14], dx ; y size? - jnz newprobe - cmp byte [es:di+0x19], 32 ;24 - jb newprobe - -; add bx, 0100000000000000b - or bh, 40h - mov [es:0x9008], bx - - noprobe: - - -; FIND VESA 2.0 LFB & BPP - - mov ax, 0x4f01 - mov cx, bx - and cx, 0xfff - mov di, 0xa000 - int 0x10 - ; LFB - mov eax, [es:di+0x28] - mov [es:0x9018], eax - ; ---- vbe voodoo - BytesPerLine equ 0x10 - mov ax, [es:di+BytesPerLine] - mov [es:0x9001], ax - ; BPP - mov al, byte [es:di+0x19] - mov [es:0x9000], al -nov: - cmp al, 24 - mov si, bt24 - jz bppl - cmp al, 32 - mov si, bt32 - jz bppl - mov si, btns -invalid_video_mode: - call print - _setcursor (d80x25_top_num+2), 0 - mov si, start_msg - call print - jmp cfgmanager.printcfg -bppl: - call print - - -; FIND VESA 1.2 PM BANK SWITCH ADDRESS - - push es - mov ax, 0x4f0A - xor bx, bx - int 0x10 - xor eax, eax - mov ax, es - shl eax, 4 - movzx ebx, di - add eax, ebx - mov bx, [es:di] - add eax, ebx - pop es - mov [es:0x9014], eax - + call set_vmode ; GRAPHICS ACCELERATION ; force yes @@ -1109,7 +960,7 @@ setgr: int 0x10 test ah, ah mov si, fatalsel - jnz sayerr + jnz v_mode_error ; set mode 0x12 graphics registers: cmp bx, 0x12 jne gmok2 diff --git a/kernel/trunk/boot/booteng.inc b/kernel/trunk/boot/booteng.inc index 0b627f8316..89340078c9 100644 --- a/kernel/trunk/boot/booteng.inc +++ b/kernel/trunk/boot/booteng.inc @@ -18,7 +18,7 @@ d80x25_bottom_num = 3 novesa db "Display: EGA/CGA",13,10,0 vervesa db "Version of Vesa: Vesa x.x",13,10,0 vervesa_off=22 -msg_apm db " APM x.x ", 0 +msg_apm db " APM x.x ", 0 gr_mode db 186," Vesa 2.0+ 16 M LFB: [1] 640x480, [2] 800x600, " db "[3] 1024x768, [4] 1280x1024",13,10 db 186," Vesa 1.2 16 M Bnk: [5] 640x480, [6] 800x600, " @@ -100,3 +100,9 @@ pdm4 db "create blank image",13,10,0 loading_msg db "Loading KolibriOS...",0 save_quest db "Remember current settings? [y/n]: ",0 loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0 + +_st db 186,' Ŀ',13,10,0 +_r1 db 186,' 320x200 EGA/CGA 256 colors ۳',13,10,0 +_r2 db 186,' 640x480 VGA 16 colors ۳',13,10,0 +_rs db 186,' ????x????@?? SVGA VESA ۳',13,10,0 +_bt db 186,' ',13,10,0 diff --git a/kernel/trunk/boot/bootru.inc b/kernel/trunk/boot/bootru.inc index c00d2b02e3..972a332c44 100644 --- a/kernel/trunk/boot/bootru.inc +++ b/kernel/trunk/boot/bootru.inc @@ -15,55 +15,39 @@ d80x25_bottom: line_full_bottom d80x25_bottom_num = 3 +msg_apm db " APM x.x ", 0 novesa db ": EGA/CGA",13,10,0 -vervesa db " VESA: Vesa x.x",13,10,0 -vervesa_off=19 -msg_apm db " APM x.x ", 0 -gr_mode db 186," Vesa 2.0+ 16 M LFB: [1] 640x480, [2] 800x600, " - db "[3] 1024x768, [4] 1280x1024",13,10 - db 186," Vesa 1.2 16 M Bnk: [5] 640x480, [6] 800x600, " - db "[7] 1024x768, [8] 1280x1024",13,10 - db 186," EGA/CGA 256 ⮢: [9] 320x200, " - db "VGA 16 ⮢: [0] 640x480",13,10 - db 186," 롥 ०: ",0 -bt24 db "㡨 梥: 24",13,10,0 -bt32 db "㡨 梥: 32",13,10,0 +s_vesa db " VESA: " + .ver db "?.?",13,10,0 + +;vervesa db " VESA: Vesa x.x",13,10,0 +;vervesa_off=19 +gr_mode db "롥 ०: ",13,10,0 +s_bpp db 13,10,186," 㡨 梥: " + .bpp dw "??" + db 13,10,0 vrrmprint db "ᯮ짮 VRR? ( ஢ 60 " db " ⮫쪮 室:",13,10 db 186," 1024*768>800*600 800*600>640*480) [1-, 2-]: ",0 -;askmouse db ":" ; 186, " " -; db " [1] PS/2 (USB), [2] Com1, [3] Com2." -; db " 롥 [1-3]: ",0 -;no_com1 db 13,10,186," No COM1 mouse",0 -;no_com2 db 13,10,186," No COM2 mouse",0 ;ask_dma db "ᯮ짮 DMA 㯠 HDD? [1-, 2-⮫쪮 ⥭, 3-]: ",0 ask_bd db " ᪨, १ BIOS ० V86? [1-, 2-]: ",0 -;gr_direct db 186," ᯮ짮 ? " -; db "[1-/2-]: ",0 -;mem_model db 13,10,186," + [1-16 Mb / 2-32 Mb / " -; db "3-64Mb / 4-128 Mb / 5-256 Mb]: ",0 -;bootlog db 13,10,186," ᬮ ୠ 㧪? [1-/2-]: ",0 bdev db "㧨 ࠧ [1-᪥; 2-C:\kolibri.img (FAT32);" db 13,10,186," " db "3-ᯮ짮 㦥 㦥 ࠧ;" db 13,10,186," " db "4-ᮧ ࠧ]: ",0 -probetext db 13,10,13,10,186," ⠭ ०? [1-, " - db "2-஢ 㣨 (Vesa 3.0)]: ",0 -;memokz256 db 13,10,186," RAM 256 Mb",0 -;memokz128 db 13,10,186," RAM 128 Mb",0 -;memokz64 db 13,10,186," RAM 64 Mb",0 -;memokz32 db 13,10,186," RAM 32 Mb",0 -;memokz16 db 13,10,186," RAM 16 Mb",0 +;probetext db 13,10,13,10,186," ⠭ ०? [1-, " +; db "2-஢ 㣨 (Vesa 3.0)]: ",0 prnotfnd db "訡 - ० .",0 -;modena db "訡 - ॡ প VBE 0x112+.",0 not386 db "訡 - ॡ 386+.",0 -btns db "訡 - । 㡨 梥.",0 +;not_PENT_PRO db "訡 - ॡ Pentium PRO .",0 +;btns db "訡 - । 㡨 梥.",0 fatalsel db "訡 - ࠭ ० ন.",0 +pres_key db " , 室 롮 ०.",0 badsect db 13,10,186," 訡 - ᪥ ०. ஡ .",0 memmovefailed db 13,10,186," 訡 - Int 0x15 move failed.",0 okt db " ... OK" -linef db 13,10,0 +linef db 13,10,0 diskload db "㧪 ᪥: 00 %",8,8,8,8,0 pros db "00" backspace2 db 8,8,0 @@ -74,22 +58,18 @@ time_str db " 5 ᥪ㭤 " db " ⮬᪮ த",13,10,0 current_cfg_msg db "騥 ன:",13,10,0 curvideo_msg db " [a] ०: ",0 -mode1 db "640x480",0 -mode2 db "800x600",0 -mode3 db "1024x768",0 -mode4 db "1280x1024",0 -modes_msg dw mode4,mode1,mode2,mode3 modevesa20 db " LFB",0 modevesa12 db ", VESA 1.2 Bnk",0 -mode9 db "320x200, EGA/CGA 256 梥⮢",0 -mode10 db "640x480, VGA 16 梥⮢",0 -probeno_msg db " (⠭ ०)",0 -probeok_msg db " (஢ ⠭ ०)",0 + +mode0 db "320x200, EGA/CGA 256 梥⮢",13,10,0 +mode9 db "640x480, VGA 16 梥⮢",13,10,0 +;probeno_msg db " (⠭ ०)",0 +;probeok_msg db " (஢ ⠭ ०)",0 ;dma_msg db " [b] ᯮ짮 DMA 㯠 HDD:",0 usebd_msg db " [b] ᪨, १ BIOS:",0 on_msg db " ",13,10,0 off_msg db " 몫",13,10,0 -;readonly_msg db " ⮫쪮 ⥭",13,10,0 +readonly_msg db " ⮫쪮 ⥭",13,10,0 vrrm_msg db " [c] ᯮ짮 VRR:",0 preboot_device_msg db " [d] ࠧ ᪥: ",0 preboot_device_msgs dw 0,pdm1,pdm2,pdm3,pdm4 @@ -100,3 +80,34 @@ pdm4 db "ᮧ loading_msg db " 㧪 KolibriOS...",0 save_quest db " ⥪騥 ன? [y/n]: ",0 loader_block_error db "訡 砫쭮 稪, த .",0 + +;_oem db 'oem: ',0 + +;db 5 +;s_ven_intel db 'Intel' +;db 2 +;s_ven_s3 db 'S3' +;;db 5 +;s_ven_bochs db 'Bochs' +;db 8 +;s_ven_vmware db 'V M ware' + +;s_mode db " ????-????-?? (?) ",0 +;s_mode1 db " 0640-0480-04 (a) 0320-0200-08 (b) ",13,10,0 + +_st db 186,' Ŀ',13,10,0 +_r1 db 186,' 320x200 EGA/CGA 256 梥⮢ ۳',13,10,0 +_r2 db 186,' 640x480 VGA 16 梥⮢ ۳',13,10,0 +_rs db 186,' ????x????@?? SVGA VESA ۳',13,10,0 +_bt db 186,' ',13,10,0 + +;_tl db 186,' Ŀ',13,10,\ +; 186,' 4 8 15 16 24 32 ',13,10,\ +; 186,' Ŀ',13,10,0 +;_rs db 186,' ????x???? ۳',13,10,0 +;_bt db 186,' ',13,10,0 + + +;_sel1 db 0x1A,0 +;_sel2 db 0x1B,0 +;_selc db ' ',0 diff --git a/kernel/trunk/data16.inc b/kernel/trunk/data16.inc index d171156260..fbad4416eb 100644 --- a/kernel/trunk/data16.inc +++ b/kernel/trunk/data16.inc @@ -21,20 +21,6 @@ kernel_restart_bootblock: dw 1 ; floppy image is in memory dd 0 ; cannot save parameters -align 4 -; videomodes table -gr_table: - dw 0x112+0100000000000000b , 640 , 480 ; 1 - dw 0x115+0100000000000000b , 800 , 600 ; 2 - dw 0x118+0100000000000000b , 1024 , 768 ; 3 - dw 0x11B+0100000000000000b , 1280 , 1024 ; 4 - dw 0x112 , 640 , 480 ; 5 - dw 0x115 , 800 , 600 ; 6 - dw 0x118 , 1024 , 768 ; 7 - dw 0x11B , 1280 ,1024 ; 8 - dw 0x13, 640, 480 ; 9 - dw 0x12, 640, 480 ; 0 - ; table for move to extended memory (int 15h, ah=87h) align 8 movedesc: