Subversion Repositories Kolibri OS

Rev

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

Rev 7325 Rev 7327
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. 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: 7325 $
8
$Revision: 7327 $
9
 
9
 
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
;;                                                            ;;
11
;;                                                            ;;
Line 177... Line 177...
177
      dd sys_protocols           ; 76-reserved for new stack
177
      dd sys_protocols           ; 76-reserved for new stack
178
      dd sys_posix               ; posix support
178
      dd sys_posix               ; posix support
179
      dd undefined_syscall       ; 78-free
179
      dd undefined_syscall       ; 78-free
180
      dd undefined_syscall       ; 79-free
180
      dd undefined_syscall       ; 79-free
181
      dd fileSystemUnicode       ; 80-File system interface for different encodings
181
      dd fileSystemUnicode       ; 80-File system interface for different encodings
182
      dd setInt0x40              ; 81-Implementation of the function in the system
-
 
Line 183... Line 182...
183
 
182
 
184
        times 255 - ( ($-servetable2) /4 )  dd undefined_syscall
183
        times 255 - ( ($-servetable2) /4 )  dd undefined_syscall
Line 185... Line 184...
185
      dd sys_end                 ; -1-end application
184
      dd sys_end                 ; -1-end application
186
 
-
 
187
endg
-
 
188
 
-
 
189
; Author Pavel Iakovlev
-
 
190
align 32
-
 
191
callSet0x40:
-
 
192
        shl     eax, 2
-
 
193
        push    dword [memNewFunctionTable + eax]
-
 
194
        pop     dword [tempPointerAlloc]
-
 
195
        mov     eax, dword [memOldFunctionTable + eax]
-
 
196
        call    dword [tempPointerAlloc]
-
 
197
        ret
-
 
198
align 4
-
 
199
setInt0x40:
-
 
200
 
-
 
201
        and     ebx, 0FFh
-
 
202
        shl     ebx, 2
-
 
203
        mov     eax, dword [servetable2 + ebx]
-
 
204
 
-
 
205
        pushad
-
 
206
        sub     esi, edx
-
 
207
        add     esi, 16
-
 
208
        stdcall kernel_alloc, esi
-
 
209
        mov     dword [tempPointerAlloc], eax
-
 
210
        popad
-
 
211
 
-
 
212
        push    ebx
-
 
213
        mov     eax, dword [tempPointerAlloc]
-
 
214
        mov     ebx, eax
-
 
215
        add     eax, esi
-
 
216
        sub     eax, edx
-
 
217
 
-
 
218
        push    edx
-
 
219
        push    ecx
-
 
220
        loopCopyMemory:
-
 
221
 
-
 
222
        mov     cl, byte[edx]
-
 
223
        mov     byte[ebx], cl
-
 
224
        inc     ebx
-
 
225
        inc     edx
-
 
226
        cmp     ebx, eax
-
 
227
        jne     loopCopyMemory
-
 
228
        
-
 
229
        pop     ecx
-
 
230
        pop     edx
-
 
231
        pop     ebx
-
 
232
 
-
 
233
        mov     eax, dword [tempPointerAlloc]  
-
 
234
        mov     esi, dword [servetable2 + ebx]
-
 
235
        cmp     esi, undefined_syscall
-
 
236
        jne     .step1
-
 
237
        sub     ecx, edx
-
 
238
        add     eax, ecx
-
 
239
        mov     dword [servetable2 + ebx], eax
-
 
240
        ret
-
 
241
        .step1:
-
 
242
        mov     dword [memOldFunctionTable + ebx], esi
-
 
243
        sub     ecx, edx
-
 
244
        add     eax, ecx
-
 
245
        mov     dword [memNewFunctionTable + ebx], eax
-
 
246
        mov     dword [servetable2 + ebx], callSet0x40
-
 
247
        ret
-
 
248
        
-
 
249
align 4
-
 
250
tempPointerAlloc dd 0
-
 
251
memOldFunctionTable: times 255 dd 0
-
 
252
memNewFunctionTable: times 255 dd 0
185