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 384
Line 80... Line 80...
80
; 3 : write/append to file
80
; 3 : write/append to file
81
; 4 : set end of file
81
; 4 : set end of file
82
; 5 : get file/directory attributes structure
82
; 5 : get file/directory attributes structure
83
; 6 : set file/directory attributes structure
83
; 6 : set file/directory attributes structure
84
; 7 : start application
84
; 7 : start application
85
; 8 : delete file - not implemented yet
85
; 8 : delete file
86
; 9 : create directory - not implemented yet
86
; 9 : create directory
87
; 10: rename file/directory - not implemented yet
-
 
Line 88... Line 87...
88
 
87
 
89
        add     eax, std_application_base_address
88
        add     eax, std_application_base_address
90
; parse file name
89
; parse file name
91
        xchg    ebx, eax
90
        xchg    ebx, eax
Line 97... Line 96...
97
        mov     esi, [esi]
96
        mov     esi, [esi]
98
        add     esi, std_application_base_address
97
        add     esi, std_application_base_address
99
        mov     ebp, esi
98
        mov     ebp, esi
100
        lodsb
99
        lodsb
101
@@:
100
@@:
-
 
101
        cmp dword [ebx], 7
-
 
102
        jne @F
-
 
103
        mov edx, [ebx+4]
-
 
104
        mov ebx, [ebx+8]
-
 
105
        test ebx, ebx
-
 
106
        jz .l1
-
 
107
        add ebx, new_app_base
-
 
108
.l1:
-
 
109
        call fs_execute  ; ebp, ebx, edx
-
 
110
        mov [esp+36], eax
-
 
111
        ret
-
 
112
@@:
102
        cmp     al, '/'
113
        cmp     al, '/'
103
        jz      @f
114
        jz      @f
104
.notfound:
115
.notfound:
105
        mov     dword [esp+36], 5       ; file not found
116
        mov     dword [esp+36], 5       ; file not found
106
        ret
117
        ret
Line 349... Line 360...
349
        dd      fs_RamdiskRewrite
360
        dd      fs_RamdiskRewrite
350
        dd      fs_RamdiskWrite
361
        dd      fs_RamdiskWrite
351
        dd      fs_RamdiskSetFileEnd
362
        dd      fs_RamdiskSetFileEnd
352
        dd      fs_RamdiskGetFileInfo
363
        dd      fs_RamdiskGetFileInfo
353
        dd      fs_RamdiskSetFileInfo
364
        dd      fs_RamdiskSetFileInfo
354
        dd      fs_RamdiskExecute
365
        dd      0 ;fs_RamdiskExecute
-
 
366
        dd      fs_RamdiskDelete
-
 
367
        dd      fs_RamdiskCreateFolder
355
fs_NumRamdiskServices = ($ - fs_RamdiskServices)/4
368
fs_NumRamdiskServices = ($ - fs_RamdiskServices)/4
Line 356... Line 369...
356
 
369
 
357
fs_OnFloppy:
370
fs_OnFloppy:
358
        cmp     ecx, 2
371
        cmp     ecx, 2
Line 378... Line 391...
378
        dd      fs_FloppyRewrite
391
        dd      fs_FloppyRewrite
379
        dd      fs_FloppyWrite
392
        dd      fs_FloppyWrite
380
        dd      fs_FloppySetFileEnd
393
        dd      fs_FloppySetFileEnd
381
        dd      fs_FloppyGetFileInfo
394
        dd      fs_FloppyGetFileInfo
382
        dd      fs_FloppySetFileInfo
395
        dd      fs_FloppySetFileInfo
383
        dd      fs_FloppyExecute
396
        dd      0 ;fs_FloppyExecute
-
 
397
        dd      fs_FloppyDelete
-
 
398
        dd      fs_FloppyCreateFolder
384
fs_NumFloppyServices = ($ - fs_FloppyServices)/4
399
fs_NumFloppyServices = ($ - fs_FloppyServices)/4
Line 385... Line 400...
385
 
400
 
386
fs_OnHd0:
401
fs_OnHd0:
387
        call    reserve_hd1
402
        call    reserve_hd1
Line 449... Line 464...
449
        dd      fs_HdRewrite
464
        dd      fs_HdRewrite
450
        dd      fs_HdWrite
465
        dd      fs_HdWrite
451
        dd      fs_HdSetFileEnd
466
        dd      fs_HdSetFileEnd
452
        dd      fs_HdGetFileInfo
467
        dd      fs_HdGetFileInfo
453
        dd      fs_HdSetFileInfo
468
        dd      fs_HdSetFileInfo
454
        dd      fs_HdExecute
469
        dd      0 ;fs_HdExecute
-
 
470
        dd      fs_HdDelete
-
 
471
        dd      fs_HdCreateFolder
455
fs_NumHdServices = ($ - fs_HdServices)/4
472
fs_NumHdServices = ($ - fs_HdServices)/4
Line 456... Line 473...
456
 
473
 
457
;*******************************************************
474
;*******************************************************
458
fs_OnCd0:
475
fs_OnCd0:
Line 533... Line 550...
533
fs_HasRamdisk:
550
fs_HasRamdisk:
534
        mov     al, 1   ; we always have ramdisk
551
        mov     al, 1   ; we always have ramdisk
535
        ret
552
        ret
