Subversion Repositories Kolibri OS

Rev

Rev 133 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 133 Rev 147
Line 40... Line 40...
40
; eax = 2  ; delete file        /RamDisk/First 32
40
; eax = 2  ; delete file        /RamDisk/First 32
41
; eax = 4  ; makedir
41
; eax = 4  ; makedir
42
; eax = 5  ; rename file/directory
42
; eax = 5  ; rename file/directory
43
; eax = 8  ; lba read
43
; eax = 8  ; lba read
44
; eax = 15 ; get_disk_info
44
; eax = 15 ; get_disk_info
45
; eax = 16 ; start application
-
 
46
;
45
;
47
; OUT:
46
; OUT:
48
;
47
;
49
; eax = 0  : read ok
48
; eax = 0  : read ok
50
; eax = 1  : no hd base and/or partition defined
49
; eax = 1  : no hd base and/or partition defined
Line 87... Line 86...
87
    ; Extract parameters
86
    ; Extract parameters
88
    add    eax, std_application_base_address    ; abs start of info block
87
    add    eax, std_application_base_address    ; abs start of info block
Line 89... Line 88...
89
 
88
 
90
    cmp   dword [eax+0],15      ; GET_DISK_INFO
89
    cmp   dword [eax+0],15      ; GET_DISK_INFO
91
    je    fs_info
-
 
92
    cmp   dword [eax+0],16      ; RUN - dont care about read&write blocks
-
 
93
    je    fs_read
90
    je    fs_info
94
    cmp   dword [eax+0],5       ; RENAME - dont care about read&write blocks
91
    cmp   dword [eax+0],5       ; RENAME - dont care about read&write blocks
95
    je    fs_read
92
    je    fs_read
96
    cmp   dword [eax+0],4       ; MAKEDIR - dont care about read&write blocks
93
    cmp   dword [eax+0],4       ; MAKEDIR - dont care about read&write blocks
97
    je    fs_read
94
    je    fs_read
Line 147... Line 144...
147
; root - only read is allowed
144
; root - only read is allowed
148
; other operations return "access denied", eax=10
145
; other operations return "access denied", eax=10
149
; (execute operation returns eax=-10)
146
; (execute operation returns eax=-10)
150
    cmp    dword [eax], 0
147
    cmp    dword [eax], 0
151
    jz    .read_root
148
    jz    .read_root
152
    mov    ecx, 10
-
 
153
    cmp    dword [eax], 16
149
    mov    dword [esp+36], 10
154
    jnz    @f
-
 
155
    neg    ecx
-
 
156
@@:    mov    [esp+36], ecx
-
 
157
    ret
150
    ret
158
.read_root:
151
.read_root:
159
; \end{diamond}[18.03.2006]
152
; \end{diamond}[18.03.2006]
160
    mov   esi,dir0
153
    mov   esi,dir0
161
    mov   edi,[eax+12]
154
    mov   edi,[eax+12]
Line 289... Line 282...
289
 
282
 
Line 290... Line 283...
290
    jmp   file_system_return
283
    jmp   file_system_return
Line 291... Line -...
291
 
-
 
292
  fs_noramdisk_write:
-
 
293
 
-
 
294
    cmp   dword [esp+20],16     ; START APPLICATION
-
 
295
    jne   fs_noramdisk_start_application
-
 
296
 
-
 
297
    mov   eax,[esp+4]           ; fname
-
 
298
    add   eax,2*12+1
-
 
299
 
-
 
300
    xor   ebx,ebx               ; parameters to pass
-
 
301
    cmp   dword [esp+12],ebx;0
-
 
302
    je    no_fl_start_param
-
 
303
    mov   ebx, [esp+12]
-
 
304
    add   ebx, std_application_base_address
-
 
305
  no_fl_start_param:
-
 
306
    mov   edx,[esp+16]        ; flags
-
 
307
 
-
 
308
    call  start_application_fl
-
 
309
 
-
 
310
    jmp   file_system_startapp_return
284
 
311
 
285
  fs_noramdisk_write:
312
  fs_noramdisk_start_application:     ;there's new code - Mihasik
286
 
313
    cmp   dword [esp+20],2      ;DELETE
287
    cmp   dword [esp+20],2      ;DELETE
314
    jne   fs_noramdisk_delete
288
    jne   fs_noramdisk_delete
Line 393... Line 367...
393
    call  floppy_filedelete
367
    call  floppy_filedelete
394
    mov   [flp_status],0
368
    mov   [flp_status],0
395
    jmp   file_system_return
369
    jmp   file_system_return
Line 396... Line 370...
396
 
370
 
397
  fs_noflpdisk_delete:
-
 
398
    cmp   dword [esp+20],16     ; START APPLICATION
-
 
399
    jne   fs_noflpdisk_start_application
-
 
400
 
-
 
401
    mov   eax,[esp+4]           ; fname
-
 
402
    add   eax,2*12+1
-
 
403
 
-
 
404
    xor   ebx,ebx               ; parameters to pass
-
 
405
    cmp   dword [esp+12],ebx;0
-
 
406
    je    no_flp_start_param
