Subversion Repositories Kolibri OS

Rev

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

Rev 1635 Rev 1638
Line 9... Line 9...
9
;;  Distributed under GPL. See file COPYING for details.        ;;
9
;;  Distributed under GPL. See file COPYING for details.        ;;
10
;;  Copyright 2003 Ville Turjanmaa                              ;;
10
;;  Copyright 2003 Ville Turjanmaa                              ;;
11
;;                                                              ;;
11
;;                                                              ;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 13... Line 13...
13
 
13
 
Line 14... Line 14...
14
$Revision: 1369 $
14
$Revision: 1638 $
15
 
15
 
16
 
16
 
Line 37... Line 37...
37
        dd      e8,e9,e10,e11,e12,e13,page_fault_exc,e15
37
        dd      e8,e9,e10,e11,e12,e13,page_fault_exc,e15
38
        dd      e16, e17,e18, e19
38
        dd      e16, e17,e18, e19
39
        times   12 dd unknown_interrupt ;int_20..int_31
39
        times   12 dd unknown_interrupt ;int_20..int_31
Line 40... Line 40...
40
 
40
 
-
 
41
    ;interrupt handlers addresses (for interrupt gate construction)
41
    ;interrupt handlers addresses (for interrupt gate construction)
42
	; 0x20 .. 0x2F - IRQ handlers
42
        dd      irq0, irq_serv.irq_1, irq_serv.irq_2
43
        dd      irq0, irq_serv.irq_1, irq_serv.irq_2
43
    if  USE_COM_IRQ
44
    if  USE_COM_IRQ
44
        dd      irq_serv.irq_3, irq_serv.irq_4
45
        dd      irq_serv.irq_3, irq_serv.irq_4
45
    else
46
    else
46
        dd      p_irq3, p_irq4 ;??? íåñòûêîâêà
47
        dd      p_irq3, p_irq4 ;??? íåñòûêîâêà
47
    end if
48
    end if
48
        dd      irq_serv.irq_5,  p_irq6,          irq_serv.irq_7
49
        dd      irq_serv.irq_5,  p_irq6,          irq_serv.irq_7
49
        dd      irq_serv.irq_8,  irq_serv.irq_9,  irq_serv.irq_10
50
        dd      irq_serv.irq_8,  irq_serv.irq_9,  irq_serv.irq_10
-
 
51
        dd irq_serv.irq_11, irq_serv.irq_12
-
 
52
	dd irq13
50
        dd      irq_serv.irq_11, irq_serv.irq_12, irqD,p_irq14,p_irq15
53
	dd p_irq14,p_irq15
-
 
54
	; I don`t known how to use IRQ_RESERVE
-
 
55
if IRQ_RESERVE > 16
-
 
56
	dd irq_serv.irq_16
-
 
57
	dd irq_serv.irq_17
-
 
58
	dd irq_serv.irq_18
-
 
59
	dd irq_serv.irq_19
-
 
60
	dd irq_serv.irq_20
-
 
61
	dd irq_serv.irq_21
-
 
62
	dd irq_serv.irq_22
-
 
63
	dd irq_serv.irq_23
Line -... Line 64...
-
 
64
end if
51
        times   16 dd unknown_interrupt ;int_0x30..int_0x3F
65
 
52
 
66
	times 32 - IRQ_RESERVE dd unknown_interrupt
Line 53... Line 67...
53
    ;int_0x40 gate trap (for directly copied)
67
    ;int_0x40 gate trap (for directly copied)
54
        dw      i40 and 0xFFFF, os_code, 11101111b shl 8, i40 shr 16
68
        dw      i40 and 0xFFFF, os_code, 11101111b shl 8, i40 shr 16
Line 120... Line 134...
120
  reg_esp0      equ esp+0x0C
134
  reg_esp0      equ esp+0x0C
121
  reg_ebp       equ esp+0x08
135
  reg_ebp       equ esp+0x08
122
  reg_esi       equ esp+0x04
136
  reg_esi       equ esp+0x04
123
  reg_edi       equ esp+0x00
137
  reg_edi       equ esp+0x00
Line -... Line 138...
-
 
138
 
124
 
139
	mov	ax, app_data	;èñêëþ÷åíèå
125
        Mov     ds,ax,app_data  ; çàãðóçèì ïðàâèëüíûå çíà÷åíèÿ
140
	mov	ds, ax		;çàãðóçèì ïðàâèëüíûå çíà÷åíè
126
        mov     es,ax           ; â ñåãìåíòíûå ðåãèñòðû
141
	mov	es, ax		;â ðåãèñòðû
127
        cld                     ; è ïðèâîäèì DF ê ñòàíäàðòó
142
        cld                     ; è ïðèâîäèì DF ê ñòàíäàðòó
128
        movzx   ebx,bl
143
        movzx   ebx,bl
129
; redirect to V86 manager? (EFLAGS & 0x20000) != 0?
144
; redirect to V86 manager? (EFLAGS & 0x20000) != 0?
130
        test    byte[reg_eflags+2],2
145
        test    byte[reg_eflags+2],2
Line 184... Line 199...
184
        sub     dword[reg_esp3], 8
199
        sub     dword[reg_esp3], 8
185
        mov     edi, [reg_esp3]
200
        mov     edi, [reg_esp3]
186
        stosd
201
        stosd
187
        mov     [edi], ebx
202
        mov     [edi], ebx
188
        restore_ring3_context
203
        restore_ring3_context
-
 
204
; simply return control to interrupted process
189
unknown_interrupt:
205
unknown_interrupt:
190
        iretd
206
        iretd
Line 191... Line 207...
191
 
207
 
-
 
208
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
192
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
209
; bl - error vector
193
show_error_parameters:
210
show_error_parameters:
194
        mov     edx,[TASK_BASE] ;not scratched below
211
        mov     edx,[TASK_BASE] ;not scratched below
195
        DEBUGF  1, "K : Process - forced terminate PID: %x\n", [edx+TASKDATA.pid]
212
        DEBUGF  1, "K : Process - forced terminate PID: %x\n", [edx+TASKDATA.pid]
196
        cmp     bl, 0x08
213
        cmp     bl, 0x08
Line 226... Line 243...
226
  restore  reg_esp0
243
  restore  reg_esp0
227
  restore  reg_ebp
244
  restore  reg_ebp
228
  restore  reg_esi
245
  restore  reg_esi
229
  restore  reg_edi
246
  restore  reg_edi
Line -... Line 247...
-
 
247
 
-
 
248
; IRQ runtime
230
 
249
 
231
; irq1  ->  hid/keyboard.inc
250
; irq1  ->  hid/keyboard.inc
232
macro irqh [num] {
251
macro irqh [num] {
233
  p_irq#num :
252
  p_irq#num :
234
        mov     edi, num
253
        mov     edi, num
235
        jmp     irqhandler
254
        jmp     irqhandler
Line -... Line 255...
-
 
255
}
-
 
256
 
-
 
257
irqh 2,3,4,5,7,8,9,10,11
-
 
258
; I don`t known how to use IRQ_RESERVE
-
 
