/kernel/branches/Kolibri-acpi/boot/bootcode.inc |
---|
47,21 → 47,21 |
popa |
ret |
getkey: |
getkey: ; Use BIOS INT 16h to read a key from the keyboard |
; get number in range [bl,bh] (bl,bh in ['0'..'9']) |
; in: bx=range |
; out: ax=digit (1..9, 10 for 0) |
mov ah, 0 |
int 16h |
cmp al, bl |
jb getkey |
cmp al, bh |
mov ah, 0 ; If 'int 16h' is called with 'ah' equal to zero, the BIOS will not return control |
int 16h ; to the caller until a key is available in the system type ahead buffer. On return, |
cmp al, bl ; 'al' contains the ASCII code for the key read from the buffer and 'ah' contains |
jb getkey ; the keyboard scan code. Here we compare 'al' with the range of accepted characters. |
cmp al, bh ; If the key pressed is not in the range, continue waiting for another key. |
ja getkey |
push ax |
push ax ; If the pressed key is in the accepted range, save it on the stack and echo to screen. |
call putchar |
pop ax |
and ax, 0Fh |
jnz @f |
and ax, 0Fh ; ASCII code for '0' is 48 (110000b). 0F4=1111b. (110000b AND 1111b) = 0 |
jnz @f ; So if key '0' was entered, return 10 in 'ax' |
mov al, 10 |
@@: |
ret |
434,8 → 434,11 |
xor si, si ; device index = 0 |
int 0x1A |
jnc .found_1 ; Parallel IDE Controller |
; Controller not found! |
xor ax, ax |
mov [es:BOOT_IDE_PI_16], ax |
jmp .nopci |
;-------------------------------------- |
.found_1: |
; get memory base BAR4 |
mov ax, 0xB10A |
443,11 → 446,23 |
push cx |
int 0x1A |
jc .no_BAR4 ;.nopci |
and cx, 0xFFF0 ; clear address decode type |
and cx, 0xFFFC ; clear address decode type |
mov [es:BOOT_IDE_BASE_ADDR], cx |
.no_BAR4: |
pop cx |
;-------------------------------------- |
.found: |
; get Interrupt Line |
mov ax, 0xB10A |
mov di, 0x3c ; memory base is config register at 0x3c |
push cx |
int 0x1A |
jc .no_Interrupt ;.nopci |
mov [es:BOOT_IDE_INTERR_16], cx |
.no_Interrupt: |
pop cx |
;-------------------------------------- |
; get memory base BAR0 |
mov ax, 0xB10A |
mov di, 0x10 ; memory base is config register at 0x10 |
454,9 → 469,11 |
push cx |
int 0x1A |
jc .no_BAR0 ;.nopci |
mov [es:BOOT_IDE_BAR0_16], cx |
.no_BAR0: |
pop cx |
;-------------------------------------- |
; get memory base BAR1 |
mov ax, 0xB10A |
mov di, 0x14 ; memory base is config register at 0x14 |
463,9 → 480,11 |
push cx |
int 0x1A |
jc .no_BAR1 ;.nopci |
mov [es:BOOT_IDE_BAR1_16], cx |
.no_BAR1: |
pop cx |
;-------------------------------------- |
; get memory base BAR2 |
mov ax, 0xB10A |
mov di, 0x18 ; memory base is config register at 0x18 |
472,9 → 491,11 |
push cx |
int 0x1A |
jc .no_BAR2 ;.nopci |
mov [es:BOOT_IDE_BAR2_16], cx |
.no_BAR2: |
pop cx |
;-------------------------------------- |
; get memory base BAR3 |
mov ax, 0xB10A |
mov di, 0x1C ; memory base is config register at 0x1c |
481,9 → 502,11 |
push cx |
int 0x1A |
jc .no_BAR3 ;.nopci |
mov [es:BOOT_IDE_BAR3_16], cx |
.no_BAR3: |
pop cx |
;-------------------------------------- |
.nopci: |
; \end{Mario79} |
573,9 → 596,11 |
; settings: |
; a) preboot_graph = graphical mode |
; preboot_gprobe = probe this mode? |
; b) preboot_dma = use DMA access? |
; c) preboot_vrrm = use VRR? |
; d) preboot_device = from what boot? |
; b) preboot_biosdisk = use BIOS disks through V86 emulation? // (earlier was: preboot_dma = use DMA access?) |
; c) preboot_debug = duplicates kernel debug output to the screen // (earlier was: preboot_vrrm = use VRR?) |
; // VRR is an obsolete functionality, used only with CRT monitors: increase display frequency by reducing screen resolution |
; d) preboot_launcher = start the first app (right now it's LAUNCHER) after kernel is loaded? |
; e) preboot_device = from where to boot? |
; determine default settings |
if ~ defined extended_primary_loader |
609,6 → 634,8 |
; following 4 lines set variables to 1 if its current value is 0 |
cmp byte [di+preboot_dma-preboot_device], 1 |
adc byte [di+preboot_dma-preboot_device], 0 |
cmp byte [di+preboot_launcher-preboot_device], 1 ; Start LAUNCHER by default |
adc byte [di+preboot_launcher-preboot_device], 0 |
; cmp byte [di+preboot_biosdisk-preboot_device], 1 |
; adc byte [di+preboot_biosdisk-preboot_device], 0 |
;; default value for VRR is OFF |
646,6 → 673,12 |
; mov si, vrrm_msg |
; cmp [preboot_vrrm], 1 |
; call .say_on_off |
mov si, debug_mode_msg |
cmp [preboot_debug], 1 |
call .say_on_off |
mov si, launcher_msg |
cmp [preboot_launcher], 1 |
call .say_on_off |
mov si, preboot_device_msg |
call print |
mov al, [preboot_device] |
729,25 → 762,30 |
cmp al, 13 |
jz .continue |
or al, 20h |
cmp al, 'a' |
cmp al, 'a' ; select graphical mode |
jz .change_a |
cmp al, 'b' |
cmp al, 'q' ; Trick to make 'A' key on azerty keyboard work |
je .change_a |
cmp al, 'b' ; use BIOS disks? // (selecting YES will make BIOS disks visible as /bd) |
jz .change_b |
; cmp al, 'c' |
; jz .change_c |
cmp al, 'c' ; 'd' |
cmp al, 'c' ; load kernel in debug mode? // (earlier was: use VRR?) |
jz .change_c |
cmp al, 'd' ; start launcher after kernel is loaded? |
jz .change_d |
cmp al, 'e' ; select boot origin |
jnz .show_remarks |
_setcursor 15,0 |
; e) preboot_device = from where to boot? |
_setcursor 16,0 |
mov si, bdev |
call print |
if defined extended_primary_loader |
mov bx, '12' |
mov bx, '12' ; range accepted for answer: 1-2 |
else |
mov bx, '14' |
mov bx, '14' ; range accepted for answer: 1-4 |
end if |
call getkey |
mov [preboot_device], al |
_setcursor 13,0 |
_setcursor 14,0 |
.d: |
if ~ defined extended_primary_loader |
mov [.bSettingsChanged], 1 |
755,6 → 793,7 |
call clear_vmodes_table ;clear vmodes_table |
jmp .printcfg |
.change_a: |
call clear_vmodes_table ;clear vmodes_table |
.loops: |
call draw_vmodes_table |
_setcursor 25,0 ; out of screen |
833,29 → 872,47 |
jmp .d |
.change_b: |
_setcursor 15,0 |
; mov si, ask_dma |
.change_b: ; b) preboot_biosdisk = use BIOS disks through V86 emulation? |
_setcursor 16,0 |
; mov si, ask_dma // (earlier was: preboot_dma = use DMA access?) |
; call print |
; mov bx, '13' |
; mov bx, '13' ; range accepted for answer: 1-3 |
; call getkey |
; mov [preboot_dma], al |
mov si, ask_bd |
call print |
mov bx, '12' |
mov bx, '12' ; range accepted for answer: 1-2 |
call getkey |
mov [preboot_biosdisk], al |
_setcursor 11,0 |
jmp .d |
;.change_c: |
; _setcursor 15,0 |
;.change_c: ; // VRR is an obsolete functionality, used only with CRT monitors |
; _setcursor 16,0 |
; mov si, vrrmprint |
; call print |
; mov bx, '12' |
; mov bx, '12' ; range accepted for answer: 1-2 |
; call getkey |
; mov [preboot_vrrm], al |
; _setcursor 12,0 |
; jmp .d |
.change_c: ; c) preboot_debug = duplicates kernel debug output to the screen |
_setcursor 16,0 |
mov si, ask_debug |
call print |
mov bx, '12' ; range accepted for answer: 1-2 |
call getkey |
mov [preboot_debug], al |
_setcursor 12,0 |
jmp .d |
.change_d: ; d) preboot_launcher = start the first app (right now it's LAUNCHER) after kernel is loaded? |
_setcursor 16,0 |
mov si, ask_launcher |
call print |
mov bx, '12' ; range accepted for answer: 1-2 |
call getkey |
mov [preboot_launcher], al |
_setcursor 13,0 |
jmp .d |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
.say_on_off: |
pushf |
963,7 → 1020,7 |
_setcursor 6,0 |
mov si, loading_msg |
call print |
_setcursor 15,0 |
_setcursor 16,0 |
if ~ defined extended_primary_loader |
cmp [.bSettingsChanged], 0 |
jz .load |
1005,9 → 1062,9 |
pop ds |
mov si, space_msg |
mov byte [si+80], 0 |
_setcursor 15,0 |
_setcursor 16,0 |
call printplain |
_setcursor 15,0 |
_setcursor 16,0 |
.load: |
end if |
; \end{diamond}[02.12.2005] |
1028,8 → 1085,16 |
;; VRR_M USE |
; |
; mov al,[preboot_vrrm] |
; mov [es:0x9030], al |
; mov [es:BOOT_VRR], al ;// 0x9030 |
; Set kernel DEBUG mode - if nonzero, duplicates debug output to the screen. |
mov al, [preboot_debug] |
mov [es:BOOT_DEBUG_PRINT], al ;// 0x901E |
; Start the first app (right now it's LAUNCHER) after kernel is loaded? |
mov al, [preboot_launcher] |
mov [es:BOOT_LAUNCHER_START], al ;// 0x901D |
; BOOT DEVICE |
mov al, [preboot_device] |
/kernel/branches/Kolibri-acpi/boot/booten.inc |
---|
15,12 → 15,10 |
d80x25_bottom: |
db 186,' KolibriOS is based on MenuetOS and comes with ABSOLUTELY ' |
db 'NO WARRANTY ',186 |
db 186,' See file COPYING for details ' |
db ' ',186 |
db 186,' KolibriOS comes with ABSOLUTELY NO WARRANTY. See file COP' |
db 'YING for details ',186 |
line_full_bottom |
d80x25_bottom_num = 3 |
d80x25_bottom_num = 2 |
msg_apm db " APM x.x ", 0 |
novesa db "Display: EGA/CGA",13,10,0 |
54,7 → 52,7 |
pros db "00" |
backspace2 db 8,8,0 |
boot_dev db 0 ; 0=floppy, 1=hd |
start_msg db "Press [abcd] to change settings, press [Enter] to continue booting",13,10,0 |
start_msg db "Press [abcde] to change settings, press [Enter] to continue booting",13,10,0 |
time_msg db " or wait " |
time_str db " 5 seconds" |
db " before automatical continuation",13,10,0 |
68,8 → 66,14 |
on_msg db " on",13,10,0 |
off_msg db " off",13,10,0 |
preboot_device_msg db " [c] Floppy image: ",0 |
debug_mode_msg db " [c] Duplicate debug output to the screen:",0 |
ask_debug db "Duplicate debug output to the screen? [1-yes, 2-no]: ",0 |
launcher_msg db " [d] Start LAUNCHER after kernel is loaded:",0 |
ask_launcher db "Start first application (LAUNCHER) after kernel is loaded? [1-yes, 2-no]: ",0 |
preboot_device_msg db " [e] Floppy image: ",0 |
if defined extended_primary_loader |
preboot_device_msgs dw 0,pdm1,pdm2,0 |
pdm1 db "real floppy",13,10,0 |
/kernel/branches/Kolibri-acpi/boot/bootet.inc |
---|
15,12 → 15,10 |
d80x25_bottom: |
latin1 '║ KolibriOS pohineb MenuetOS ja kaasas IGASUGUSE GARANTI' |
latin1 'ITA ║' |
latin1 '║ Naha faili COPYING detailid ' |
latin1 ' ║' |
latin1 '║ KolibriOS kaasas IGASUGUSE GARANTIITA. Naha faili COPY' |
latin1 'ING detailid ║' |
line_full_bottom |
d80x25_bottom_num = 3 |
d80x25_bottom_num = 2 |
msg_apm: latin1 " APM x.x ", 0 |
novesa: latin1 "Ekraan: EGA/CGA",13,10,0 |
54,7 → 52,7 |
pros: latin1 "00" |
backspace2:latin1 8,8,0 |
boot_dev db 0 ; 0=floppy, 1=hd |
start_msg:latin1 "Vajuta [abcd] seadete muutmiseks, vajuta [Enter] laadimise jätkamiseks",13,10,0 |
start_msg:latin1 "Vajuta [abcde] seadete muutmiseks, vajuta [Enter] laadimise jätkamiseks",13,10,0 |
time_msg: latin1 " või oota " |
time_str: latin1 " 5 sekundit" |
latin1 " automaatseks jätkamiseks",13,10,0 |
68,8 → 66,14 |
on_msg: latin1 " sees",13,10,0 |
off_msg: latin1 " väljas",13,10,0 |
preboot_device_msg:latin1 " [c] Disketi kujutis: ",0 |
debug_mode_msg: latin1 " [c] Duplicate siluda väljund ekraani:",0 |
ask_debug: latin1 "Duplicate siluda väljund ekraani? [1-jah, 2-no]: ",0 |
launcher_msg: latin1 " [d] Alusta LAUNCHER pärast kernel on koormatud:",0 |
ask_launcher: latin1 "Alusta esimese taotluse (LAUNCHER) pärast kernel laetakse? [1-jah, 2-no]: ",0 |
preboot_device_msg:latin1 " [e] Disketi kujutis: ",0 |
if defined extended_primary_loader |
preboot_device_msgs dw 0,pdm1,pdm2,0 |
pdm1: latin1 "reaalne diskett",13,10,0 |
/kernel/branches/Kolibri-acpi/boot/bootge.inc |
---|
15,8 → 15,8 |
d80x25_bottom: |
db 186,' KolibriOS basiert auf MenuetOS und wird ohne jegliche ' |
db ' Garantie vertrieben ',186 |
db 186,' KolibriOS wird ohne jegliche Garantie vertrieben. ' |
db ' ',186 |
db 186,' Details stehen in der Datei COPYING ' |
db ' ',186 |
line_full_bottom |
54,7 → 54,7 |
pros db "00" |
backspace2 db 8,8,0 |
boot_dev db 0 ; 0=floppy, 1=hd |
start_msg db "Druecke [abcd], um die Einstellungen zu aendern, druecke [Enter] zum starten",13,10,0 |
start_msg db "Druecke [abcde], um die Einstellungen zu aendern, druecke [Enter] zum starten",13,10,0 |
time_msg db " oder warte " |
time_str db " 5 Sekunden" |
db " bis zum automatischen Start",13,10,0 |
68,8 → 68,14 |
on_msg db " an",13,10,0 |
off_msg db " aus",13,10,0 |
preboot_device_msg db " [c] Diskettenimage: ",0 |
debug_mode_msg db " [c] Duplizieren debuggen Ausgabe auf dem Bildschirm:",0 |
ask_debug db "Duplizieren debuggen Ausgabe auf dem Bildschirm? [1-ja, 2 nein]: ",0 |
launcher_msg db " [d] Start LAUNCHER nach Kernel geladen wird:",0 |
ask_launcher db "Starten erste Anwendung nach Kernel geladen wird? [1-ja, 2 nein]: ",0 |
preboot_device_msg db " [e] Diskettenimage: ",0 |
if defined extended_primary_loader |
preboot_device_msgs dw 0,pdm1,pdm2,0 |
pdm1 db "Echte Diskette",13,10,0 |
/kernel/branches/Kolibri-acpi/boot/bootru.inc |
---|
15,7 → 15,7 |
d80x25_bottom: |
cp866 '║ KolibriOS основана на MenuetOS и НЕ ПРЕДОСТАВЛЯЕТ НИКАКИХ ГАРAНТИЙ. ║' |
cp866 '║ KolibriOS НЕ ПРЕДОСТАВЛЯЕТ НИКАКИХ ГАРAНТИЙ. ║' |
cp866 '║ Подробнее смотрите в файле COPYING.TXT ║' |
line_full_bottom |
d80x25_bottom_num = 3 |
50,7 → 50,7 |
pros: cp866 "00" |
backspace2:cp866 8,8,0 |
boot_dev db 0 |
start_msg:cp866 "Нажмите [abcd] для изменения настроек, [Enter] для продолжения загрузки",13,10,0 |
start_msg:cp866 "Нажмите [abcde] для изменения настроек, [Enter] для продолжения загрузки",13,10,0 |
time_msg: cp866 " или подождите " |
time_str: cp866 " 5 секунд " |
cp866 " до автоматического продолжения",13,10,0 |
64,8 → 64,14 |
on_msg: cp866 " вкл",13,10,0 |
off_msg: cp866 " выкл",13,10,0 |
preboot_device_msg:cp866 " [c] Образ дискеты: ",0 |
debug_mode_msg: cp866 " [c] Дублировать дебаг-вывод на экран монитора:",0 |
ask_debug: cp866 "Дублировать дебаг-вывод на экран монитора? [1-да, 2-нет]: ",0 |
launcher_msg: cp866 " [d] Запустить программу LAUNCHER после загрузки ядра:",0 |
ask_launcher: cp866 "Запустить первую программу (LAUNCHER) после загрузки ядра? [1-да, 2-нет]: ",0 |
preboot_device_msg:cp866 " [e] Образ дискеты: ",0 |
if defined extended_primary_loader |
preboot_device_msgs dw 0,pdm1,pdm2,0 |
pdm1: cp866 "настоящая дискета",13,10,0 |
/kernel/branches/Kolibri-acpi/boot/bootsp.inc |
---|
17,8 → 17,8 |
d80x25_bottom: |
cp850 '║ KolibriOS está basado en MenuetOS y viene ABSOLUTAMENTE ' |
cp850 'SIN GARANTíA ║' |
cp850 '║ KolibriOS y viene ABSOLUTAMENTE SIN GARANTíA. ' |
cp850 ' ║' |
cp850 '║ Lee el archivo COPYING por más detalles ' |
cp850 ' ║' |
line_full_bottom |
56,7 → 56,7 |
pros: cp850 "00" |
backspace2:cp850 8,8,0 |
boot_dev db 0 ; 0=floppy, 1=hd |
start_msg:cp850 "Presiona [abcd] para cambiar la configuración, [Enter] para continuar",13,10,0 |
start_msg:cp850 "Presiona [abcde] para cambiar la configuración, [Enter] para continuar",13,10,0 |
time_msg: cp850 " o espera " |
time_str: cp850 " 5 segundos" |
cp850 " para que inicie automáticamente",13,10,0 |
70,8 → 70,14 |
on_msg: cp850 " activado",13,10,0 |
off_msg: cp850 " desactivado",13,10,0 |
preboot_device_msg:cp850 " [c] Imagen de disquete: ",0 |
debug_mode_msg: cp850 " [c] Duplicar depurar salida a la pantalla:",0 |
ask_debug: cp850 "¿Duplicar depurar la salida a la pantalla? [1-si, 2-no]: ",0 |
launcher_msg: cp850 " [d] Iniciar LAUNCHER después de cargar kernel:",0 |
ask_launcher: cp850 "¿Inicie la primera aplicación después de cargar el kernel? [1-si, 2-no]: ",0 |
preboot_device_msg:cp850 " [e] Imagen de disquete: ",0 |
if defined extended_primary_loader |
preboot_device_msgs dw 0,pdm1,pdm2,0 |
pdm1: cp850 "disquete real",13,10,0 |
/kernel/branches/Kolibri-acpi/boot/bootvesa.inc |
---|
700,12 → 700,12 |
mov di, 1444 |
xor ax, ax |
mov ah, 1*16+15 |
mov cx, 70 |
mov cx, 77 |
mov bp, 12 |
.loop_start: |
rep stosw |
mov cx, 70 |
add di, 20 |
mov cx, 77 |
add di, 6 |
dec bp |
jns .loop_start |
pop es |
/kernel/branches/Kolibri-acpi/boot/parsers.inc |
---|
5,7 → 5,7 |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision: 2261 $ |
$Revision: 2288 $ |
; All parsers are called with ds:si -> value of the variable, |
; possibly with spaces before, and dx = limit of config file. |
/kernel/branches/Kolibri-acpi/boot/preboot.inc |
---|
24,6 → 24,8 |
;pixel_save dw 0 ; per to pixel |
preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes) |
;preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no) |
preboot_debug db 0 ; load kernel in debug mode? (1-yes, 2-no) |
preboot_launcher db 0 ; start launcher after kernel is loaded? (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 4-format ram disk) |
/kernel/branches/Kolibri-acpi/boot/rdload.inc |
---|
1,6 → 1,6 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; |
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8,86 → 8,69 |
$Revision$ |
read_ramdisk: |
; READ RAMDISK IMAGE FROM HD |
cmp [boot_dev+OS_BASE+0x10000], 1 |
jne no_sys_on_hd |
test [DRIVE_DATA+1], byte 0x40 |
jz position_2 |
mov [hdbase], 0x1f0 |
mov [hdid], 0x0 |
mov [hdpos], 1 |
mov [fat32part], 0 |
position_1_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved], 1 |
je yes_sys_on_hd |
movzx eax, byte [DRIVE_DATA+2] |
cmp [fat32part], eax |
jle position_1_1 |
position_2: |
test [DRIVE_DATA+1], byte 0x10 |
jz position_3 |
mov [hdbase], 0x1f0 |
mov [hdid], 0x10 |
mov [hdpos], 2 |
mov [fat32part], 0 |
position_2_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved], 1 |
je yes_sys_on_hd |
movzx eax, byte [DRIVE_DATA+3] |
cmp eax, [fat32part] |
jle position_2_1 |
position_3: |
test [DRIVE_DATA+1], byte 0x4 |
jz position_4 |
mov [hdbase], 0x170 |
mov [hdid], 0x0 |
mov [hdpos], 3 |
mov [fat32part], 0 |
position_3_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved], 1 |
je yes_sys_on_hd |
movzx eax, byte [DRIVE_DATA+4] |
cmp eax, [fat32part] |
jle position_3_1 |
position_4: |
test [DRIVE_DATA+1], byte 0x1 |
jz no_sys_on_hd |
mov [hdbase], 0x170 |
mov [hdid], 0x10 |
mov [hdpos], 4 |
mov [fat32part], 0 |
position_4_1: |
inc [fat32part] |
call search_and_read_image |
cmp [image_retrieved], 1 |
je yes_sys_on_hd |
movzx eax, byte [DRIVE_DATA+5] |
cmp eax, [fat32part] |
jle position_4_1 |
jmp yes_sys_on_hd |
search_and_read_image: |
call set_FAT32_variables |
mov edx, bootpath |
xor ebp, ebp |
.hd_loop: |
lea eax, [ebp+'0'] |
mov [read_image_fsinfo.name_digit], al |
movzx eax, byte [DRIVE_DATA+2+ebp] |
test eax, eax |
jz .next_hd |
push eax |
mov esi, 1 |
.partition_loop: |
mov eax, esi |
push -'0' |
@@: |
xor edx, edx |
div [_10] |
push edx |
test eax, eax |
jnz @b |
mov edi, read_image_fsinfo.partition |
@@: |
pop eax |
add al, '0' |
stosb |
jnz @b |
mov byte [edi-1], '/' |
push esi edi |
mov esi, bootpath1 |
mov ecx, bootpath1.len |
rep movsb |
call read_image |
test eax, eax |
jz image_present |
mov edx, bootpath2 |
jz .yes |
cmp eax, 6 |
jz .yes |
pop edi |
push edi |
mov esi, bootpath2 |
mov ecx, bootpath2.len |
rep movsb |
call read_image |
test eax, eax |
jz image_present |
ret |
image_present: |
mov [image_retrieved], 1 |
ret |
jz .yes |
cmp eax, 6 |
jz .yes |
pop edi esi |
inc esi |
cmp esi, [esp] |
jbe .partition_loop |
pop eax |
.next_hd: |
inc ebp |
cmp ebp, 4 |
jb .hd_loop |
jmp no_sys_on_hd |
.yes: |
pop edi esi eax |
jmp yes_sys_on_hd |
iglobal |
align 4 |
94,10 → 77,18 |
read_image_fsinfo: |
dd 0 ; function: read |
dq 0 ; offset: zero |
dd 1474560/512 ; size |
dd 1474560 ; size |
dd RAMDISK ; buffer |
db 0 |
dd hdsysimage+OS_BASE+0x10000 |
db '/hd' |
.name_digit db '0' |
db '/' |
.partition: |
rb 64 ; should be enough for '255/KOLIBRI/KOLIBRI.IMG' |
bootpath1 db 'KOLIBRI.IMG',0 |
.len = $ - bootpath1 |
bootpath2 db 'KOLIBRI/KOLIBRI.IMG',0 |
.len = $ - bootpath2 |
endg |
read_image: |
107,8 → 98,6 |
popad |
ret |
image_retrieved db 0 |
counter_of_partitions db 0 |
no_sys_on_hd: |
; test_to_format_ram_disk (need if not using ram disk) |
cmp [boot_dev+OS_BASE+0x10000], 3 |