Subversion Repositories Kolibri OS

Rev

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

Rev 1599 Rev 1687
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2009. 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: 1599 $
8
$Revision: 1687 $
9
 
9
 
Line 335... Line 335...
335
	   ret
335
	   ret
336
endp
336
endp
Line 337... Line 337...
337
 
337
 
338
align 4
338
align 4
339
proc init_LFB
-
 
340
;           cmp dword [LFBAddress], -1
-
 
341
;           jne @f
-
 
342
;
-
 
343
;        mov     esi, boot_framebuf
-
 
344
;        call    boot_log
-
 
345
;
-
 
346
;           mov [BOOT_VAR+0x901c],byte 2
-
 
347
;           stdcall alloc_pages, (0x280000 / 4096)
-
 
348
;
-
 
349
;           push eax
-
 
350
;           call alloc_page
-
 
351
;           stdcall map_page_table, LFB_BASE, eax
-
 
352
;           pop eax
-
 
353
;           or eax, PG_UW
-
 
354
;           mov ebx, LFB_BASE
-
 
355
;           mov ecx, 0x280000 / 4096
-
 
356
;           call commit_pages
-
 
357
;           mov [LFBAddress], dword LFB_BASE
-
 
358
;           ret
-
 
359
;@@:
339
proc init_LFB
Line 360... Line 340...
360
	   call init_mtrr
340
	   call init_mtrr
361
 
341
 
362
	   mov edx, LFB_BASE
342
	   mov edx, LFB_BASE
363
	   mov esi, [LFBAddress]
343
	   mov esi, [LFBAddress]
Line 364... Line 344...
364
	   mov edi, 0x00C00000		     ; 12Mb
344
	   mov edi, 0x00C00000		     ; 12Mb
365
	   mov dword [exp_lfb+4], edx
-
 
366
 
345
	   mov dword [exp_lfb+4], edx
Line 367... Line 346...
367
	   shr edi, 12			     ; C00
346
 
368
;           mov [pg_count], edi
347
	   shr edi, 12			     ; C00
369
	   shr edi, 10			     ; 3
348
	   shr edi, 10			     ; 3
Line 557... Line 536...
557
 
536
 
558
; param
537
; param
559
;  eax= linear address
538
;  eax= linear address
560
;
539
;
561
; retval
540
; retval
Line 562... Line 541...
562
;  eax= phisical page address
541
;  eax= physical page address
563
 
542
 
564
align 4
543
align 4
565
get_pg_addr:
544
get_pg_addr:
Line 687... Line 666...
687
	jz	.fail	;ñòðàíèöà íå ïðèñóòñòâóåò
666
	jz	.fail	;ñòðàíèöà íå ïðèñóòñòâóåò
Line 688... Line 667...
688
 
667
 
689
	test	eax,12	;U/S (+below)
668
	test	eax,12	;U/S (+below)
690
	jnz	.fail	;ïðèëîæåíèå îáðàòèëîñü ê ïàìÿòè
669
	jnz	.fail	;ïðèëîæåíèå îáðàòèëîñü ê ïàìÿòè
691
			;ÿäðà
-
 
692
       ;test    eax, 8
-
 
693
       ;jnz     .fail   ;óñòàíîâëåí çàðåçåðâèðîâàííûé áèò
-
 
Line 694... Line 670...
694
			;â òàáëèöàõ ñòðàíèö. äîáàâëåíî â P4/Xeon
670
			;ÿäðà
695
 
-
 
696
;ïîïûòêà çàïèñè â çàùèù¸ííóþ ñòðàíèöó ÿäðà
671
 
697
 
672
;ïîïûòêà çàïèñè â çàùèù¸ííóþ ñòðàíèöó ÿäðà
Line 698... Line 673...
698
	cmp	ebx, tss._io_map_0
673
	cmp	ebx, tss._io_map_0
699
	jb	.fail
674
	jb	.fail
Line 700... Line 675...
700
 
675
 
701
	cmp	ebx, tss._io_map_0+8192
676
	cmp	ebx, tss._io_map_0+8192
702
	jae	.fail
-
 
703
 
677
	jae	.fail
704
; io permission map
678
 
705
; copy-on-write protection
679
; io permission map
Line 706... Line 680...
706
 
680
; copy-on-write protection
Line 748... Line 722...
748
	   mov edi, [ipc_ptab]
722
	   mov edi, [ipc_ptab]
749
	   mov eax, [esi+ebx*4]
723
	   mov eax, [esi+ebx*4]
750
	   and eax, 0xFFFFF000
724
	   and eax, 0xFFFFF000
751
	   jz .exit
725
	   jz .exit
752
	   stdcall map_page,edi,eax,PG_UW
726
	   stdcall map_page,edi,eax,PG_UW
753
;           inc ebx
-
 
754
;           add edi, 0x1000
-
 
755
;           mov eax, [esi+ebx*4]
-
 
756
;           test eax, eax
-
 
757
;           jz @f
-
 
758
;          and eax, 0xFFFFF000
-
 
759
;           stdcall map_page, edi, eax
-
 
Line 760... Line 727...
760
 
727
 
761
@@:	   mov edi, [lin_addr]
728
	   mov edi, [lin_addr]
762
	   and edi, 0xFFFFF000
729
	   and edi, 0xFFFFF000
763
	   mov ecx, [buf_size]
730
	   mov ecx, [buf_size]
764
	   add ecx, 4095
731
	   add ecx, 4095
765
	   shr ecx, 12
732
	   shr ecx, 12
Line 816... Line 783...
816
	   and eax, 0xFFFFF000
783
	   and eax, 0xFFFFF000
817
	   test eax, eax
784
	   test eax, eax
818
	   jz .exit
785
	   jz .exit
819
	   stdcall map_page,edi,eax,PG_UW
786
	   stdcall map_page,edi,eax,PG_UW
Line 820... Line 787...
820
 
787
 
821
@@:	   mov edi, [lin_addr]
788
	   mov edi, [lin_addr]
822
	   and edi, 0xFFFFF000
789
	   and edi, 0xFFFFF000
823
	   mov ecx, [buf_size]
790
	   mov ecx, [buf_size]
824
	   add ecx, 4095
791
	   add ecx, 4095
825
	   shr ecx, 12
792
	   shr ecx, 12
Line 970... Line 937...
970
@@:
937
@@:
971
	or	eax,-1
938
	or	eax,-1
972
	mov	[esp+32], eax
939
	mov	[esp+32], eax
973
	ret
940
	ret
Line 974... Line -...
974
 
-
 
975
;align 4
-
 
976
;proc set_ipc_buff
-
 
977
 
-
 
978
;           mov  eax,[current_slot]
-
 
979
;           pushf
-
 
980
;           cli
-
 
981
;           mov  [eax+APPDATA.ipc_start],ebx     ;set fields in extended information area
-
 
982
;           mov  [eax+APPDATA.ipc_size],ecx
-
 
983
;
-
 
984
;           add ecx, ebx
-
 
985
;           add ecx, 4095
-
 
986
;           and ecx, not 4095
-
 
987
;
-
 
988
;.touch:    mov eax, [ebx]
-
 
989
;           add ebx, 0x1000
-
 
990
;           cmp ebx, ecx
-
 
991
;           jb  .touch
-
 
992
;
-
 
993
;           popf
-
 
994
;           xor eax, eax
-
 
995
;           ret
-
 
996
;endp
-
 
997
 
941
 
998
proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
942
proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
999
	   locals
943
	   locals
1000
	     dst_slot	dd ?
944
	     dst_slot	dd ?
1001
	     dst_offset dd ?
945
	     dst_offset dd ?