forked from KolibriOS/kolibrios
SEARCHAP - use debug-fdo.inc instead debug.inc
git-svn-id: svn://kolibrios.org@4607 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0e2203e0cb
commit
834239b12b
@ -1,6 +1,6 @@
|
|||||||
; Search Additional Partition for KolibriOS applications
|
; Search Additional Partition for KolibriOS applications
|
||||||
;
|
;
|
||||||
; Copyright (c) 2013, Marat Zakiyanov aka Mario79, aka Mario
|
; Copyright (c) 2013-2014, Marat Zakiyanov aka Mario79, aka Mario
|
||||||
; All rights reserved.
|
; All rights reserved.
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; Redistribution and use in source and binary forms, with or without
|
||||||
@ -76,13 +76,11 @@ additional_dir_name:
|
|||||||
real_additional_dir:
|
real_additional_dir:
|
||||||
db '/kolibrios',0
|
db '/kolibrios',0
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
debug equ no ;yes
|
|
||||||
|
|
||||||
include '../../macros.inc'
|
include '../../macros.inc'
|
||||||
|
|
||||||
if debug eq yes
|
define __DEBUG__ 1
|
||||||
include '../../debug.inc'
|
define __DEBUG_LEVEL__ 2 ; 1 = verbose, 2 = main only
|
||||||
end if
|
include "../../debug-fdo.inc"
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
START:
|
START:
|
||||||
mcall 5,500
|
mcall 5,500
|
||||||
@ -94,11 +92,8 @@ START:
|
|||||||
mov [ebx],ax
|
mov [ebx],ax
|
||||||
call device_detect_f70
|
call device_detect_f70
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
|
||||||
call print_retrieved_devices_table
|
call print_retrieved_devices_table
|
||||||
dps 'get basic file'
|
DEBUGF 1, "Searchap: get basic file\n"
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
call load_file ; download the master file
|
call load_file ; download the master file
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
@ -111,27 +106,13 @@ end if
|
|||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
exit:
|
exit:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: just exit\n"
|
||||||
dps 'just exit'
|
|
||||||
;newline
|
|
||||||
; mov edx,read_folder_name
|
|
||||||
; call debug_outstr
|
|
||||||
;newline
|
|
||||||
; mov edx,read_folder_1_name
|
|
||||||
; call debug_outstr
|
|
||||||
;newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
mcall -1
|
mcall -1
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
device_detect_f70:
|
device_detect_f70:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: read_folder_name: %s\n",read_folder_name
|
||||||
dps 'read_folder_name: '
|
|
||||||
mov edx,read_folder_name
|
|
||||||
call debug_outstr
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
mcall 70,read_folder
|
mcall 70,read_folder
|
||||||
test eax,eax
|
test eax,eax
|
||||||
@ -139,20 +120,12 @@ end if
|
|||||||
cmp eax,6
|
cmp eax,6
|
||||||
je @f
|
je @f
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: read_folder_error\n"
|
||||||
dps 'read_folder_error'
|
|
||||||
newline
|
|
||||||
; mov edx,read_folder_name
|
|
||||||
; call debug_outstr
|
|
||||||
;newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
jmp exit
|
jmp exit
|
||||||
@@:
|
@@:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
|
||||||
call print_root_dir
|
call print_root_dir
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
mov [left_folder_block],ebx
|
mov [left_folder_block],ebx
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
@ -164,12 +137,7 @@ end if
|
|||||||
add esi,32+40
|
add esi,32+40
|
||||||
call copy_folder_name_1
|
call copy_folder_name_1
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: read_folder_1_name: %s\n",read_folder_1_name
|
||||||
;dps 'read_folder_1_name: '
|
|
||||||
; mov edx,read_folder_1_name
|
|
||||||
; call debug_outstr
|
|
||||||
;newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
mcall 70,read_folder_1
|
mcall 70,read_folder_1
|
||||||
test eax,eax
|
test eax,eax
|
||||||
@ -177,13 +145,7 @@ end if
|
|||||||
cmp eax,6
|
cmp eax,6
|
||||||
je @f
|
je @f
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: read_folder_error_1\n"
|
||||||
dps 'read_folder_error_1'
|
|
||||||
newline
|
|
||||||
; mov edx,read_folder_1_name
|
|
||||||
; call debug_outstr
|
|
||||||
;newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
jmp exit
|
jmp exit
|
||||||
@@:
|
@@:
|
||||||
@ -242,10 +204,7 @@ load_file:
|
|||||||
mov [fileinfo.size],eax
|
mov [fileinfo.size],eax
|
||||||
mov [fs_error],eax
|
mov [fs_error],eax
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: get file info\n"
|
||||||
dps 'get file info'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
mcall 68,1
|
mcall 68,1
|
||||||
mcall 70,fileinfo
|
mcall 70,fileinfo
|
||||||
@ -253,21 +212,14 @@ end if
|
|||||||
test eax,eax
|
test eax,eax
|
||||||
jnz .file_error
|
jnz .file_error
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: file info ok\n"
|
||||||
dps 'file info ok'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov [fileinfo.subfunction],eax ;dword 0
|
mov [fileinfo.subfunction],eax ;dword 0
|
||||||
mov eax,[fileinfo.return]
|
mov eax,[fileinfo.return]
|
||||||
mov ecx,[eax+32]
|
mov ecx,[eax+32]
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: real file size: %d\n",ecx
|
||||||
dps 'real file size: '
|
|
||||||
dpd ecx
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
test ecx,ecx
|
test ecx,ecx
|
||||||
jz .file_error
|
jz .file_error
|
||||||
@ -279,10 +231,7 @@ end if
|
|||||||
@@:
|
@@:
|
||||||
mov [fileinfo.size],ecx
|
mov [fileinfo.size],ecx
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: get file\n"
|
||||||
dps 'get file'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
mcall 68,1
|
mcall 68,1
|
||||||
mcall 70,fileinfo
|
mcall 70,fileinfo
|
||||||
@ -297,20 +246,13 @@ end if
|
|||||||
;-----------------------------------
|
;-----------------------------------
|
||||||
.file_error:
|
.file_error:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: read file - error!\n"
|
||||||
dps 'read file - error!'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
ret
|
ret
|
||||||
;-----------------------------------
|
;-----------------------------------
|
||||||
@@:
|
@@:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: read file corrected size: %d\n",[fileinfo.size]
|
||||||
dps 'read file corrected size: '
|
|
||||||
dpd dword[fileinfo.size]
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
@ -323,11 +265,7 @@ search_and_load_pointer_file_label:
|
|||||||
; sub esi,10 ; deleted because /rd/1/ no need to check
|
; sub esi,10 ; deleted because /rd/1/ no need to check
|
||||||
.next_entry:
|
.next_entry:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "\nSearchap: copy next entry\n"
|
||||||
newline
|
|
||||||
dps 'copy next entry'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
add esi,10
|
add esi,10
|
||||||
push esi
|
push esi
|
||||||
@ -338,13 +276,7 @@ end if
|
|||||||
call copy_folder_name.1
|
call copy_folder_name.1
|
||||||
pop esi
|
pop esi
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: %s\n",dword[fileinfo.name]
|
||||||
mov edx,[fileinfo.name]
|
|
||||||
push ecx
|
|
||||||
call debug_outstr
|
|
||||||
pop ecx
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
; mcall 5,10
|
; mcall 5,10
|
||||||
push ecx
|
push ecx
|
||||||
@ -361,16 +293,17 @@ end if
|
|||||||
dec ecx
|
dec ecx
|
||||||
jnz .next_entry
|
jnz .next_entry
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 2, "Searchap: additional parttition is not found!\n"
|
||||||
dps 'additional parttition is not found!'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
ret
|
ret
|
||||||
.sucess:
|
.sucess:
|
||||||
call compare_files_and_mount
|
call compare_files_and_mount
|
||||||
cmp [compare_flag],byte 0
|
cmp [compare_flag],byte 0
|
||||||
jne @b
|
jne @b
|
||||||
|
cmp [mount_dir],1
|
||||||
|
je @f
|
||||||
|
DEBUGF 2, "Searchap: sorry, but the additional partition is not found!\n"
|
||||||
|
@@:
|
||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
compare_files_and_mount:
|
compare_files_and_mount:
|
||||||
@ -390,17 +323,9 @@ compare_files_and_mount:
|
|||||||
mov [compare_flag],byte 0
|
mov [compare_flag],byte 0
|
||||||
pop esi ecx
|
pop esi ecx
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 2, "Searchap: compare files sucess!\n"
|
||||||
dps 'compare files sucess!'
|
DEBUGF 2, "Searchap: mount directory: %s\n",esi
|
||||||
newline
|
mov [mount_dir],1
|
||||||
dps 'mount directory:'
|
|
||||||
newline
|
|
||||||
mov edx,esi
|
|
||||||
push esi
|
|
||||||
call debug_outstr
|
|
||||||
pop esi
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
; prepare real directory path for mounting
|
; prepare real directory path for mounting
|
||||||
inc esi
|
inc esi
|
||||||
@ -422,10 +347,7 @@ end if
|
|||||||
mov [compare_flag],byte 1
|
mov [compare_flag],byte 1
|
||||||
pop esi ecx
|
pop esi ecx
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
if debug eq yes
|
DEBUGF 1, "Searchap: compare files is not match!\n"
|
||||||
dps 'compare files is not match!'
|
|
||||||
newline
|
|
||||||
end if
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
@ -445,49 +367,36 @@ copy_folder_name_1:
|
|||||||
mov edi,read_folder_1_name+1
|
mov edi,read_folder_1_name+1
|
||||||
jmp proc_copy_patch
|
jmp proc_copy_patch
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
if debug eq yes
|
|
||||||
print_retrieved_devices_table:
|
print_retrieved_devices_table:
|
||||||
mov ecx,[retrieved_devices_table_counter]
|
mov ecx,[retrieved_devices_table_counter]
|
||||||
mov edx,retrieved_devices_table
|
mov edx,retrieved_devices_table
|
||||||
dps 'retrieved_devices_table:'
|
DEBUGF 1, "Searchap: retrieved_devices_table:\n"
|
||||||
newline
|
DEBUGF 1, "Searchap: ----------\n"
|
||||||
dps '----------'
|
|
||||||
newline
|
|
||||||
@@:
|
@@:
|
||||||
push ecx edx
|
DEBUGF 1, "Searchap: %s\n",edx
|
||||||
call debug_outstr
|
|
||||||
newline
|
|
||||||
pop edx ecx
|
|
||||||
add edx,10
|
add edx,10
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz @b
|
jnz @b
|
||||||
newline
|
DEBUGF 1, "\nSearchap: ----------\n"
|
||||||
dps '----------'
|
|
||||||
newline
|
|
||||||
ret
|
ret
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
print_root_dir:
|
print_root_dir:
|
||||||
dps '----------'
|
DEBUGF 1, "Searchap: ----------\n"
|
||||||
dps 'root dir:'
|
DEBUGF 1, "Searchap: root dir:\n"
|
||||||
dps '----------'
|
DEBUGF 1, "Searchap: ----------\n"
|
||||||
newline
|
|
||||||
pusha
|
pusha
|
||||||
mov ecx,ebx
|
mov ecx,ebx
|
||||||
mov edx,folder_data+32+40
|
mov edx,folder_data+32+40
|
||||||
@@:
|
@@:
|
||||||
push ecx edx
|
DEBUGF 1, "Searchap: %s\n",edx
|
||||||
call debug_outstr
|
|
||||||
newline
|
|
||||||
pop edx ecx
|
|
||||||
add edx,304
|
add edx,304
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz @b
|
jnz @b
|
||||||
popa
|
popa
|
||||||
newline
|
DEBUGF 1, "\nSearchap: ----------\n"
|
||||||
dps '----------'
|
|
||||||
newline
|
|
||||||
ret
|
ret
|
||||||
end if
|
;-------------------------------------------------------------------------------
|
||||||
|
include_debug_strings
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
IM_END:
|
IM_END:
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
@ -499,6 +408,7 @@ retrieved_devices_table_counter rd 1
|
|||||||
basic_file_size rd 1
|
basic_file_size rd 1
|
||||||
fs_error rd 1
|
fs_error rd 1
|
||||||
compare_flag rb 1
|
compare_flag rb 1
|
||||||
|
mount_dir rb 1
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
f30_3_work_area:
|
f30_3_work_area:
|
||||||
|
Loading…
Reference in New Issue
Block a user