Subversion Repositories Kolibri OS

Rev

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

Rev 889 Rev 928
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: 889 $
14
$Revision: 928 $
15
 
15
 
16
align 4
16
align 4
17
_init_idt:
17
init_idt:
18
           push edi
18
           push edi
19
           push esi
19
           push esi
Line 20... Line 20...
20
           mov edi, idts
20
           mov edi, idts
21
           mov dword [idtreg+2], edi
21
           mov dword [idtreg+2], edi
22
 
22
 
23
           mov esi, sys_int
23
           mov esi, sys_int
24
           mov ecx, 0x40
24
           mov ecx, 0x40
25
@@:
25
@@:
26
           lodsd
26
           lodsd
27
           mov [edi],   ax                ; lower part of offset
27
           mov [edi],   ax                ; lower part of offset
28
           mov [edi+2], word os_code      ; segment selector
28
           mov [edi+2], word sel_os_code  ; segment selector
29
           mov ax, word 10001110b shl 8   ; type: interrupt gate
29
           mov ax, word 10001110b shl 8   ; type: interrupt gate
Line 30... Line 30...
30
           mov [edi+4], eax
30
           mov [edi+4], eax
31
           add edi, 8
31
           add edi, 8
32
           loop @b
32
           loop @b
33
 
33
 
34
           mov eax, i40
34
           mov eax, _i40
35
           mov ecx, i40
35
           mov ecx, _i40
36
           and eax, 0x0000FFFF
36
           and eax, 0x0000FFFF
37
           and ecx, 0xFFFF0000
37
           and ecx, 0xFFFF0000
Line -... Line 38...
-
 
38
           or eax, sel_app_code shl 16
-
 
39
           or ecx, (11101111b shl 8)
-
 
40
           mov [edi], eax
-
 
41
           mov [edi+4], ecx
-
 
42
 
-
 
43
           mov eax, i41
-
 
44
           mov ecx, i41
-
 
45
           and eax, 0x0000FFFF
-
 
46
           and ecx, 0xFFFF0000
38
           or eax, os_code shl 16
47
           or eax, sel_os_code shl 16
39
           or ecx, (11101111b shl 8)
48
           or ecx, (11101111b shl 8)
40
           mov [edi], eax
49
           mov [edi+8], eax
41
           mov [edi+4], ecx
50
           mov [edi+12], ecx
Line 42... Line -...
42
 
-
 
43
           lidt [idtreg]
-
 
44
           pop esi
51
 
Line 45... Line 52...
45
           pop edi
52
           lidt [idtreg]
46
           ret
53
           pop esi
Line 73... Line 80...
73
    dd	 irq_serv.irq_8,  irq_serv.irq_9, irq_serv.irq_10
80
    dd	 irq_serv.irq_8,  irq_serv.irq_9, irq_serv.irq_10
74
    dd	 irq_serv.irq_11, irq_serv.irq_12,irqD ,p_irq14,p_irq15
81
    dd	 irq_serv.irq_11, irq_serv.irq_12,irqD ,p_irq14,p_irq15
Line 75... Line 82...
75
 
82
 
Line 76... Line 83...
76
    times 16 dd unknown_interrupt
83
    times 16 dd unknown_interrupt
Line 77... Line 84...
77
 
84
 
78
    dd	 i40
85
    dd   i41
79
 
86
 
Line 80... Line 87...
80
idtreg:
87
idtreg:
Line 81... Line 88...
81
     dw   8*0x41-1
88
     dw   8*0x42-1
Line 116... Line 123...
116
}
123
}
Line 117... Line 124...
117
 
124
 
118
exc_wo_code 0, 2, 3, 4, 5, 6, 9, 15, 18
125
exc_wo_code 0, 2, 3, 4, 5, 6, 9, 15, 18
Line -... Line 126...
-
 
126
exc_w_code 8, 10, 11, 12, 13, 14, 17
119
exc_w_code 8, 10, 11, 12, 13, 14, 17
127
 
120
 
128
align 4
121
exc_c:
129
exc_c:
122
	mov   ax, app_data  ;èñêëþ÷åíèå
130
    mov   ax, sel_app_data  ;èñêëþ÷åíèå
Line 123... Line 131...
123
	mov   ds, ax	    ;çàãðóçèì ïðàâèëüíûå çíà÷åíè
131
    mov   ds, ax            ;çàãðóçèì ïðàâèëüíûå çíà÷åíèÿ'
124
	mov   es, ax	    ;â ðåãèñòðû
132
    mov   es, ax            ;â ðåãèñòðû
125
 
133
 
Line 213... Line 221...
213
    DEBUGF  1, "K : EBP : %x EIP : %x ", [esp - 20 + 0x20], [esp + 4 + 0x20]
221
    DEBUGF  1, "K : EBP : %x EIP : %x ", [esp - 20 + 0x20], [esp + 4 + 0x20]
Line 214... Line 222...
214
 
222
 
215
    mov eax, [esp + 8 + 0x20]
223
    mov eax, [esp + 8 + 0x20]