Line 536... Line 553...
536
 
553
 
537
fs_HasFloppy:
554
fs_HasFloppy:
538
        cmp     byte [0x40000], 0
555
        cmp     byte [DRIVE_DATA], 0
539
        setnz   al
556
        setnz   al
Line 540... Line 557...
540
        ret
557
        ret
541
 
558
 
542
fs_HasHd0:
559
fs_HasHd0:
543
        mov     al, [0x40001]
560
        mov     al, [DRIVE_DATA+1]
544
        and     al, 11000000b
561
        and     al, 11000000b
545
        cmp     al, 01000000b
562
        cmp     al, 01000000b
546
        setz    al
563
        setz    al
547
        ret
564
        ret
548
fs_HasHd1:
565
fs_HasHd1:
549
        mov     al, [0x40001]
566
        mov     al, [DRIVE_DATA+1]
550
        and     al, 00110000b
567
        and     al, 00110000b
551
        cmp     al, 00010000b
568
        cmp     al, 00010000b
552
        setz    al
569
        setz    al
553
        ret
570
        ret
554
fs_HasHd2:
571
fs_HasHd2:
555
        mov     al, [0x40001]
572
        mov     al, [DRIVE_DATA+1]
556
        and     al, 00001100b
573
        and     al, 00001100b
557
        cmp     al, 00000100b
574
        cmp     al, 00000100b
558
        setz    al
575
        setz    al
559
        ret
576
        ret
560
fs_HasHd3:
577
fs_HasHd3:
561
        mov     al, [0x40001]
578
        mov     al, [DRIVE_DATA+1]
562
        and     al, 00000011b
579
        and     al, 00000011b
563
        cmp     al, 00000001b
580
        cmp     al, 00000001b
Line 564... Line 581...
564
        setz    al
581
        setz    al
565
        ret
582
        ret
566
 
583
 
567
;*******************************************************
584
;*******************************************************
568
fs_HasCd0:
585
fs_HasCd0:
569
        mov     al, [0x40001]
586
        mov     al, [DRIVE_DATA+1]
570
        and     al, 11000000b
587
        and     al, 11000000b
571
        cmp     al, 10000000b
588
        cmp     al, 10000000b
572
        setz    al
589
        setz    al
573
        ret
590
        ret
574
fs_HasCd1:
591
fs_HasCd1:
575
        mov     al, [0x40001]
592
        mov     al, [DRIVE_DATA+1]
576
        and     al, 00110000b
593
        and     al, 00110000b
577
        cmp     al, 00100000b
594
        cmp     al, 00100000b
578
        setz    al
595
        setz    al
579
        ret
596
        ret
580
fs_HasCd2:
597
fs_HasCd2:
581
        mov     al, [0x40001]
598
        mov     al, [DRIVE_DATA+1]
582
        and     al, 00001100b
599
        and     al, 00001100b
583
        cmp     al, 00001000b
600
        cmp     al, 00001000b
584
        setz    al
601
        setz    al
585
        ret
602
        ret
586
fs_HasCd3:
603
fs_HasCd3:
587
        mov     al, [0x40001]
604
        mov     al, [DRIVE_DATA+1]
588
        and     al, 00000011b
605
        and     al, 00000011b
589
        cmp     al, 00000010b
606
        cmp     al, 00000010b
Line 605... Line 622...
605
        clc
622
        clc
606
@@:
623
@@:
607
        ret
624
        ret
Line 608... Line 625...
608
 
625
 
609
fs_NextFloppy:
626
fs_NextFloppy:
610
; we have /fd/1 iff (([0x40000] and 0xF0) != 0) and /fd/2 iff (([0x40000] and 0x0F) != 0)
627
; we have /fd/1 iff (([DRIVE_DATA] and 0xF0) != 0) and /fd/2 iff (([DRIVE_DATA] and 0x0F) != 0)
611
        test    byte [0x40000], 0xF0
628
        test    byte [DRIVE_DATA], 0xF0
612
        jz      .no1
629
        jz      .no1
613
        test    eax, eax
630
        test    eax, eax
614
        jnz     .no1
631
        jnz     .no1
615
        inc     eax
632
        inc     eax
616
        ret     ; CF cleared
633
        ret     ; CF cleared
617
.no1:
634
.no1:
618
        test    byte [0x40000], 0x0F
635
        test    byte [DRIVE_DATA], 0x0F
619
        jz      .no2
636
        jz      .no2
620
        cmp     al, 2
637
        cmp     al, 2
621
        jae     .no2
638
        jae     .no2
622
        mov     al, 2
639
        mov     al, 2
Line 638... Line 655...
638
        jmp     fs_NextHd
655
        jmp     fs_NextHd
639
fs_NextHd3:
656
fs_NextHd3:
640
        push    3
657
        push    3
641
fs_NextHd:
658
fs_NextHd:
642
        pop     ecx
659
        pop     ecx
643
        movzx   ecx, byte [0x40002+ecx]
660
        movzx   ecx, byte [DRIVE_DATA+2+ecx]
644
        cmp     eax, ecx
661
        cmp     eax, ecx
645
        jae     fs_NextFloppy.no2
662
        jae     fs_NextFloppy.no2
646
        inc     eax
663
        inc     eax
647
        clc
664
        clc
648
        ret
665
        ret