* unknown/unsupported videomode at boot leads to return in config manager

* boot config manager now allows to totally disable DMA access to HD

git-svn-id: svn://kolibrios.org@514 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond)
2007-05-21 13:25:02 +00:00
parent 4c1ad6f2c7
commit 875ba74b27
9 changed files with 573 additions and 562 deletions

10
kernel/trunk/blkdev/hd_drv.inc Executable file → Normal file
View File

@@ -54,6 +54,9 @@ hd_read:
call find_empty_slot ; ret in edi
cmp [hd_error],0
jne return_01
; DMA read is permitted if [allow_dma_access]=1 or 2
cmp [allow_dma_access], 2
ja .nodma
cmp [dma_hdd], 1
jnz .nodma
call hd_read_dma
@@ -229,8 +232,9 @@ write_cache:
cmp eax,[PARTITION_END]
ja danger
cmp [allow_dma_write], 1
jnz .nodma
; DMA write is permitted only if [allow_dma_access]=1
cmp [allow_dma_access], 2
jae .nodma
cmp [dma_hdd], 1
jnz .nodma
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -601,7 +605,7 @@ cache_chain_size db 0
cache_chain_started db 0
dma_task_switched db 0
dma_hdd db 0
allow_dma_write db 0
allow_dma_access db 0
endg
align 4

View File

@@ -109,6 +109,7 @@ sayerr_plain:
start_of_code:
cld
; \begin{diamond}[02.12.2005]
; if bootloader sets ax = 'KL', then ds:si points to loader block
cmp ax, 'KL'
jnz @f
mov word [cs:cfgmanager.loader_block], si
@@ -116,7 +117,9 @@ start_of_code:
@@:
; \end{diamond}[02.12.2005]
cmp cx,'HA' ; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source hard disk
; (see comment to bx_from_load)
cmp cx, 'HA'
jnz no_hd_load
cmp dx,'RD'
jnz no_hd_load
@@ -157,7 +160,7 @@ else if lang eq et
mov bp, ET_FNT ; ET_FNT1
mov bx, 1000h ;
mov cx, 255 ; 256 symbols
mov dx,0h ; 0 - position of first symbol
xor dx, dx ; 0 - position of first symbol
mov ax, 1100h
int 10h
end if
@@ -177,9 +180,8 @@ end if
loop @b
; draw spaces
mov si, space_msg
mov cx, 25 - d80x25_top_num - d80x25_bottom_num
mov dx, 25 - d80x25_top_num - d80x25_bottom_num
dfl1:
push cx
push si
mov cx, 80
@@:
@@ -187,8 +189,8 @@ dfl1:
stosw
loop @b
pop si
pop cx
loop dfl1
dec dx
jnz dfl1
; draw bottom
mov si, d80x25_bottom
mov cx, d80x25_bottom_num * 80
@@ -247,19 +249,19 @@ sayerr:
; a) class 1, subclass 1, programming interface 0x80
mov ax, 0xB103
mov ecx, 1*10000h + 1*100h + 0x80
mov si, 0 ; device index = 0
xor si, si ; device index = 0
int 0x1A
jnc .found
; b) class 1, subclass 1, programming interface 0x8A
mov ax, 0xB103
mov ecx, 1*10000h + 1*100h + 0x8A
mov si, 0 ; device index = 0
xor si, si ; device index = 0
int 0x1A
jnc .found
; c) class 1, subclass 1, programming interface 0x85
mov ax, 0xB103
mov ecx, 1*10000h + 1*100h + 0x85
mov si, 0
xor si, si
int 0x1A
jc .nopci
.found:
@@ -284,9 +286,7 @@ wait_loop: ; variant 2
loopnz wait_loop
; --------------- APM ---------------------
push 0
pop es
mov word [es : 0x9044], 0 ; ver = 0.0 (APM not found)
and word [es:0x9044], 0 ; ver = 0.0 (APM not found)
mov ax, 0x5300
xor bx, bx
int 0x15
@@ -313,9 +313,6 @@ wait_loop: ; variant 2
xor bx, bx
int 0x15
push 0
pop es
mov [es:0x9040], ebx
mov [es:0x9050], ax
mov [es:0x9052], cx
@@ -326,17 +323,12 @@ apm_end:
; DISPLAY VESA INFORMATION
push 0
pop es
mov ax, 0x4f00
mov di, 0xa000
int 0x10
cmp ax, 0x004f
mov si, novesa
jnz @f
mov bx, word [es:di+0x12]
shl ebx,16
mov [es:0x9050], ebx
mov ax, [es:di+4]
add ax, '0'*256+'0'
mov si, vervesa
@@ -349,7 +341,7 @@ cfgmanager:
; settings:
; a) preboot_graph = graphical mode
; preboot_gprobe = probe this mode?
; b) preboot_dma_write = use DMA write?
; b) preboot_dma = use DMA access?
; c) preboot_vrrm = use VRR?
; d) preboot_device = from what boot?
mov di, preboot_graph
@@ -389,8 +381,9 @@ cfgmanager:
@@:
mov [di], al
.preboot_gr_end:
cmp [di+preboot_dma_write-preboot_graph], 1
adc [di+preboot_dma_write-preboot_graph], 0
; following 6 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_vrrm-preboot_graph], 1
adc [di+preboot_vrrm-preboot_graph], 0
cmp [di+preboot_device-preboot_graph], 1
@@ -446,8 +439,15 @@ cfgmanager:
mov si, linef
call printplain
mov si, dma_msg
cmp [preboot_dma_write], 1
call .say_on_off
call print
cmp [preboot_dma], 2
mov si, on_msg
jb @f
mov si, off_msg
ja @f
mov si, readonly_msg
@@:
call printplain
mov si, vrrm_msg
cmp [preboot_vrrm], 1
call .say_on_off
@@ -532,9 +532,9 @@ cfgmanager:
_setcursor 15,0
mov si, ask_dma
call print
mov bx, '12'
mov bx, '13'
call getkey
mov [preboot_dma_write], al
mov [preboot_dma], al
_setcursor 11,0
jmp .d
.change_c:
@@ -553,8 +553,7 @@ cfgmanager:
popf
jz @f
mov si, off_msg
@@: call printplain
ret
@@: jmp printplain
; novesa and vervesa strings are not used at the moment of executing this code
virtual at novesa
.oldtimer dd ?
@@ -691,7 +690,7 @@ end if
mov al, 32 ; BPP
jb @f
mov [es:0x9000], al
mov dword [es:0x9018], 0xFFFFFFFF; 0x800000
or dword [es:0x9018], 0xFFFFFFFF; 0x800000
@@:
mov [es:0x9008], bx
mov [es:0x900A], cx
@@ -710,13 +709,12 @@ end if
inc bx
cmp bx, 0x17f
mov si, prnotfnd
jz sayerr
jz invalid_video_mode
probemore:
push cx
mov ax, 0x4f01
mov cx, bx
and cx,0xfff
mov di, 0xa000
int 0x10
pop cx
@@ -762,7 +760,12 @@ end if
mov si, bt32
jz bppl
mov si, btns
jmp sayerr
invalid_video_mode:
call print
_setcursor (d80x25_top_num+2), 0
mov si, start_msg
call print
jmp cfgmanager.printcfg
bppl:
call print
@@ -788,9 +791,9 @@ end if
; force yes
mov [es:0x901C], byte 1
; DMA WRITE
; DMA ACCESS TO HD
mov al, [preboot_dma_write]
mov al, [preboot_dma]
mov [es:0x901F], al
; VRR_M USE