-
 
407
    mov   ebx,[0x3010]
-
 
408
    mov   ebx,[ebx+0x10]
-
 
409
    add   ebx,[esp+12]
-
 
410
 
-
 
411
  no_flp_start_param:
-
 
412
    mov   edx,[esp+16]        ; flags
-
 
413
 
-
 
414
    call  start_application_floppy
-
 
415
 
-
 
416
file_system_startapp_return:
-
 
417
    mov    ebx, [esp+24+24]    ; do not modify ebx in application
-
 
418
    jmp   file_system_return
-
 
419
 
-
 
Line 420... Line 371...
420
  fs_noflpdisk_start_application:
371
  fs_noflpdisk_delete:
421
 
372
 
Line 422... Line 373...
422
  fs_noflpdisk:
373
  fs_noflpdisk:
Line 509... Line 460...
509
 fs_for_new_semantic:
460
 fs_for_new_semantic:
510
    call  choice_necessity_partition 
461
    call  choice_necessity_partition 
Line 511... Line 462...
511
 
462
 
512
  fs_yesharddisk_all:
463
  fs_yesharddisk_all:
513
    mov   eax,1
-
 
514
    cmp    dword [esp+20], 16
-
 
515
    jnz    @f
-
 
516
    neg    eax
464
    mov   eax,1
517
@@:    mov    ebx, [esp+24+24]
465
    mov    ebx, [esp+24+24]
518
    cmp   [hdpos],0             ; is hd base set?
466
    cmp   [hdpos],0             ; is hd base set?
519
    jz    hd_err_return
467
    jz    hd_err_return
520
    cmp   [fat32part],0         ; is partition set?
468
    cmp   [fat32part],0         ; is partition set?
521
    jnz   @f
469
    jnz   @f
Line 655... Line 603...
655
    mov   eax,4                 ; partition not defined at hd
603
    mov   eax,4                 ; partition not defined at hd
656
    jmp   file_system_return
604
    jmp   file_system_return
Line 657... Line 605...
657
 
605
 
Line 658... Line -...
658
  fs_noharddisk_rename:
-
 
659
 
-
 
660
    cmp   dword [esp+20],16     ; START APPLICATION
-
 
661
    jne   fs_noharddisk_start_application
-
 
662
 
-
 
663
    mov   eax,[esp+4]           ; fname
-
 
664
    add   eax,12*2
-
 
665
 
-
 
666
    mov   ebx,[esp+0]           ; length
-
 
667
    sub   ebx,eax
-
 
668
    add   ebx,12
-
 
669
 
-
 
670
    mov   ecx,[esp+4]           ; work area
-
 
671
    add   ecx,512
-
 
672
 
-
 
673
    xor   ebp,ebp               ; parameters to pass
-
 
674
    cmp   dword [esp+12],ebp;0
-
 
675
    je    no_hd_start_param
-
 
676
    mov   ebp, [esp+12]
-
 
677
    add   ebp, std_application_base_address
-
 
678
  no_hd_start_param:
-
 
679
    mov   edx,[esp+16]        ; flags
-
 
680
 
-
 
681
    call  start_application_hd
-
 
682
 
-
 
683
    jmp   file_system_startapp_return
-
 
684
 
-
 
685
  fs_noharddisk_start_application:
606
  fs_noharddisk_rename:
686
 
607
 
687
  fs_noharddisk:
608
  fs_noharddisk:
688
; \begin{diamond}[18.03.2006]
609
; \begin{diamond}[18.03.2006]
689
    mov    eax, 5        ; file not found
-
 
690
; à ìîæåò áûòü, âîçâðàùàòü äðóãîé êîä îøèáêè?
-
 
691
    cmp    dword [esp+20], 16
-
 
692
    jnz    @f
610
    mov    eax, 5        ; file not found
693
    neg    eax
611
; à ìîæåò áûòü, âîçâðàùàòü äðóãîé êîä îøèáêè?
Line 694... Line 612...
694
@@:    mov    ebx, [esp+24+24]    ; do not change ebx in application
612
    mov    ebx, [esp+24+24]    ; do not change ebx in application
Line 695... Line 613...
695
; \end{diamond}[18.03.2006]
613
; \end{diamond}[18.03.2006]
Line 711... Line 629...
711
; (execute operation returns eax=-10)
629
; (execute operation returns eax=-10)
712
    cmp    dword [esp+20], 0
630
    cmp    dword [esp+20], 0
713
    jz    .read
631
    jz    .read
714
    add    esp, 20
632
    add    esp, 20
715
    pop    ecx
633
    pop    ecx
716
    mov    eax, 10
-
 
717
    cmp    ecx, 16
-
 
718
    jnz    @f
-
 
719
    neg    eax
-
 
720
@@:    mov    [esp+36], eax
634
    mov    dword [esp+36], 10
721
    ret
635
    ret
722
.read:
636
.read:
723
; \end{diamond}[18.03.2006]
637
; \end{diamond}[18.03.2006]
724
    mov   al,0x10
638
    mov   al,0x10
725
    mov   ebx,1
639
    mov   ebx,1