Subversion Repositories Kolibri OS

Rev

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

Rev 3742 Rev 4273
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 3742 $
8
$Revision: 4273 $
9
 
9
 
10
ERROR_SUCCESS        = 0
10
ERROR_SUCCESS        = 0
11
ERROR_DISK_BASE      = 1
11
ERROR_DISK_BASE      = 1
Line 28... Line 28...
28
; diamond, 2006
28
; diamond, 2006
Line 29... Line 29...
29
 
29
 
30
iglobal
30
iglobal
31
; in this table names must be in lowercase
31
; in this table names must be in lowercase
32
rootdirs:
-
 
33
        db      2,'rd'
-
 
34
        dd      fs_OnRamdisk
-
 
35
        dd      fs_NextRamdisk
-
 
36
        db      7,'ramdisk'
-
 
37
        dd      fs_OnRamdisk
-
 
38
        dd      fs_NextRamdisk
-
 
39
        db      2,'fd'
-
 
40
        dd      fs_OnFloppy
-
 
41
        dd      fs_NextFloppy
-
 
42
        db      10,'floppydisk'
-
 
43
        dd      fs_OnFloppy
-
 
44
        dd      fs_NextFloppy
32
rootdirs:
45
;**********************************************
33
;**********************************************
46
        db      3,'cd0'
34
        db      3,'cd0'
47
        dd      fs_OnCd0
35
        dd      fs_OnCd0
48
        dd      fs_NextCd
36
        dd      fs_NextCd
Line 58... Line 46...
58
;***********************************************
46
;***********************************************
59
        db      0
47
        db      0
Line 60... Line 48...
60
 
48
 
61
 
-
 
62
virtual_root_query:
-
 
63
        dd      fs_HasRamdisk
-
 
64
        db      'rd',0
-
 
65
        dd      fs_HasFloppy
49
 
66
        db      'fd',0
50
virtual_root_query:
67
;**********************************************
51
;**********************************************
68
        dd      fs_HasCd0
52
        dd      fs_HasCd0
69
        db      'cd0',0
53
        db      'cd0',0
Line 434... Line 418...
434
;     esi -> relative (for device) name
418
;     esi -> relative (for device) name
435
;     ebx -> fileinfo
419
;     ebx -> fileinfo
436
;     ebp = 0 or pointer to rest of name from folder addressed by esi
420
;     ebp = 0 or pointer to rest of name from folder addressed by esi
437
; out: [image_of_eax]=image of eax, [image_of_ebx]=image of ebx
421
; out: [image_of_eax]=image of eax, [image_of_ebx]=image of ebx
Line 438... Line -...
438
 
-
 
439
fs_OnRamdisk:
-
 
440
        cmp     ecx, 1
-
 
441
        jnz     file_system_lfn.notfound
-
 
442
        mov     eax, [ebx]
-
 
443
        cmp     eax, fs_NumRamdiskServices
-
 
444
        jae     .not_impl
-
 
445
        mov     ecx, [ebx+12]
-
 
446
        mov     edx, [ebx+16]
-
 
447
   ;     add     edx, std_application_base_address
-
 
448
        add     ebx, 4
-
 
449
        call    dword [fs_RamdiskServices + eax*4]
-
 
450
        mov     [image_of_eax], eax
-
 
451
        mov     [image_of_ebx], ebx
-
 
452
        ret
-
 
453
.not_impl:
-
 
454
        mov     dword [image_of_eax], 2       ; not implemented
-
 
455
        ret
-
 
456
 
422
 
457
fs_NotImplemented:
423
fs_NotImplemented:
458
        mov     eax, 2
424
        mov     eax, 2
Line 459... Line -...
459
        ret
-
 
460
 
-
 
461
fs_RamdiskServices:
-
 
462
        dd      fs_RamdiskRead
-
 
463
        dd      fs_RamdiskReadFolder
-
 
464
        dd      fs_RamdiskRewrite
-
 
465
        dd      fs_RamdiskWrite
-
 
466
        dd      fs_RamdiskSetFileEnd
-
 
467
        dd      fs_RamdiskGetFileInfo
-
 
468
        dd      fs_RamdiskSetFileInfo
-
 
469
        dd      0
-
 
470
        dd      fs_RamdiskDelete
-
 
471
        dd      fs_RamdiskCreateFolder
-
 
472
fs_NumRamdiskServices = ($ - fs_RamdiskServices)/4
-
 
473
 
-
 
474
fs_OnFloppy:
-
 
475
        cmp     ecx, 2
-
 
476
        ja      file_system_lfn.notfound