259
if IRQ_RESERVE > 16
Line 236... Line -...
236
}
-
 
237
 
260
irqh 16, 17, 18, 19, 20, 21, 22, 23
238
 
261
end if
239
 
262
 
240
p_irq6:
263
p_irq6:	; FDC
241
        save_ring3_context
264
        save_ring3_context
242
        mov     ax, app_data  ;os_data
265
        mov     ax, app_data  ;os_data
243
        mov     ds, ax
266
        mov     ds, ax
244
        mov     es, ax
267
        mov     es, ax
245
        mov     edi, 6
268
        mov     edi, 6
246
        cmp     [v86_irqhooks+edi*8], 0
269
        cmp     [v86_irqhooks+edi*8], 0
-
 
270
        jnz     v86_irq2
-
 
271
        call    fdc_irq
247
        jnz     v86_irq2
272
	mov	[check_idle_semaphore], 5
248
        call    fdc_irq
273
	mov	al, 6
Line -... Line 274...
-
 
274
	call	IRQ_EOI
-
 
275
        restore_ring3_context
-
 
276
        iret
-
 
277
 
-
 
278
irq13:	; Math coprocessor
-
 
279
	save_ring3_context
-
 
280
	mov	ax, app_data  ;os_data
-
 
281
	mov	ds, ax
-
 
282
	mov	es, ax
-
 
283
 
-
 
284
	mov	dx, 0xf0
-
 
285
	mov	al, 0
-
 
286
	out	dx, al
-
 
287
 
Line 249... Line 288...
249
        call    ready_for_next_irq
288
	mov	al, 13
250
        restore_ring3_context
289
	call	IRQ_EOI
251
        iret
290
	restore_ring3_context
252
 
291
	iret
253
 
292
 
254
p_irq14:
293
p_irq14: ; HDD
255
        save_ring3_context
294
        save_ring3_context
256
        mov     ax, app_data  ;os_data
295
        mov     ax, app_data  ;os_data
257
        mov     ds, ax
296
        mov     ds, ax
258
        mov     es, ax
297
        mov     es, ax
259
        mov     edi, 14
298
        mov     edi, 14
-
 
299
        cmp     [v86_irqhooks+edi*8], 0
-
 
300
        jnz     v86_irq2
260
        cmp     [v86_irqhooks+edi*8], 0
301
;       mov     byte [BOOT_VAR + 0x48E], 0xFF
261
        jnz     v86_irq2
302
        call    [irq14_func]
-
 
303
	mov	[check_idle_semaphore], 5
262
;       mov     byte [BOOT_VAR + 0x48E], 0xFF
304
	mov	al, 14
263
        call    [irq14_func]
305
	call	IRQ_EOI
264
        call    ready_for_next_irq_1
306
        restore_ring3_context
265
        restore_ring3_context
307
        iret
266
        iret
308
 
267
p_irq15:
309
p_irq15: ; HDD2
268
        save_ring3_context
310
        save_ring3_context
269
        mov     ax, app_data  ;os_data
311
        mov     ax, app_data  ;os_data
270
        mov     ds, ax
312
        mov     ds, ax
271
        mov     es, ax
313
        mov     es, ax
272
        mov     edi, 15
314
        mov     edi, 15
-
 
315
        cmp     [v86_irqhooks+edi*8], 0
-
 
316
        jnz     v86_irq2
273
        cmp     [v86_irqhooks+edi*8], 0
317
;       mov     byte [BOOT_VAR + 0x48E], 0xFF
274
        jnz     v86_irq2
318
        call    [irq15_func]
Line 275... Line 319...
275
;       mov     byte [BOOT_VAR + 0x48E], 0xFF
319
	mov	[check_idle_semaphore], 5
276
        call    [irq15_func]
320
	mov	al, 15
Line 305... Line 349...
305
        out   0x20,al
349
        out   0x20,al
306
        pop   eax
350
        pop   eax
307
        iret
351
        iret
Line 308... Line 352...
308
 
352
 
Line 309... Line 353...
309
 
353
 
Line 310... Line 354...
310
irqh 2,3,4,5,7,8,9,10,11
354
align 4
311
 
355