forked from KolibriOS/kolibrios
Fixed a "blue screen" hang when trying to write a configuration to a read-only device
git-svn-id: svn://kolibrios.org@9942 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
69f5ec5ac7
commit
e4362a1edc
@ -93,6 +93,14 @@ macro _ask_question question,range,variable_to_set
|
|||||||
mov [variable_to_set], al
|
mov [variable_to_set], al
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clear_status_field:
|
||||||
|
mov si, space_msg
|
||||||
|
mov byte [si+80], 0
|
||||||
|
_setcursor 16,0
|
||||||
|
call printplain
|
||||||
|
_setcursor 16,0
|
||||||
|
ret
|
||||||
|
|
||||||
boot_read_floppy:
|
boot_read_floppy:
|
||||||
push si
|
push si
|
||||||
xor si, si
|
xor si, si
|
||||||
@ -276,7 +284,6 @@ else
|
|||||||
cld
|
cld
|
||||||
push 0
|
push 0
|
||||||
pop es
|
pop es
|
||||||
; \begin{diamond}[02.12.2005]
|
|
||||||
; if bootloader sets ax = 'KL', then ds:si points to loader block
|
; if bootloader sets ax = 'KL', then ds:si points to loader block
|
||||||
cmp ax, 'KL'
|
cmp ax, 'KL'
|
||||||
jnz @f
|
jnz @f
|
||||||
@ -284,8 +291,6 @@ else
|
|||||||
mov word [cs:cfgmanager.loader_block+2], ds
|
mov word [cs:cfgmanager.loader_block+2], ds
|
||||||
mov word [es:BOOT_LO.kernel_restart], kernel_restart_bootblock
|
mov word [es:BOOT_LO.kernel_restart], kernel_restart_bootblock
|
||||||
@@:
|
@@:
|
||||||
; \end{diamond}[02.12.2005]
|
|
||||||
|
|
||||||
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source disk
|
; if bootloader sets cx = 'HA' and dx = 'RD', then bx contains identifier of source disk
|
||||||
; (see comment to BOOT_LO.sys_disk and loader_doc.txt)
|
; (see comment to BOOT_LO.sys_disk and loader_doc.txt)
|
||||||
mov word [es:BOOT_LO.sys_disk], 'r1' ; default value: /rd/1
|
mov word [es:BOOT_LO.sys_disk], 'r1' ; default value: /rd/1
|
||||||
@ -420,7 +425,6 @@ sayerr:
|
|||||||
loopz @b
|
loopz @b
|
||||||
in al, 0x60
|
in al, 0x60
|
||||||
|
|
||||||
;;;/diamond today 5.02.2008
|
|
||||||
; set keyboard typematic rate & delay
|
; set keyboard typematic rate & delay
|
||||||
mov al, 0xf3
|
mov al, 0xf3
|
||||||
out 0x60, al
|
out 0x60, al
|
||||||
@ -494,7 +498,6 @@ noloaderblock:
|
|||||||
call calc_vmodes_table
|
call calc_vmodes_table
|
||||||
call check_first_parm ;check and enable cursor_pos
|
call check_first_parm ;check and enable cursor_pos
|
||||||
|
|
||||||
; \begin{diamond}[30.11.2005]
|
|
||||||
cfgmanager:
|
cfgmanager:
|
||||||
; settings:
|
; settings:
|
||||||
; a) preboot_graph = graphical mode
|
; a) preboot_graph = graphical mode
|
||||||
@ -937,14 +940,24 @@ if ~ defined extended_primary_loader
|
|||||||
.cont:
|
.cont:
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
mov si, space_msg
|
|
||||||
mov byte [si+80], 0
|
push es
|
||||||
_setcursor 16,0
|
les bx, [.loader_block]
|
||||||
call printplain
|
cmp byte [es:bx+7], 0 ; get write error flag
|
||||||
_setcursor 16,0
|
pop es
|
||||||
|
jz .load
|
||||||
|
call clear_status_field
|
||||||
|
mov si, write_err_msg
|
||||||
|
call print
|
||||||
|
.wait_any_key:
|
||||||
|
xor ax, ax
|
||||||
|
int 16h
|
||||||
|
test ax, ax
|
||||||
|
jz .wait_any_key
|
||||||
|
|
||||||
.load:
|
.load:
|
||||||
|
call clear_status_field
|
||||||
end if
|
end if
|
||||||
; \end{diamond}[02.12.2005]
|
|
||||||
|
|
||||||
; ASK GRAPHICS MODE
|
; ASK GRAPHICS MODE
|
||||||
|
|
||||||
@ -999,30 +1012,31 @@ include '../detect/biosmem.inc'
|
|||||||
mov si, diskload
|
mov si, diskload
|
||||||
call print
|
call print
|
||||||
xor ax, ax ; reset drive
|
xor ax, ax ; reset drive
|
||||||
xor dx, dx
|
xor dx, dx ; 1st floppy disk (0)
|
||||||
int 0x13
|
int 0x13
|
||||||
; do we boot from CD-ROM?
|
; do we boot from CD-ROM?
|
||||||
mov ah, 41h
|
mov ah, 41h ; check extended mode
|
||||||
mov bx, 55AAh
|
mov bx, 55AAh ; test 2 bytes to check that this function is supported
|
||||||
xor dx, dx
|
xor dx, dx ; 1st floppy disk (0)
|
||||||
int 0x13
|
int 0x13
|
||||||
jc .nocd
|
jc .nocd ; extended mode not supported
|
||||||
cmp bx, 0AA55h
|
cmp bx, 0AA55h
|
||||||
jnz .nocd
|
jnz .nocd ; extended mode not supported
|
||||||
mov ah, 48h
|
mov ah, 48h ; extended read drive parameters
|
||||||
push ds
|
push ds
|
||||||
push es
|
push es
|
||||||
pop ds
|
pop ds
|
||||||
mov si, 0xa000
|
mov si, 0xa000
|
||||||
mov word [si], 30
|
mov word [si], 30 ; size of result buffer
|
||||||
int 0x13
|
int 0x13
|
||||||
pop ds
|
pop ds
|
||||||
jc .nocd
|
jc .nocd ; error getting parameters
|
||||||
push ds
|
push ds
|
||||||
lds si, [es:si+26]
|
lds si, [es:si+26] ; pointer to Enhanced Disk Drive (EDD) configuration parameters
|
||||||
test byte [ds:si+10], 40h
|
test byte [ds:si+10], 40h ; check ATAPI device
|
||||||
pop ds
|
pop ds
|
||||||
jz .nocd
|
jz .nocd
|
||||||
|
|
||||||
; yes - read all floppy by 18 sectors
|
; yes - read all floppy by 18 sectors
|
||||||
|
|
||||||
; TODO: !!!! read only first sector and set variables !!!!!
|
; TODO: !!!! read only first sector and set variables !!!!!
|
||||||
|
@ -94,6 +94,7 @@ save_quest db "New settings have been applied.",13,10,13,10,186
|
|||||||
db " Do you want to record them for the future boots?",13,10,186
|
db " Do you want to record them for the future boots?",13,10,186
|
||||||
db " Answer 'yes' only if your booting device is writable. [y/n]: ",0
|
db " Answer 'yes' only if your booting device is writable. [y/n]: ",0
|
||||||
loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0
|
loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0
|
||||||
|
write_err_msg db "Recording the configuration has failed. Press any key to resume booting...",0
|
||||||
end if
|
end if
|
||||||
|
|
||||||
_st latin1 '║ ┌───────────────────────────────┬─┐',13,10,0
|
_st latin1 '║ ┌───────────────────────────────┬─┐',13,10,0
|
||||||
|
@ -91,6 +91,7 @@ loading_msg latin1 "Laadin KolibriOS...",0
|
|||||||
if ~ defined extended_primary_loader
|
if ~ defined extended_primary_loader
|
||||||
save_quest latin1 "Jäta meelde praegused seaded? [y/n]: ",0
|
save_quest latin1 "Jäta meelde praegused seaded? [y/n]: ",0
|
||||||
loader_block_error latin1 "Alglaaduri andmed vigased, ei saa jätkata. Peatatud.",0
|
loader_block_error latin1 "Alglaaduri andmed vigased, ei saa jätkata. Peatatud.",0
|
||||||
|
write_err_msg latin1 "Salvestamine ebaõnnestus. Käivitamise jätkamiseks vajutage suvalist klahvi...",0
|
||||||
end if
|
end if
|
||||||
|
|
||||||
_st latin1 '║ ┌───────────────────────────────┬─┐',13,10,0
|
_st latin1 '║ ┌───────────────────────────────┬─┐',13,10,0
|
||||||
|
@ -91,6 +91,7 @@ loading_msg db "Lade KolibriOS...",0
|
|||||||
if ~ defined extended_primary_loader
|
if ~ defined extended_primary_loader
|
||||||
save_quest db "Aktuelle Einstellungen speichern? [y/n]: ",0
|
save_quest db "Aktuelle Einstellungen speichern? [y/n]: ",0
|
||||||
loader_block_error db "Bootloader Daten ungueltig, Kann nicht fortfahren. Angehalten.",0
|
loader_block_error db "Bootloader Daten ungueltig, Kann nicht fortfahren. Angehalten.",0
|
||||||
|
write_err_msg db "Schreiben fehlgeschlagen. Zum Booten eine beliebige Taste drucken...",0
|
||||||
end if
|
end if
|
||||||
|
|
||||||
_st latin1 '║ ┌───────────────────────────────┬─┐',13,10,0
|
_st latin1 '║ ┌───────────────────────────────┬─┐',13,10,0
|
||||||
|
@ -92,6 +92,7 @@ save_quest cp866 "Новые настройки были применены.
|
|||||||
cp866 "║ Хотите записать их для будущих загрузок? Отвечайте да, только",13,10
|
cp866 "║ Хотите записать их для будущих загрузок? Отвечайте да, только",13,10
|
||||||
cp866 "║ если ваше загрузочное устройство доступно для записи. [y/n]: ",0
|
cp866 "║ если ваше загрузочное устройство доступно для записи. [y/n]: ",0
|
||||||
loader_block_error cp866 "Ошибка в данных начального загрузчика, продолжение невозможно.",0
|
loader_block_error cp866 "Ошибка в данных начального загрузчика, продолжение невозможно.",0
|
||||||
|
write_err_msg cp866 "Неудалось записать. Нажмите любую клавишу, для продолжения загрузки...",0
|
||||||
end if
|
end if
|
||||||
|
|
||||||
_st cp866 '║ ┌───────────────────────────────┬─┐ ',13,10,0
|
_st cp866 '║ ┌───────────────────────────────┬─┐ ',13,10,0
|
||||||
|
@ -93,6 +93,7 @@ loading_msg cp850 "Cargando KolibriOS...",0
|
|||||||
if ~ defined extended_primary_loader
|
if ~ defined extended_primary_loader
|
||||||
save_quest cp850 "¿Recordar configuración actual? [s/n]: ",0
|
save_quest cp850 "¿Recordar configuración actual? [s/n]: ",0
|
||||||
loader_block_error cp850 "Bootloader inválido, no puedo continuar. Detenido.",0
|
loader_block_error cp850 "Bootloader inválido, no puedo continuar. Detenido.",0
|
||||||
|
write_err_msg cp850 "La grabación ha fallado. Presione cualquier tecla para continuar...",0
|
||||||
end if
|
end if
|
||||||
|
|
||||||
_st cp850 '║ ┌───────────────────────────────┬─┐',13,10,0
|
_st cp850 '║ ┌───────────────────────────────┬─┐',13,10,0
|
||||||
|
@ -129,9 +129,7 @@ freeze_pc:
|
|||||||
|
|
||||||
found_kernel_file:
|
found_kernel_file:
|
||||||
mov bp, [si+01ah] ; first cluster of kernel file
|
mov bp, [si+01ah] ; first cluster of kernel file
|
||||||
; <diamond>
|
|
||||||
mov [cluster1st+boot_program], bp ; starting cluster of kernel file
|
mov [cluster1st+boot_program], bp ; starting cluster of kernel file
|
||||||
; <\diamond>
|
|
||||||
|
|
||||||
; reading first FAT table
|
; reading first FAT table
|
||||||
mov ax, word [BPB_RsvdSecCnt+boot_program] ; begin first FAT abs sector number
|
mov ax, word [BPB_RsvdSecCnt+boot_program] ; begin first FAT abs sector number
|
||||||
@ -184,12 +182,10 @@ verify_end_sector:
|
|||||||
jmp loop_obtains_kernel_data
|
jmp loop_obtains_kernel_data
|
||||||
|
|
||||||
execute_kernel:
|
execute_kernel:
|
||||||
; <diamond>
|
|
||||||
mov ax, 'KL'
|
mov ax, 'KL'
|
||||||
push 0
|
push 0
|
||||||
pop ds
|
pop ds
|
||||||
mov si, loader_block+boot_program
|
mov si, loader_block+boot_program
|
||||||
; </diamond>
|
|
||||||
push word seg_read_kernel
|
push word seg_read_kernel
|
||||||
push word 0
|
push word 0
|
||||||
retf ; jmp far 1000:0000
|
retf ; jmp far 1000:0000
|
||||||
@ -233,13 +229,20 @@ read_sector:
|
|||||||
mov bp, 20 ; try 20 times
|
mov bp, 20 ; try 20 times
|
||||||
newread:
|
newread:
|
||||||
dec bp
|
dec bp
|
||||||
|
jnz .next
|
||||||
|
cmp ah, 02h ; if read sectors
|
||||||
jz file_error_message
|
jz file_error_message
|
||||||
|
mov byte[write_err+boot_program], 1 ; if write sectors
|
||||||
|
jmp .ret
|
||||||
|
.next:
|
||||||
push ax bx cx dx
|
push ax bx cx dx
|
||||||
int 13h
|
int 13h
|
||||||
pop dx cx bx ax
|
pop dx cx bx ax
|
||||||
jc newread
|
jc newread
|
||||||
|
.ret:
|
||||||
pop bp
|
pop bp
|
||||||
retn
|
retn
|
||||||
|
|
||||||
;------------------------------------------
|
;------------------------------------------
|
||||||
; convert abs. sector number (AX) to BIOS T:H:S
|
; convert abs. sector number (AX) to BIOS T:H:S
|
||||||
; sector number = (abs.sector%BPB_SecPerTrk)+1
|
; sector number = (abs.sector%BPB_SecPerTrk)+1
|
||||||
@ -279,7 +282,6 @@ FirstRootDirSecNum dw ?
|
|||||||
RootDirSecs dw ?
|
RootDirSecs dw ?
|
||||||
data_start dw ?
|
data_start dw ?
|
||||||
|
|
||||||
; <diamond>
|
|
||||||
write1st:
|
write1st:
|
||||||
push cs
|
push cs
|
||||||
pop ds
|
pop ds
|
||||||
@ -293,11 +295,11 @@ write1st:
|
|||||||
retf
|
retf
|
||||||
cluster1st dw ?
|
cluster1st dw ?
|
||||||
loader_block:
|
loader_block:
|
||||||
db 1
|
db 1 ; +0
|
||||||
dw 0
|
dw 0 ; +1
|
||||||
dw write1st+boot_program
|
dw write1st+boot_program ; +3
|
||||||
dw 0
|
dw 0 ; +5
|
||||||
; <\diamond>
|
write_err: db 0 ; +7
|
||||||
|
|
||||||
times 0x1fe-$ db 00h
|
times 0x1fe-$ db 00h
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user