Subversion Repositories Kolibri OS

Rev

Rev 8241 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8241 Rev 8400
Line 27... Line 27...
27
;*****************************************************************************
27
;*****************************************************************************
28
	use32
28
	use32
29
	org	0x0
29
	org	0x0
Line 30... Line 30...
30
 
30
 
31
	db 'MENUET01'
-
 
32
	dd 0x01
-
 
33
	dd START
-
 
34
	dd IM_END
-
 
35
	dd I_END
31
	db 'MENUET01'
36
	dd stacktop
32
	dd 0x01, START, IM_END, I_END, stacktop
37
params dd PARAMS
33
	params dd PARAMS
38
	dd 0x0
34
	dd 0x0
39
;---------------------------------------------------------------------
35
;---------------------------------------------------------------------
40
delay dd 500 
36
delay dd 500 
Line 72... Line 68...
72
;-------------------------------------------------------------------------------
68
;-------------------------------------------------------------------------------
73
basic_file_path:
69
basic_file_path:
74
	db '/sys/settings/'
70
	db '/sys/settings/'
75
basic_file_name:
71
basic_file_name:
76
	db 'kolibrios/res/system/kolibri.lbl',0
72
	db 'kolibrios/res/system/kolibri.lbl',0
77
additional_dir_name:
-
 
78
    db 'kolibrios',0
-
 
79
real_additional_dir:
73
real_additional_dir:
80
	db '/kolibrios',0
74
	db '/kolibrios',0
81
;-------------------------------------------------------------------------------
75
;-------------------------------------------------------------------------------
82
include	'../../macros.inc'
76
include	'../../macros.inc'
Line 86... Line 80...
86
include "../../debug-fdo.inc"
80
include "../../debug-fdo.inc"
87
;-------------------------------------------------------------------------------
81
;-------------------------------------------------------------------------------
88
START:
82
START:
89
; process cmdline params
83
; process cmdline params
90
	mov	esi, [params]
84
	mov	esi, [params]
-
 
85
	cmp	[esi], byte '/'
-
 
86
	jne @f
-
 
87
	mov esi, [params] ;user gave us the path so lets mount it
-
 
88
	inc	esi
-
 
89
	mov	edi,f30_3_work_area+64
-
 
90
	call	proc_copy_path
-
 
91
	mcall	30,3,f30_3_work_area
-
 
92
	mcall   -1
-
 
93
@@:	
91
	test	[esi], byte 0xFF
94
	test	[esi], byte 0xFF
92
	jz	.params_done
95
	jz	.params_done
93
	cmp	word[esi], '-d' ; delay
96
	cmp	word[esi], '-d' ; delay
94
	jne	.params_done
97
	jne	.params_done
95
	add	esi, 2
98
	add	esi, 2
Line 183... Line 186...
183
	mov	eax,[read_folder_1.return]
186
	mov	eax,[read_folder_1.return]
184
	cmp	[eax+4],dword 0
187
	cmp	[eax+4],dword 0
185
	je	.continue
188
	je	.continue
186
	mov	[right_folder_block],ebx
189
	mov	[right_folder_block],ebx
187
	xor	ebp,ebp
190
	xor	ebp,ebp
188
.start_copy_device_patch:
191
.start_copy_device_path:
189
	imul	edi,[retrieved_devices_table_counter],10
192
	imul	edi,[retrieved_devices_table_counter],10
190
	add	edi,retrieved_devices_table
193
	add	edi,retrieved_devices_table
191
	mov	[edi],byte '/'
194
	mov	[edi],byte '/'
192
	inc	edi
195
	inc	edi
193
	imul	esi,[temp_counter_1],304
196
	imul	esi,[temp_counter_1],304
194
	add	esi,[read_folder.return]
197
	add	esi,[read_folder.return]
195
	add	esi,32+40
198
	add	esi,32+40
196
	call	proc_copy_patch
199
	call	proc_copy_path
197
	imul	esi,ebp,304
200
	imul	esi,ebp,304
198
	add	esi,[read_folder_1.return]
201
	add	esi,[read_folder_1.return]
199
	add	esi,32+40
202
	add	esi,32+40
200
	mov	[edi-1],byte '/'
203
	mov	[edi-1],byte '/'
201
	call	proc_copy_patch
