Subversion Repositories Kolibri OS

Rev

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

Rev 129 Rev 133
Line 33... Line 33...
33
 
33
 
Line 34... Line 34...
34
file_system:
34
file_system:
35
 
35
 
36
; IN:
36
; IN:
37
;
37
;
38
; eax = 0  ; read file          /RamDisk/First  6   /HardDisk/First 30
38
; eax = 0  ; read file          /RamDisk/First  6
39
; eax = 1  ; write file         /RamDisk/First 33   /HardDisk/First 56
-
 
40
; eax = 2  ; delete file        /RamDisk/First 32   /HardDisk/First 57
39
; eax = 1  ; write file         /RamDisk/First 33   /HardDisk/First 56
41
; eax = 3  ; append to a file   /RamDisk/First ??   /HardDisk/First ??
40
; eax = 2  ; delete file        /RamDisk/First 32
42
; eax = 4  ; makedir
41
; eax = 4  ; makedir
43
; eax = 5  ; rename file/directory
42
; eax = 5  ; rename file/directory
44
; eax = 8  ; lba read
43
; eax = 8  ; lba read
Line 101... Line 100...
101
 
100
 
102
    cmp   dword [0x3000],1      ; no memory checks for kernel requests
101
    cmp   dword [0x3000],1      ; no memory checks for kernel requests
103
    jz    no_checks_for_kernel
102
    jz    no_checks_for_kernel
104
    mov   edx,eax
103
    mov   edx,eax
105
    cmp   dword [eax+0],1
-
 
106
    jz    .check_for_write_op
-
 
107
    cmp   dword [eax+0],3
104
    cmp   dword [eax+0],1
108
    jnz   .usual_check
-
 
109
.check_for_write_op:    
105
    jnz   .usual_check
110
    mov   ebx,[eax+12]
106
    mov   ebx,[eax+12]
111
    add   ebx,std_application_base_address
107
    add   ebx,std_application_base_address
112
    mov   ecx,[eax+8]
108
    mov   ecx,[eax+8]
113
    call  check_region
109
    call  check_region
Line 137... Line 133...
137
    jz    .error_output
133
    jz    .error_output
138
  area_in_app_mem:
134
  area_in_app_mem:
139
    mov   eax,edx
135
    mov   eax,edx
140
  no_checks_for_kernel:
136
  no_checks_for_kernel:
Line 141... Line -...
141
 
-
 
142
 
-
 
143
    cmp   dword [eax+0],3       ; APPEND - allow write 0 bytes (truncate)
-
 
144
    je    fs_read
-
 
145
    cmp   dword [eax+8],0       ; read or write 0 blocks/bytes ?
-
 
146
    jne   fs_read
-
 
147
    and   dword [esp+36],0
-
 
148
    ret
137
 
Line 149... Line 138...
149
  fs_read:
138
  fs_read:
150
 
139
 
151
    mov   ebx,[eax+20]          ; program wants root directory ?
140
    mov   ebx,[eax+20]          ; program wants root directory ?
Line 600... Line 589...
600
 
589
 
Line 601... Line 590...
601
    jmp   file_system_return
590
    jmp   file_system_return
Line 602... Line -...
602
 
-
 
603
  fs_noharddisk_delete:
-
 
604
 
-
 
605
    cmp   dword [esp+20],3      ; APPEND
-
 
606
    jne   fs_noharddisk_append
-
 
607
 
-
 
608
    mov   eax,[esp+0]           ; /dirname or /filename
-
 
609
    mov   byte [eax],0          ; path to asciiz
-
 
610
    inc   eax                   ; filename start
-
 
611
    mov   edx,[esp+4]
-
 
612
    add   edx,12*2              ; path start
-
 
613
    mov   ecx,[esp+8]           ; buffer
-
 
614
    mov   ebx,[esp+12]          ; count to write
-
 
615
    mov   esi,[esp+16]          ; bytes to skip over
-
 
616
 
-
 
617
    call  file_append
-
 
618
 
-
 
619
    mov   edi,[esp+0]
-
 
620
    mov   byte [edi],'/'
-
 
621
 
-
 
622
    jmp   file_system_return
-
 
623
 
591
 
624
  fs_noharddisk_append:
592
  fs_noharddisk_delete:
Line 625... Line 593...
625
 
593
 
626
    cmp   dword [esp+20],4      ; MAKEDIR
594
    cmp   dword [esp+20],4      ; MAKEDIR