View File

@@ -34,7 +34,7 @@ vrrmprint db "Apply VRR? (picture frequency greater than 60Hz"
; db " Select port [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 "Use DMA for HDD writing? [1-yes/2-no]: ",0
ask_dma db "Use DMA for HDD access? [1-yes, 2-only for reading, 3-no]: ",0
;gr_direct db 186," Use direct LFB writing? "
; db "[1-yes/2-no] ? ",0
;mem_model db 13,10,186," Motherboard memory [1-16 Mb / 2-32 Mb / "
@@ -80,9 +80,10 @@ mode9 db "320x200, EGA/CGA 256 colors",0
mode10 db "640x480, VGA 16 colors",0
probeno_msg db " (standard mode)",0
probeok_msg db " (check nonstandard modes)",0
dma_msg db " [b] Use DMA for HDD writing:",0
dma_msg db " [b] Use DMA for HDD access:",0
on_msg db " on",13,10,0
off_msg db " off",13,10,0
readonly_msg db " only for reading",13,10,0
vrrm_msg db " [c] Use VRR:",0
preboot_device_msg db " [d] Floppy image: ",0
preboot_device_msgs dw 0,pdm1,pdm2,pdm3

View File

@@ -34,7 +34,7 @@ vrrmprint db "Kinnita VRR? (ekraani sagedus suurem kui 60Hz"
; db " Vali port [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 "Use DMA for HDD writing? [1-jah/2-ei]: ",0
ask_dma db "Use DMA for HDD access? [1-yes, 2-only for reading, 3-no]: ",0
;gr_direct db 186," Use direct LFB writing? "
; db "[1-yes/2-no] ? ",0
;mem_model db 13,10,186," Motherboard memory [1-16 Mb / 2-32 Mb / "
@@ -80,9 +80,10 @@ mode9 db "320x200, EGA/CGA 256 v
mode10 db "640x480, VGA 16 v<>rvi",0
probeno_msg db " (standard reziim)",0
probeok_msg db " (kontrolli ebastandardseid reziime)",0
dma_msg db " [b] Use DMA for HDD writing:",0
dma_msg db " [b] Use DMA for HDD access:",0
on_msg db " sees",13,10,0
off_msg db " v<>ljas",13,10,0
readonly_msg db " only for reading",13,10,0
vrrm_msg db " [c] Kasuta VRR:",0
preboot_device_msg db " [d] Disketi kujutis: ",0
preboot_device_msgs dw 0,pdm1,pdm2,pdm3