216
    mov edi, msg_sel_app
224
    mov edi, msg_sel_app
217
    mov ebx, [esp + 16 + 0x20]
225
    mov ebx, [esp + 16 + 0x20]
218
    cmp eax, app_code
226
    cmp eax, sel_app_code
219
    je	@f
227
    je	@f
220
    mov edi, msg_sel_ker
228
    mov edi, msg_sel_ker
221
    mov ebx, [esp - 16 + 0x20]
229
    mov ebx, [esp - 16 + 0x20]
222
@@:
230
@@:
Line 237... Line 245...
237
irqh 2,3,4,5,7,8,9,10,11
245
irqh 2,3,4,5,7,8,9,10,11
Line 238... Line 246...
238
 
246
 
239
 
247
 
240
p_irq6:
248
p_irq6:
241
     save_ring3_context
249
     save_ring3_context
242
     mov   ax, app_data  ;os_data
250
     mov   ax, sel_app_data
243
     mov   ds, ax
251
     mov   ds, ax
244
     mov   es, ax
252
     mov   es, ax
245
     call  fdc_irq
253
     call  fdc_irq
246
     call  ready_for_next_irq
254
     call  ready_for_next_irq
Line 247... Line 255...
247
     restore_ring3_context
255
     restore_ring3_context
248
     iret
256
     iret
249
 
257
 
250
 
258
 
251
p_irq14:
259
p_irq14:
252
	save_ring3_context
260
	save_ring3_context
253
	mov	ax, app_data  ;os_data
261
    mov ax, sel_app_data
254
	mov	ds, ax
262
	mov	ds, ax
255
	mov	es, ax
263
	mov	es, ax
256
	mov	byte [BOOT_VAR + 0x48E], 0xFF
264
	mov	byte [BOOT_VAR + 0x48E], 0xFF
257
	call	[irq14_func]
265
	call	[irq14_func]
258
	call	ready_for_next_irq_1
266
	call	ready_for_next_irq_1
259
	restore_ring3_context
267
	restore_ring3_context
260
	iret
268
	iret
261
p_irq15:
269
p_irq15:
262
	save_ring3_context
270
	save_ring3_context
263
	mov	ax, app_data  ;os_data
271
    mov ax, sel_app_data
264
	mov	ds, ax
272
	mov	ds, ax
Line 282... Line 290...
282
     out   0x20, al
290
     out   0x20, al
283
     ret
291
     ret
Line 284... Line 292...
284
 
292
 
285
irqD:
293
irqD:
286
     save_ring3_context
294
     save_ring3_context
287
     mov   ax, app_data  ;os_data
295
     mov   ax, sel_app_data
288
     mov   ds, ax
296
     mov   ds, ax
Line 289... Line 297...
289
     mov   es, ax
297
     mov   es, ax
290
 
298
 
Line 516... Line 524...
516
.no_SSE:
524
.no_SSE:
517
	   fnclex
525
	   fnclex
518
	   frstor [eax]
526
	   frstor [eax]
519
@@:
527
@@:
Line 520... Line 528...
520
 
528
 
521
    mov   [KEY_COUNT],byte 0	       ; empty keyboard buffer
529
    mov   [KEY_COUNT], 0           ; empty keyboard buffer
Line 522... Line 530...
522
    mov   [BTN_COUNT],byte 0	       ; empty button buffer
530
    mov   [BTN_COUNT], 0           ; empty button buffer
523
 
531
 
524
 
532
 
Line 556... Line 564...
556
	cmp	eax, hotkey_buffer+120*8
564
	cmp	eax, hotkey_buffer+120*8
557
	jb	.loop2
565
	jb	.loop2
Line 558... Line 566...
558
 
566
 
559
    mov   ecx,esi		  ; remove buttons
567
    mov   ecx,esi		  ; remove buttons
560
  bnewba2:
568
  bnewba2:
561
    mov   edi,[BTN_ADDR]
569
    mov   edi,[btn_addr]
562
    mov   eax,edi
570
    mov   eax,edi
563
    cld
571
    cld
564
    movzx ebx,word [edi]
572
    movzx ebx,word [edi]
565
    inc   bx
573
    inc   bx
Line 802... Line 810...
802
    call  calculatescreen
810
    call  calculatescreen
803
    xor   eax, eax
811
    xor   eax, eax
804
    xor   esi, esi
812
    xor   esi, esi
805
    call  redrawscreen
813
    call  redrawscreen
Line 806... Line 814...
806
 
814
 
807
    mov   [MOUSE_BACKGROUND],byte 0  ; no mouse background
815
    mov   [mouse_background], 0  ; no mouse background
Line 808... Line 816...
808
    mov   [DONT_DRAW_MOUSE],byte 0  ; draw mouse
816
    mov   [dont_draw_mouse], 0  ; draw mouse
809
 
817
 
810
    mov   [application_table_status],0
818
    mov   [application_table_status],0
811
    ;mov   esi,process_terminated
819
    ;mov   esi,process_terminated