Subversion Repositories Kolibri OS

Rev

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

Rev 400 Rev 420
Line 2... Line 2...
2
;;                                                            ;;
2
;;                                                            ;;
3
;;                   SYSTEM CALL ENTRY                        ;;
3
;;                   SYSTEM CALL ENTRY                        ;;
4
;;                                                            ;;
4
;;                                                            ;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 6... Line 6...
6
 
6
 
7
align 32
7
align 16
8
i40:
-
 
9
      push  ds es
8
i40:
10
      pushad
9
      pushad
Line 11... Line 10...
11
      cld
10
      cld
12
 
11
 
13
      mov   ax,word os_data
12
 ;     mov   ax, word app_data
Line 14... Line 13...
14
      mov   ds,ax
13
 ;     mov   ds, ax
15
      mov   es,ax
14
 ;     mov   es, ax
16
 
15
 
17
      ; load all registers in crossed order
16
      ; load all registers in crossed order
Line 26... Line 25...
26
      sti
25
      sti
27
      push  eax
26
      push  eax
28
      and   edi,0xff
27
      and   edi,0xff
29
      call  dword [servetable+edi*4]
28
      call  dword [servetable+edi*4]
30
      pop   eax
29
      pop   eax
31
;      cli
-
 
Line 32... Line 30...
32
 
30
 
33
      popad
-
 
34
      pop   es ds
31
      popad
Line 35... Line 32...
35
      iretd
32
      iretd
36
 
33
 
Line 56... Line 53...
56
     ;   shl     eax, 8
53
     ;   shl     eax, 8
57
     ;   mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
54
     ;   mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
58
     ;   lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
55
     ;   lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
59
     ;   mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
56
     ;   mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
Line 60... Line 57...
60
 
57
 
61
        mov     esp, [ss:CURRENT_TASK]
58
        mov     esp, [CURRENT_TASK]
62
        shl     esp, 8
59
        shl     esp, 8
63
        mov     esp, [ss:SLOT_BASE + esp + APPDATA.pl0_stack]
60
        mov     esp, [SLOT_BASE + esp + APPDATA.pl0_stack]
64
        add     esp, RING0_STACK_SIZE           ; configure ESP
61
        add     esp, RING0_STACK_SIZE           ; configure ESP
65
	sti
62
	sti
66
	;------------------
-
 
67
	push	ds es
63
    ;------------------
68
	pushad
64
	pushad
Line 69... Line 65...
69
	cld
65
	cld
70
 
66
 
71
	mov	ax, word os_data
67
  ;      mov     ax, word app_data
Line 72... Line 68...
72
	mov	ds, ax
68
  ;      mov     ds, ax
73
	mov	es, ax
69
  ;      mov     es, ax
74
 
70
 
75
        mov     eax, ebx
71
        mov     eax, ebx
Line 83... Line 79...
83
	and	edi, 0xff
79
	and	edi, 0xff
84
	call	dword [servetable + edi * 4]
80
	call	dword [servetable + edi * 4]
85
	pop	eax
81
	pop	eax
Line 86... Line 82...
86
 
82
 
87
	popad
-
 
88
	pop	es ds
83
	popad
89
	;------------------
84
	;------------------
90
	mov	edx, [SYSENTER_VAR]		; eip
85
        mov     edx, [SYSENTER_VAR]       ; eip
91
	mov	ecx, [SYSENTER_VAR + 4]	; esp
86
        mov     ecx, [SYSENTER_VAR + 4]   ; esp
Line 107... Line 102...
107
  ;      shl     eax, 8
102
  ;      shl     eax, 8
108
  ;      mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
103
  ;      mov     eax, [ss:SLOT_BASE + eax + APPDATA.pl0_stack]
109
  ;      lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
104
  ;      lea     esp, [eax + RING0_STACK_SIZE]           ; configure ESP
110
  ;      mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
105
  ;      mov     eax, [ss:sysenter_stack - 4]            ; eax - original eax, from app
Line 111... Line 106...
111
 
106
 
112
        mov     esp, [ss:CURRENT_TASK]
107
        mov     esp, [CURRENT_TASK]
113
        shl     esp, 8
108
        shl     esp, 8
114
        mov     esp, [ss:SLOT_BASE + esp + APPDATA.pl0_stack]
109
        mov     esp, [SLOT_BASE + esp + APPDATA.pl0_stack]
Line 115... Line 110...
115
        add     esp, RING0_STACK_SIZE             ; configure ESP
110
        add     esp, RING0_STACK_SIZE             ; configure ESP
116
 
111
 
117
	sti
112
	sti
118
	;------------------
113
	;------------------
119
	push	ds es
114
;        push    ds es
Line 120... Line 115...
120
	pushad
115
	pushad
121
	cld
116
	cld
122
 
117
 
Line 123... Line 118...
123
	mov	ax, word os_data
118
  ;      mov     ax, word app_data
124
	mov	ds, ax
119
  ;      mov     ds, ax
125
	mov	es, ax
120
  ;      mov     es, ax
126
 
121
 
Line 135... Line 130...
135
	and	edi, 0xff
130
	and	edi, 0xff
136
	call	dword [servetable + edi * 4]
131
	call	dword [servetable + edi * 4]
137
	pop	eax
132
	pop	eax
Line 138... Line 133...
138
 
133
 
139
	popad
134
	popad
140
	pop	es ds
135
 ;       pop     es ds
Line 141... Line 136...
141
	;------------------
136
	;------------------
142
 
137
 
143
        cli
138
        cli