forked from KolibriOS/kolibrios
merge kolibri-cfg into trunk
git-svn-id: svn://kolibrios.org@1962 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -91,6 +91,7 @@ boot_read_floppy:
|
||||
inc si
|
||||
cmp si, 10
|
||||
jb @b
|
||||
sayerr_badsect:
|
||||
mov si, badsect
|
||||
sayerr_plain:
|
||||
call printplain
|
||||
@@ -145,8 +146,119 @@ FirstDataSector dw 0 ; begin of data
|
||||
;=========================================================================
|
||||
|
||||
include 'bootvesa.inc' ;Include source for boot vesa
|
||||
if defined extended_primary_loader
|
||||
include 'parsers.inc'
|
||||
end if
|
||||
|
||||
start_of_code:
|
||||
|
||||
if defined extended_primary_loader
|
||||
; save data from primary loader
|
||||
mov word [cs:bootcallback], si
|
||||
mov word [cs:bootcallback+2], ds
|
||||
push cs
|
||||
pop ds
|
||||
mov [bootdevice], ax
|
||||
mov [bootfs], bx
|
||||
|
||||
; set up stack
|
||||
mov ax, 3000h
|
||||
mov ss, ax
|
||||
mov sp, 0EC00h
|
||||
|
||||
; try to load configuration file
|
||||
mov ax, 1
|
||||
mov di, config_file_struct
|
||||
call [bootcallback]
|
||||
cld
|
||||
push cs
|
||||
pop es
|
||||
; bx=0 - ok, bx=1 - part of file loaded, assume this is ok
|
||||
cmp bx, 1
|
||||
ja .config_bad
|
||||
; configuration file was loaded, parse
|
||||
; if length is too big, use first 0FFFFh bytes
|
||||
test dx, dx
|
||||
jz @f
|
||||
mov ax, 0FFFFh
|
||||
@@:
|
||||
; ds:si will be pointer to current data, dx = limit
|
||||
xchg ax, dx
|
||||
push 4000h
|
||||
pop ds
|
||||
xor si, si
|
||||
.parse_loop:
|
||||
; skip spaces
|
||||
cmp si, dx
|
||||
jae .parse_done
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jbe .parse_loop
|
||||
dec si
|
||||
; loop over all possible configuration values
|
||||
mov bx, config_file_variables
|
||||
.find_variant:
|
||||
; get length
|
||||
mov cx, [es:bx]
|
||||
; zero length = end of list
|
||||
jecxz .find_newline
|
||||
; skip over length
|
||||
inc bx
|
||||
inc bx
|
||||
mov di, bx
|
||||
; skip over string
|
||||
add bx, cx
|
||||
; test whether we have at least cx symbols left
|
||||
mov ax, cx
|
||||
add ax, si
|
||||
jc .next_variant1
|
||||
cmp ax, dx
|
||||
jae .next_variant1
|
||||
; save current position
|
||||
push si
|
||||
; compare strings
|
||||
repz cmpsb
|
||||
jnz .next_variant2
|
||||
; strings are equal; look for "=" with possible spaces before and after
|
||||
@@:
|
||||
cmp si, dx
|
||||
jae .next_variant2
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jbe @b
|
||||
cmp al, '='
|
||||
jnz .next_variant2
|
||||
; ok, we found the true variant
|
||||
; ignore saved position on the stack
|
||||
pop ax
|
||||
; call the parser
|
||||
call word [es:bx]
|
||||
; line parsed, find next
|
||||
.find_newline:
|
||||
cmp si, dx
|
||||
jae .parse_done
|
||||
lodsb
|
||||
cmp al, 13
|
||||
jz .parse_loop
|
||||
cmp al, 10
|
||||
jz .parse_loop
|
||||
jmp .find_newline
|
||||
.next_variant2:
|
||||
; continue to the next variant, restoring current position
|
||||
pop si
|
||||
.next_variant1:
|
||||
; continue to the next variant
|
||||
; skip over the parser
|
||||
inc bx
|
||||
inc bx
|
||||
jmp .find_variant
|
||||
.parse_done:
|
||||
.config_bad:
|
||||
|
||||
; set up segment registers
|
||||
push cs
|
||||
pop ds
|
||||
else
|
||||
cld
|
||||
; \begin{diamond}[02.12.2005]
|
||||
; if bootloader sets ax = 'KL', then ds:si points to loader block
|
||||
@@ -175,6 +287,7 @@ no_hd_load:
|
||||
pop ds
|
||||
push cs
|
||||
pop es
|
||||
end if
|
||||
|
||||
; set videomode
|
||||
mov ax, 3
|
||||
@@ -378,6 +491,7 @@ wait_loop: ; variant 2
|
||||
apm_end:
|
||||
_setcursor d80x25_top_num, 0
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
;CHECK current of code
|
||||
cmp [cfgmanager.loader_block], -1
|
||||
jz noloaderblock
|
||||
@@ -387,6 +501,7 @@ apm_end:
|
||||
jnz sayerr
|
||||
push 0
|
||||
pop es
|
||||
end if
|
||||
|
||||
noloaderblock:
|
||||
; DISPLAY VESA INFORMATION
|
||||
@@ -404,7 +519,9 @@ cfgmanager:
|
||||
; d) preboot_device = from what boot?
|
||||
|
||||
; determine default settings
|
||||
if ~ defined extended_primary_loader
|
||||
mov [.bSettingsChanged], 0
|
||||
end if
|
||||
|
||||
;.preboot_gr_end:
|
||||
mov di, preboot_device
|
||||
@@ -412,6 +529,12 @@ cfgmanager:
|
||||
; set it to use this preloaded image
|
||||
cmp byte [di], 0
|
||||
jnz .preboot_device_inited
|
||||
if defined extended_primary_loader
|
||||
inc byte [di]
|
||||
cmp byte [bootdevice], 'f' ; floppy?
|
||||
jz .preboot_device_inited
|
||||
inc byte [di]
|
||||
else
|
||||
cmp [.loader_block], -1
|
||||
jz @f
|
||||
les bx, [.loader_block]
|
||||
@@ -422,6 +545,7 @@ cfgmanager:
|
||||
@@:
|
||||
; otherwise, set [preboot_device] to 1 (default value - boot from floppy)
|
||||
mov byte [di], 1
|
||||
end if
|
||||
.preboot_device_inited:
|
||||
; following 4 lines set variables to 1 if its current value is 0
|
||||
cmp byte [di+preboot_dma-preboot_device], 1
|
||||
@@ -466,7 +590,11 @@ cfgmanager:
|
||||
mov si, preboot_device_msg
|
||||
call print
|
||||
mov al, [preboot_device]
|
||||
if defined extended_primary_loader
|
||||
and eax, 3
|
||||
else
|
||||
and eax, 7
|
||||
end if
|
||||
mov si, [preboot_device_msgs+eax*2]
|
||||
call printplain
|
||||
.show_remarks:
|
||||
@@ -553,12 +681,18 @@ cfgmanager:
|
||||
_setcursor 15,0
|
||||
mov si, bdev
|
||||
call print
|
||||
if defined extended_primary_loader
|
||||
mov bx, '12'
|
||||
else
|
||||
mov bx, '14'
|
||||
end if
|
||||
call getkey
|
||||
mov [preboot_device], al
|
||||
_setcursor 13,0
|
||||
.d:
|
||||
if ~ defined extended_primary_loader
|
||||
mov [.bSettingsChanged], 1
|
||||
end if
|
||||
call clear_vmodes_table ;clear vmodes_table
|
||||
jmp .printcfg
|
||||
.change_a:
|
||||
@@ -672,10 +806,14 @@ cfgmanager:
|
||||
virtual at novesa
|
||||
.oldtimer dd ?
|
||||
.starttime dd ?
|
||||
if ~ defined extended_primary_loader
|
||||
.bSettingsChanged db ?
|
||||
end if
|
||||
.timer dd ?
|
||||
end virtual
|
||||
if ~ defined extended_primary_loader
|
||||
.loader_block dd -1
|
||||
end if
|
||||
.gettime:
|
||||
mov ah, 0
|
||||
int 1Ah
|
||||
@@ -692,7 +830,11 @@ end virtual
|
||||
pushad
|
||||
call .gettime
|
||||
sub eax, [.starttime]
|
||||
if defined extended_primary_loader
|
||||
sub ax, [preboot_timeout]
|
||||
else
|
||||
sub ax, 18*5
|
||||
end if
|
||||
jae .timergo
|
||||
neg ax
|
||||
add ax, 18-1
|
||||
@@ -748,6 +890,7 @@ end if
|
||||
mov si, loading_msg
|
||||
call print
|
||||
_setcursor 15,0
|
||||
if ~ defined extended_primary_loader
|
||||
cmp [.bSettingsChanged], 0
|
||||
jz .load
|
||||
cmp [.loader_block], -1
|
||||
@@ -788,6 +931,7 @@ end if
|
||||
call printplain
|
||||
_setcursor 15,0
|
||||
.load:
|
||||
end if
|
||||
; \end{diamond}[02.12.2005]
|
||||
|
||||
; ASK GRAPHICS MODE
|
||||
@@ -967,6 +1111,7 @@ sayerr_floppy:
|
||||
mov dx, 0x3f2
|
||||
mov al, 0
|
||||
out dx, al
|
||||
sayerr_memmove:
|
||||
mov si, memmovefailed
|
||||
jmp sayerr_plain
|
||||
@@:
|
||||
@@ -1145,6 +1290,40 @@ no_sys_on_floppy:
|
||||
mov al, 0
|
||||
out dx, al
|
||||
|
||||
if defined extended_primary_loader
|
||||
cmp [boot_dev], 1
|
||||
jne no_sys_from_primary
|
||||
; load kolibri.img using callback from primary loader
|
||||
and word [movedesc + 24 + 2], 0
|
||||
mov byte [movedesc + 24 + 4], 10h
|
||||
; read in blocks of 64K until file is fully loaded
|
||||
mov ax, 1
|
||||
.repeat:
|
||||
mov di, image_file_struct
|
||||
call [bootcallback]
|
||||
push cs
|
||||
pop ds
|
||||
push cs
|
||||
pop es
|
||||
cmp bx, 1
|
||||
ja sayerr_badsect
|
||||
push bx
|
||||
mov si, movedesc
|
||||
and word [si + 16 + 2], 0
|
||||
mov byte [si + 16 + 4], 4
|
||||
mov ah, 87h
|
||||
mov cx, 8000h
|
||||
int 15h
|
||||
pop bx
|
||||
test ah, ah
|
||||
jnz sayerr_memmove
|
||||
inc byte [si + 24 + 4]
|
||||
test bx, bx
|
||||
jz no_sys_from_primary
|
||||
mov ax, 2
|
||||
jmp .repeat
|
||||
no_sys_from_primary:
|
||||
end if
|
||||
|
||||
; SET GRAPHICS
|
||||
|
||||
|
@@ -40,11 +40,15 @@ vrrmprint db "Apply VRR? (picture frequency greater than 60Hz"
|
||||
|
||||
ask_bd db "Add disks visible by BIOS emulated in V86-mode? [1-yes, 2-no]: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
bdev db "Load ramdisk from [1-floppy; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-use preloaded ram-image from kernel restart;"
|
||||
db 13,10,186," "
|
||||
db "4-create blank image]: ",0
|
||||
else
|
||||
bdev db "Load ramdisk from [1-floppy; 2-kolibri.img]: ",0
|
||||
end if
|
||||
probetext db 13,10,13,10,186," Use standart graphics mode? [1-yes, "
|
||||
db "2-probe bios (Vesa 3.0)]: ",0
|
||||
;memokz256 db 13,10,186," RAM 256 Mb",0
|
||||
@@ -88,14 +92,22 @@ 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
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "real floppy",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "real floppy",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "use already loaded image",13,10,0
|
||||
pdm4 db "create blank image",13,10,0
|
||||
end if
|
||||
loading_msg db "Loading KolibriOS...",0
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "Remember current settings? [y/n]: ",0
|
||||
loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0
|
||||
end if
|
||||
|
||||
_st db 186,' <20><><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>Ŀ',13,10,0
|
||||
_r1 db 186,' <20> 320x200 EGA/CGA 256 colors <20> <20>',13,10,0
|
||||
|
@@ -50,11 +50,15 @@ ask_bd db "Add disks visible by BIOS emulated in V86-mode? [1-yes, 2-no
|
||||
;mem_model db 13,10,186," Motherboard memory [1-16 Mb / 2-32 Mb / "
|
||||
; db "3-64Mb / 4-128 Mb / 5-256 Mb] ? ",0
|
||||
;bootlog db 13,10,186," After bootlog display [1-continue/2-pause] ? ",0
|
||||
if defined extended_primary_loader
|
||||
bdev db "Paigalda m<>luketas [1-diskett; 2-kolibri.img]: ",0
|
||||
else
|
||||
bdev db "Paigalda m<>luketas [1-diskett; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-kasuta eellaaditud m<>luketast kerneli restardist;"
|
||||
db 13,10,186," "
|
||||
db "4-loo t<>hi pilt]: ",0
|
||||
end if
|
||||
probetext db 13,10,13,10,186," Kasuta standartset graafika reziimi? [1-jah, "
|
||||
db "2-leia biosist (Vesa 3.0)]: ",0
|
||||
;memokz256 db 13,10,186," RAM 256 Mb",0
|
||||
@@ -99,14 +103,22 @@ off_msg db " v
|
||||
;readonly_msg db " ainult lugemiseks",13,10,0
|
||||
vrrm_msg db " [c] Kasuta VRR:",0
|
||||
preboot_device_msg db " [d] Disketi kujutis: ",0
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "reaalne diskett",13,10,0
|
||||
pdm2 db "kolibri.img",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "reaalne diskett",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "kasuta juba laaditud kujutist",13,10,0
|
||||
pdm4 db "loo t<>hi pilt",13,10,0
|
||||
end if
|
||||
loading_msg db "Laadin KolibriOS...",0
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "J<EFBFBD>ta meelde praegused seaded? [y/n]: ",0
|
||||
loader_block_error db "Alglaaduri andmed vigased, ei saa j<>tkata. Peatatud.",0
|
||||
end if
|
||||
|
||||
remark1 db "Default values were selected to match most of configurations, but not all.",0
|
||||
remark2 db "If you have CRT-monitor, enable VRR in the item [c].",0
|
||||
|
@@ -55,11 +55,15 @@ ask_bd db "Add disks visible by BIOS emulated in V86-mode? [1-yes, 2-no
|
||||
;mem_model db 13,10,186," Hauptspeicher [1-16 Mb / 2-32 Mb / "
|
||||
; db "3-64Mb / 4-128 Mb / 5-256 Mb] ? ",0
|
||||
;bootlog db 13,10,186," After bootlog display [1-continue/2-pause] ? ",0
|
||||
if defined extended_primary_loader
|
||||
bdev db "Lade die Ramdisk von [1-Diskette; 2-kolibri.img]: ",0
|
||||
else
|
||||
bdev db "Lade die Ramdisk von [1-Diskette; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-benutze ein bereits geladenes Kernel image;"
|
||||
db 13,10,186," "
|
||||
db "4-create blank image]: ",0
|
||||
end if
|
||||
probetext db 13,10,13,10,186," Nutze Standardgrafikmodi? [1-ja, "
|
||||
db "2-BIOS Test (Vesa 3.0)]: ",0
|
||||
;memokz256 db 13,10,186," RAM 256 Mb",0
|
||||
@@ -104,14 +108,22 @@ 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
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "Echte Diskette",13,10,0
|
||||
pdm2 db "kolibri.img",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "Echte Diskette",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "Nutze bereits geladenes Image",13,10,0
|
||||
pdm4 db "create blank image",13,10,0
|
||||
end if
|
||||
loading_msg db "Lade KolibriOS...",0
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "Aktuelle Einstellungen speichern? [y/n]: ",0
|
||||
loader_block_error db "Bootloader Daten ungueltig, Kann nicht fortfahren. Angehalten.",0
|
||||
end if
|
||||
|
||||
remark1 db "Default values were selected to match most of configurations, but not all.",0
|
||||
remark2 db "If you have CRT-monitor, enable VRR in the item [c].",0
|
||||
|
@@ -33,11 +33,15 @@ vrrmprint db "
|
||||
db 186," 1024*768>800*600 <20> 800*600>640*480) [1-<2D><>, 2-<2D><><EFBFBD>]: ",0
|
||||
;ask_dma db "<EFBFBD>ᯮ<EFBFBD>짮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> DMA <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㯠 <20> HDD? [1-<2D><>, 2-⮫쪮 <20>⥭<EFBFBD><E2A5AD>, 3-<2D><><EFBFBD>]: ",0
|
||||
ask_bd db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪨, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>१ BIOS <20> ०<><E0A5A6><EFBFBD> V86? [1-<2D><>, 2-<2D><><EFBFBD>]: ",0
|
||||
if defined extended_primary_loader
|
||||
bdev db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <20><>ࠧ <20><> [1-<2D><>᪥<EFBFBD><E1AAA5>; 2-kolibri.img <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD>]: ",0
|
||||
else
|
||||
bdev db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <20><>ࠧ <20><> [1-<2D><>᪥<EFBFBD><E1AAA5>; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-<2D>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> 㦥 <20><><EFBFBD><EFBFBD>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><>ࠧ;"
|
||||
db 13,10,186," "
|
||||
db "4-ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ࠧ]: ",0
|
||||
end if
|
||||
prnotfnd db "<EFBFBD>訡<EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>०<EFBFBD><E0A5A6> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",0
|
||||
not386 db "<EFBFBD>訡<EFBFBD><EFBFBD> - <20>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 386+.",0
|
||||
fatalsel db "<EFBFBD>訡<EFBFBD><EFBFBD> - <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>०<EFBFBD><E0A5A6> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",0
|
||||
@@ -67,14 +71,22 @@ off_msg db "
|
||||
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
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪥<EFBFBD><E1AAA5>",13,10,0
|
||||
pdm2 db "kolibri.img <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD>",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3,pdm4
|
||||
pdm1 db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪥<EFBFBD><E1AAA5>",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "<EFBFBD>ᯮ<EFBFBD>짮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㦥 <20><><EFBFBD><EFBFBD>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><>ࠧ",13,10,0
|
||||
pdm4 db "ᮧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ࠧ",13,10,0
|
||||
end if
|
||||
loading_msg db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> KolibriOS...",0
|
||||
if ~ defined extended_primary_loader ; saving not supported in this case
|
||||
save_quest db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>騥 <20><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9>? [y/n]: ",0
|
||||
loader_block_error db "<EFBFBD>訡<EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>砫쭮<E7A0AB><ECADAE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪<EFBFBD>, <20>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",0
|
||||
end if
|
||||
|
||||
|
||||
_st db 186,' <20><><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>Ŀ ',13,10,0
|
||||
|
@@ -314,7 +314,11 @@ draw_current_vmode:
|
||||
cmp word [es:si+6],0x13
|
||||
je .no_vesa_0x13
|
||||
|
||||
if defined extended_primary_loader
|
||||
mov di,config_file_variables
|
||||
else
|
||||
mov di,loader_block_error
|
||||
end if
|
||||
movzx eax,word[es:si+0]
|
||||
mov ecx,10
|
||||
call int2strnz
|
||||
@@ -327,7 +331,11 @@ draw_current_vmode:
|
||||
movzx eax,word[es:si+8]
|
||||
call int2strnz
|
||||
mov dword[es:di],0x00000d0a
|
||||
if defined extended_primary_loader
|
||||
mov si,config_file_variables
|
||||
else
|
||||
mov si,loader_block_error
|
||||
end if
|
||||
push ds
|
||||
push es
|
||||
pop ds
|
||||
@@ -344,9 +352,34 @@ draw_current_vmode:
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
check_first_parm:
|
||||
if defined extended_primary_loader
|
||||
mov cx, [number_vm]
|
||||
jcxz .novbemode
|
||||
mov si, modes_table
|
||||
.findvbemode:
|
||||
cmp [es:si+6], cx
|
||||
jnz @f
|
||||
cmp word [es:si+8],32
|
||||
je .ok_found_mode
|
||||
cmp word [es:si+8],24
|
||||
je .ok_found_mode
|
||||
@@: add si,size_of_step
|
||||
cmp word [es:si],-1
|
||||
jnz .findvbemode
|
||||
.novbemode:
|
||||
mov ax, [x_save]
|
||||
test ax, ax
|
||||
jz .zerro
|
||||
mov bx, [y_save]
|
||||
mov si, modes_table
|
||||
call .loops
|
||||
test ax, ax
|
||||
jz .ok_found_mode
|
||||
else
|
||||
mov si,word [preboot_graph]
|
||||
test si,si
|
||||
jnz .no_zero ;if no zero
|
||||
end if
|
||||
.zerro:
|
||||
; mov ax,modes_table
|
||||
; mov word [cursor_pos],ax
|
||||
@@ -374,6 +407,7 @@ check_first_parm:
|
||||
jz .ok_found_mode
|
||||
|
||||
mov si,modes_table
|
||||
if ~ defined extended_primary_loader
|
||||
jmp .ok_found_mode
|
||||
|
||||
|
||||
@@ -394,6 +428,7 @@ check_first_parm:
|
||||
; jb .zerro ;check on correct if bellow
|
||||
; cmp ax,word [end_cursor]
|
||||
; ja .zerro ;check on correct if anymore
|
||||
end if
|
||||
|
||||
.ok_found_mode:
|
||||
mov word [home_cursor],si
|
||||
|
170
kernel/trunk/boot/parsers.inc
Normal file
170
kernel/trunk/boot/parsers.inc
Normal file
@@ -0,0 +1,170 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
; All parsers are called with ds:si -> value of the variable,
|
||||
; possibly with spaces before, and dx = limit of config file.
|
||||
|
||||
; Three subroutines parse_char, parse_number and parse_bool set CF
|
||||
; if something has failed, otherwise return the value in al/ax.
|
||||
|
||||
parse_timeout:
|
||||
; timeout is a number not greater than 9
|
||||
call parse_number
|
||||
jc .nothing
|
||||
cmp ax, 9
|
||||
jbe @f
|
||||
mov ax, 9
|
||||
@@:
|
||||
imul ax, 18
|
||||
mov [es:preboot_timeout], ax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_resolution:
|
||||
; resolution is <width>*<height>, 'x' can be used instead of '*'
|
||||
; parse width
|
||||
call parse_number
|
||||
jc .nothing
|
||||
; save width
|
||||
xchg ax, bx
|
||||
; test for 'x' or '*'
|
||||
call parse_char
|
||||
cmp al, 'x'
|
||||
jz @f
|
||||
cmp al, '*'
|
||||
jnz .nothing
|
||||
@@:
|
||||
; parse height
|
||||
call parse_number
|
||||
jc .nothing
|
||||
; write width and height
|
||||
mov [es:x_save], bx
|
||||
mov [es:y_save], ax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_vbemode:
|
||||
; vbemode is a number
|
||||
call parse_number
|
||||
jc .nothing
|
||||
mov [es:number_vm], ax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_vrr:
|
||||
; vrr is a boolean setting
|
||||
call parse_bool
|
||||
jc .nothing
|
||||
; convert 0 to 2, 1 to 1
|
||||
inc ax
|
||||
xor al, 3
|
||||
mov [es:preboot_vrrm], al
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_biosdisks:
|
||||
; using biosdisks is a boolean setting
|
||||
call parse_bool
|
||||
jc .nothing
|
||||
; convert 0 to 2, 1 to 1
|
||||
inc ax
|
||||
xor al, 3
|
||||
mov [es:preboot_biosdisk], al
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_imgfrom:
|
||||
; boot device (1-floppy 2-kolibri.img using primary loader)
|
||||
call parse_number
|
||||
jc .nothing
|
||||
cmp al, 1
|
||||
jb .nothing
|
||||
cmp al, 2
|
||||
ja .nothing
|
||||
mov [es:preboot_device], al
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_char:
|
||||
; skip spaces and return the next character or CF if EOF.
|
||||
cmp si, dx
|
||||
jae .eof
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jbe parse_char
|
||||
ret
|
||||
.eof:
|
||||
stc
|
||||
ret
|
||||
|
||||
parse_number:
|
||||
; initialize high part of ax to zero
|
||||
xor ax, ax
|
||||
; skip spaces
|
||||
call parse_char
|
||||
jc .bad
|
||||
; al should be a digit
|
||||
sub al, '0'
|
||||
cmp al, 9
|
||||
ja .bad
|
||||
; accumulate the value in cx
|
||||
xchg cx, ax
|
||||
@@:
|
||||
cmp si, dx
|
||||
jae .eof
|
||||
lodsb
|
||||
sub al, '0'
|
||||
cmp al, 9
|
||||
ja .end
|
||||
imul cx, 10
|
||||
add cx, ax
|
||||
jmp @b
|
||||
; if the end is caused by non-digit, unwind the last character
|
||||
.end:
|
||||
dec si
|
||||
.eof:
|
||||
xchg cx, ax
|
||||
clc
|
||||
ret
|
||||
.bad:
|
||||
stc
|
||||
ret
|
||||
|
||||
parse_bool:
|
||||
; skip spaces
|
||||
call parse_char
|
||||
jc .bad
|
||||
; Boolean false can be represented as 0=no=off,
|
||||
; boolean true can be represented as 1=yes=on.
|
||||
cmp al, '0'
|
||||
jz .false
|
||||
cmp al, '1'
|
||||
jz .true
|
||||
mov ah, al
|
||||
cmp si, dx
|
||||
jae .bad
|
||||
lodsb
|
||||
cmp ax, 'n'*256 + 'o'
|
||||
jz .false
|
||||
cmp ax, 'o'*256 + 'f'
|
||||
jz .false
|
||||
cmp ax, 'y'*256 + 'e'
|
||||
jz .true
|
||||
cmp ax, 'o'*256 + 'n'
|
||||
jz .true
|
||||
.bad:
|
||||
stc
|
||||
ret
|
||||
.true:
|
||||
xor ax, ax
|
||||
inc ax
|
||||
ret
|
||||
.false:
|
||||
xor ax, ax
|
||||
ret
|
@@ -30,6 +30,9 @@ preboot_device db 0 ; boot device
|
||||
;!!!! 0 - autodetect !!!!
|
||||
preboot_blogesc = 0 ; start immediately after bootlog
|
||||
preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no)
|
||||
if defined extended_primary_loader
|
||||
preboot_timeout dw 5*18 ; timeout in 1/18th of second for config settings screen
|
||||
end if
|
||||
|
||||
if $>0x200
|
||||
ERROR: prebooting parameters must fit in first sector!!!
|
||||
|
@@ -98,8 +98,10 @@ nbw32:
|
||||
jmp $
|
||||
no_apm_off:
|
||||
|
||||
if ~ defined extended_primary_loader ; kernel restarting is not supported
|
||||
dec ax ; 3 = reboot
|
||||
jnz restart_kernel ; 4 = restart kernel
|
||||
end if
|
||||
push 0x40
|
||||
pop ds
|
||||
mov word[0x0072],0x1234
|
||||
@@ -150,6 +152,7 @@ APM_PowerOff:
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
ret
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
restart_kernel:
|
||||
|
||||
mov ax,0x0003 ; set text mode for screen
|
||||
@@ -205,5 +208,5 @@ restart_kernel_4000:
|
||||
mov si, kernel_restart_bootblock
|
||||
mov ax, 'KL'
|
||||
jmp 0x1000:0000
|
||||
|
||||
end if
|
||||
|
||||
|
Reference in New Issue
Block a user