-
 
477
        mov     eax, [ebx]
-
 
478
        cmp     eax, fs_NumFloppyServices
-
 
479
        jae     fs_OnRamdisk.not_impl
-
 
480
        call    reserve_flp
-
 
481
        mov     [flp_number], cl
-
 
482
        mov     ecx, [ebx+12]
-
 
483
        mov     edx, [ebx+16]
-
 
484
   ;     add     edx, std_application_base_address
-
 
485
        add     ebx, 4
-
 
486
        call    dword [fs_FloppyServices + eax*4]
-
 
487
        and     [flp_status], 0
-
 
488
        mov     [image_of_eax], eax
-
 
489
        mov     [image_of_ebx], ebx
-
 
490
        ret
-
 
491
 
-
 
492
fs_FloppyServices:
-
 
493
        dd      fs_FloppyRead
-
 
494
        dd      fs_FloppyReadFolder
-
 
495
        dd      fs_FloppyRewrite
-
 
496
        dd      fs_FloppyWrite
-
 
497
        dd      fs_FloppySetFileEnd
-
 
498
        dd      fs_FloppyGetFileInfo
-
 
499
        dd      fs_FloppySetFileInfo
-
 
500
        dd      0
-
 
501
        dd      fs_FloppyDelete
-
 
502
        dd      fs_FloppyCreateFolder
-
 
503
fs_NumFloppyServices = ($ - fs_FloppyServices)/4
425
        ret
504
 
426
 
505
;*******************************************************
427
;*******************************************************
506
fs_OnCd0:
428
fs_OnCd0:
507
        call    reserve_cd
429
        call    reserve_cd
Line 582... Line 504...
582
        dd      fs_NotImplemented
504
        dd      fs_NotImplemented
583
        dd      fs_NotImplemented
505
        dd      fs_NotImplemented
584
fs_NumCdServices = ($ - fs_CdServices)/4
506
fs_NumCdServices = ($ - fs_CdServices)/4
Line 585... Line 507...
585
 
507
 
586
;*******************************************************
-
 
587
 
-
 
588
fs_HasRamdisk:
-
 
589
        mov     al, 1   ; we always have ramdisk
-
 
590
        ret
-
 
591
fs_HasFloppy:
-
 
592
        cmp     byte [DRIVE_DATA], 0
-
 
593
        setnz   al
-
 
594
        ret
-
 
595
 
-
 
596
;*******************************************************
508
;*******************************************************
597
fs_HasCd0:
509
fs_HasCd0:
598
        test    byte [DRIVE_DATA+1], 10000000b
510
        test    byte [DRIVE_DATA+1], 10000000b
599
        setnz   al
511
        setnz   al
600
        ret
512
        ret
Line 615... Line 527...
615
; fs_NextXXX functions:
527
; fs_NextXXX functions:
616
; in: eax = partition number, from which start to scan
528
; in: eax = partition number, from which start to scan
617
; out: CF=1 => no more partitions
529
; out: CF=1 => no more partitions
618
;      CF=0 => eax=next partition number
530
;      CF=0 => eax=next partition number
Line 619... Line -...
619
 
-
 
620
fs_NextRamdisk:
-
 
621
; we always have /rd/1
-
 
622
        test    eax, eax
-
 
623
        stc
-
 
624
        jnz     @f
-
 
625
        mov     al, 1
-
 
626
        clc
-
 
627
@@:
-
 
628
        ret
-
 
629
 
-
 
630
fs_NextFloppy:
-
 
631
; we have /fd/1 iff (([DRIVE_DATA] and 0xF0) != 0) and /fd/2 iff (([DRIVE_DATA] and 0x0F) != 0)
-
 
632
        test    byte [DRIVE_DATA], 0xF0
-
 
633
        jz      .no1
-
 
634
        test    eax, eax
-
 
635
        jnz     .no1
-
 
636
        inc     eax
-
 
637
        ret     ; CF cleared
-
 
638
.no1:
-
 
639
        test    byte [DRIVE_DATA], 0x0F
-
 
640
        jz      .no2
-
 
641
        cmp     al, 2
-
 
642
        jae     .no2
-
 
643
        mov     al, 2
-
 
644
        clc
-
 
645
        ret
-
 
646
.no2:
-
 
647
        stc
-
 
648
        ret
-
 
649
 
531
 
650
;*******************************************************
532
;*******************************************************
651
fs_NextCd:
533
fs_NextCd:
652
; we always have /cdX/1
534
; we always have /cdX/1
653
        test    eax, eax
535
        test    eax, eax