View File

@@ -39,7 +39,7 @@ vrrmprint db "VRR verwenden? (Monitorfrequenz groesser als 60Hz"
; db " Waehle Port [1-3]: ",0
;no_com1 db 13,10,186, " Keine COM1 Maus",0
;no_com2 db 13,10,186, " Keine COM2 Maus",0
ask_dma db "Nutze DMA zum HDD Aufschreiben? [1-ja/2-nein]: ",0
ask_dma db "Nutze DMA zum HDD Zugriff? [1-ja, 2-allein fur Lesen, 3-nein]: ",0
;gr_direct db 186," Benutze direct LFB? "
; db "[1-ja/2-nein] ? ",0
;mem_model db 13,10,186," Hauptspeicher [1-16 Mb / 2-32 Mb / "
@@ -88,6 +88,7 @@ probeok_msg db " (teste nicht-standard Modi)",0
dma_msg db " [b] Nutze DMA zum HDD Aufschreiben:",0
on_msg db " an",13,10,0
off_msg db " aus",13,10,0
readonly_msg db " fur Lesen",13,10,0
vrrm_msg db " [c] Nutze VRR:",0
preboot_device_msg db " [d] Diskettenimage: ",0
preboot_device_msgs dw 0,pdm1,pdm2,pdm3

View File

@@ -34,7 +34,7 @@ vrrmprint db "
; db " <20><EFBFBD><EBA1A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> [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 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DMA <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> HDD? [1-<2D><>/2-<2D><><EFBFBD>]: ",0
ask_dma db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DMA <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> HDD? [1-<2D><>, 2-⮫쪮 <20><EFBFBD><E2A5AD>, 3-<2D><><EFBFBD>]: ",0
;gr_direct db 186," <20><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? "
; db "[1-<2D><>/2-<2D><><EFBFBD>]: ",0
;mem_model db 13,10,186," <20><><EFBFBD>+<2B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [1-16 Mb / 2-32 Mb / "
@@ -80,9 +80,10 @@ mode9 db "320x200, EGA/CGA 256 梥⮢",0
mode10 db "640x480, VGA 16 梥⮢",0
probeno_msg db " (<28><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0A5A6>)",0
probeok_msg db " (<28><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E0A5A6><EFBFBD>)",0
dma_msg db " [b] <20><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> DMA <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> HDD:",0
dma_msg db " [b] <20><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> DMA <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> HDD:",0
on_msg db " <20><><EFBFBD>",13,10,0
off_msg db " <20>",13,10,0
readonly_msg db " ⮫쪮 <20><EFBFBD><E2A5AD>",13,10,0
vrrm_msg db " [c] <20><EFBFBD><EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> VRR:",0
preboot_device_msg db " [d] <20><><20><><EFBFBD><E1AAA5>: ",0
preboot_device_msgs dw 0,pdm1,pdm2,pdm3

View File

@@ -18,7 +18,7 @@ display_atboot db 0 ; show boot screen messages ( 2-no )
preboot_graph db 0 ; graph mode
preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes)
preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no)
preboot_dma_write db 0 ; use DMA for writing to HDD (1-yes, 2-no)
preboot_dma db 0 ; use DMA for access to HDD (1-always, 2-only for read, 3-never)
preboot_device db 0 ; boot device
; (1-floppy 2-harddisk 3-kernel restart)
;!!!! 0 - autodetect !!!!

View File

@@ -321,8 +321,8 @@ high_code:
; -----------------------------------------
; movzx eax,byte [BOOT_VAR+0x9010] ; mouse port
; mov [0xF604],byte 1 ;al
mov al, [BOOT_VAR+0x901F] ; DMA writing
mov [allow_dma_write], al
mov al, [BOOT_VAR+0x901F] ; DMA access
mov [allow_dma_access], al
mov al,[BOOT_VAR+0x9000] ; bpp
mov [ScreenBPP],al
movzx eax,word [BOOT_VAR+0x900A] ; X max

0
kernel/trunk/unpacker.inc Executable file → Normal file
View File