204
	call	proc_copy_path
202
	inc	[retrieved_devices_table_counter]
205
	inc	[retrieved_devices_table_counter]
203
	inc	ebp
206
	inc	ebp
204
	cmp	ebp,[right_folder_block]
207
	cmp	ebp,[right_folder_block]
205
	jb	.start_copy_device_patch
208
	jb	.start_copy_device_path
206
.continue:
209
.continue:
207
	inc	[temp_counter_1]
210
	inc	[temp_counter_1]
208
	mov	eax,[temp_counter_1]
211
	mov	eax,[temp_counter_1]
209
	cmp	eax,[left_folder_block]
212
	cmp	eax,[left_folder_block]
210
	jb	.start_temp_counter_1
213
	jb	.start_temp_counter_1
Line 361... Line 364...
361
	mov	[mount_dir],1
364
	mov	[mount_dir],1
362
;--------------------------------------
365
;--------------------------------------
363
; prepare real directory path for mounting
366
; prepare real directory path for mounting
364
	inc	esi
367
	inc	esi
365
	mov	edi,f30_3_work_area+64
368
	mov	edi,f30_3_work_area+64
366
	call	proc_copy_patch
369
	call	proc_copy_path
367
	dec	edi
370
	dec	edi
368
	mov	esi,real_additional_dir
371
	mov	esi,real_additional_dir
369
	call	proc_copy_patch
372
	call	proc_copy_path
370
; prepare fake directory name
-
 
371
	mov	esi,additional_dir_name
-
 
372
	mov	edi,f30_3_work_area
-
 
373
	call	proc_copy_patch
-
 
374
; here is call kernel function to mount the found partition
373
; here is call kernel function to mount the found partition
375
; as "/kolibrios" directory to root directory "/"
374
; as "/kolibrios" directory to root directory "/"
376
	mcall	30,3,f30_3_work_area
375
	mcall	30,3,f30_3_work_area
377
	ret
376
	ret
378
;--------------------------------------
377
;--------------------------------------
Line 385... Line 384...
385
	ret
384
	ret
386
;---------------------------------------------------------------------
385
;---------------------------------------------------------------------
387
copy_folder_name:
386
copy_folder_name:
388
	mov	edi,read_folder_name+1
387
	mov	edi,read_folder_name+1
389
.1:
388
.1:
390
proc_copy_patch:
389
proc_copy_path:
391
	cld
390
	cld
392
@@:
391
@@:
393
	lodsb
392
	lodsb
394
	stosb
393
	stosb
395
	test	al,al
394
	test	al,al
396
	jnz	@r
395
	jnz	@r
397
	ret
396
	ret
398
;---------------------------------------------------------------------
397
;---------------------------------------------------------------------
399
copy_folder_name_1:
398
copy_folder_name_1:
400
	mov	edi,read_folder_1_name+1
399
	mov	edi,read_folder_1_name+1
401
	jmp	proc_copy_patch
400
	jmp	proc_copy_path
402
;---------------------------------------------------------------------
401
;---------------------------------------------------------------------
403
print_retrieved_devices_table:
402
print_retrieved_devices_table:
404
	mov	ecx,[retrieved_devices_table_counter]
403
	mov	ecx,[retrieved_devices_table_counter]
405
	mov	edx,retrieved_devices_table
404
	mov	edx,retrieved_devices_table
406
	DEBUGF	1, "Searchap: retrieved_devices_table:\n"
405
	DEBUGF	1, "Searchap: retrieved_devices_table:\n"
Line 445... Line 444...
445
compare_flag		rb 1
444
compare_flag		rb 1
446
mount_dir		rb 1
445
mount_dir		rb 1
447
;-------------------------------------------------------------------------------
446
;-------------------------------------------------------------------------------
448
align 4
447
align 4
449
f30_3_work_area:
448
f30_3_work_area:
-
 
449
	db 'kolibrios',0 
450
	rb 128
450
	rb 118
451
;-------------------------------------------------------------------------------
451
;-------------------------------------------------------------------------------
452
align 4
452
align 4
453
retrieved_devices_table:
453
retrieved_devices_table:
454
	rb 10*100
454
	rb 10*100
455
;-------------------------------------------------------------------------------
455
;-------------------------------------------------------------------------------