Rev 212 | Rev 221 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 212 | Rev 214 | ||
---|---|---|---|
Line 392... | Line 392... | ||
392 | ; btr [cpu_caps], CAPS_FXSR ;test: disable sse support |
392 | ; btr [cpu_caps], CAPS_FXSR ;test: disable sse support |
393 | ;all sse commands rise #UD exption |
393 | ;all sse commands rise #UD exption |
394 | ; btr [cpu_caps], CAPS_PSE ;test: don't use large pages |
394 | ; btr [cpu_caps], CAPS_PSE ;test: don't use large pages |
395 | ; btr [cpu_caps], CAPS_PGE ;test: don't use global pages |
395 | ; btr [cpu_caps], CAPS_PGE ;test: don't use global pages |
396 | ; btr [cpu_caps], CAPS_MTRR ;test: don't use MTRR |
396 | ; btr [cpu_caps], CAPS_MTRR ;test: don't use MTRR |
397 | ; btr [cpu_caps], CAPS_TSC ;test: don't use TSC |
397 | ; bts [cpu_caps], CAPS_TSC ;test: don't use TSC |
Line 398... | Line 398... | ||
398 | 398 | ||
399 | call init_memEx |
399 | call init_memEx |
Line 400... | Line 400... | ||
400 | call init_page_map |
400 | call init_page_map |
401 | 401 | ||
Line 402... | Line 402... | ||
402 | mov eax, sys_pgdir ;+PG_NOCACHE |
402 | mov eax, sys_pgdir |
403 | mov cr3, eax |
403 | mov cr3, eax |
404 | 404 | ||
Line 405... | Line 405... | ||
405 | mov eax,cr0 |
405 | mov eax,cr0 |
406 | or eax,CR0_PG |
406 | or eax,CR0_PG |
407 | mov cr0,eax |
407 | mov cr0,eax |
- | 408 | ||
Line 408... | Line 409... | ||
408 | 409 | call init_kernel_heap |
|
409 | call init_kernel_heap |
410 | call init_LFB |
410 | call init_LFB |
411 | call init_mtrr |
Line 445... | Line 446... | ||
445 | mov edi, eax |
446 | mov edi, eax |
446 | mov esi, szKernel |
447 | mov esi, szKernel |
447 | mov ecx, 16 |
448 | mov ecx, 16 |
448 | rep movsb |
449 | rep movsb |
Line 449... | Line -... | ||
449 | - | ||
450 | clts |
- | |
451 | fninit |
- | |
452 | - | ||
453 | bt [cpu_caps], CAPS_FXSR |
- | |
454 | jnc .no_FXSR |
- | |
455 | - | ||
456 | stdcall kernel_alloc, 512*256 |
- | |
457 | mov [fpu_data], eax |
- | |
458 | - | ||
459 | mov ebx, cr4 |
- | |
460 | mov ecx, cr0 |
- | |
461 | or ebx, CR4_OSFXSR+CR4_OSXMMEXPT |
- | |
462 | mov cr4, ebx |
- | |
463 | - | ||
464 | and ecx, not (CR0_MP+CR0_EM) |
- | |
465 | or ecx, CR0_NE |
- | |
466 | mov cr0, ecx |
- | |
467 | - | ||
468 | mov dword [esp-4], SSE_INIT |
- | |
469 | ldmxcsr [esp-4] |
- | |
470 | - | ||
471 | xorps xmm0, xmm0 |
- | |
472 | xorps xmm1, xmm1 |
- | |
473 | xorps xmm2, xmm2 |
- | |
474 | xorps xmm3, xmm3 |
- | |
475 | xorps xmm4, xmm4 |
- | |
476 | xorps xmm5, xmm5 |
- | |
477 | xorps xmm6, xmm6 |
- | |
478 | xorps xmm7, xmm7 |
- | |
479 | - | ||
480 | jmp .set_cr |
- | |
481 | .no_FXSR: |
- | |
482 | stdcall kernel_alloc, 112*256 |
- | |
483 | mov [fpu_data], eax |
- | |
484 | mov ebx, cr4 |
- | |
485 | mov ecx, cr0 |
- | |
486 | and ebx, not (CR4_OSFXSR+CR4_OSXMMEXPT) |
- | |
487 | and ecx, not CR0_EM |
- | |
488 | or ecx, CR0_MP+CR0_NE |
- | |
489 | mov cr0, ecx |
- | |
490 | mov cr4, ebx |
- | |
491 | .set_cr: |
450 | |
492 | mov edi, irq_tab |
451 | mov edi, irq_tab |
493 | xor eax, eax |
452 | xor eax, eax |
494 | mov ecx, 16 |
453 | mov ecx, 16 |
Line 565... | Line 524... | ||
565 | 524 | ||
Line 566... | Line 525... | ||
566 | call build_scheduler ; sys32.inc |
525 | call build_scheduler ; sys32.inc |
567 | 526 | ||
568 | ; LOAD IDT |
- | |
569 | lidt [cs:idtreg] |
- | |
570 | - | ||
571 | ;The CPU to this moment should be already in PM, |
- | |
572 | ;and bit MP of the register cr0 should be installed in 1. |
- | |
573 | ;finit ;reset of the FPU (finit, instead of fninit) |
- | |
574 | ;fsetpm ;enable PM of the FPU |
- | |
575 | ;finit ;reset the registers, contents which are still equal RM |
527 | ; LOAD IDT |
Line 576... | Line 528... | ||
576 | ;Now FPU too in PM |
528 | lidt [cs:idtreg] |
577 | ; DETECT DEVICES |
529 | cli |
578 | 530 | ||
Line 595... | Line 547... | ||
595 | 547 | ||
596 | mov esi,boot_setmouse |
548 | mov esi,boot_setmouse |
597 | call boot_log |
549 | call boot_log |
Line -... | Line 550... | ||
- | 550 | call setmouse |
|
- | 551 | ||
- | 552 | mov [pci_access_enabled],1 |
|
598 | call setmouse |
553 | stdcall get_service, szHMouse |
Line 599... | Line 554... | ||
599 | 554 | ||
600 | ; SET PRELIMINARY WINDOW STACK AND POSITIONS |
555 | ; SET PRELIMINARY WINDOW STACK AND POSITIONS |
601 | 556 | ||
Line 623... | Line 578... | ||
623 | 578 | ||
Line 624... | Line 579... | ||
624 | ; SET UP OS TASK |
579 | ; SET UP OS TASK |
625 | 580 | ||
626 | mov esi,boot_setostask |
- | |
627 | call boot_log |
- | |
628 | ; name for OS/IDLE process |
- | |
- | 581 | mov esi,boot_setostask |
|
629 | mov dword [0x80000+256+APPDATA.app_name], dword 'OS/I' |
582 | call boot_log |
630 | mov dword [0x80000+256+APPDATA.app_name+4], dword 'DLE ' |
583 | |
631 | mov eax, [fpu_data] |
584 | mov eax, [fpu_data] |
632 | mov dword [0x80000+APPDATA.fpu_state], eax |
585 | mov dword [0x80000+APPDATA.fpu_state], eax |
Line -... | Line 586... | ||
- | 586 | mov dword [0x80000+APPDATA.fpu_handler], 0 |
|
- | 587 | mov dword [0x80000+APPDATA.sse_handler], 0 |
|
- | 588 | ||
- | 589 | ; name for OS/IDLE process |
|
- | 590 | mov dword [0x80000+256+APPDATA.app_name], dword 'OS/I' |
|
- | 591 | mov dword [0x80000+256+APPDATA.app_name+4], dword 'DLE ' |
|
- | 592 | mov dword [0x80000+256+APPDATA.fpu_handler], 0 |
|
633 | mov dword [0x80000+APPDATA.fpu_handler], 0 |
593 | mov dword [0x80000+256+APPDATA.sse_handler], 0 |
634 | mov dword [0x80000+APPDATA.sse_handler], 0 |
594 | |
635 | 595 | ;set fpu save area |
|
- | 596 | mov esi, eax |
|
- | 597 | bt [cpu_caps], CAPS_FXSR |
|
- | 598 | jnc .no_sse |
|
636 | add eax, 112 |
599 | |
- | 600 | lea edi, [eax+512] |
|
637 | bt [cpu_caps], CAPS_FXSR |
601 | mov dword [0x80000+256+APPDATA.fpu_state], edi |
638 | jnc .no_sse |
602 | mov ecx, 512/4 |
639 | add eax, 512-112 |
603 | jmp @F |
640 | .no_sse: |
604 | .no_sse: |
- | 605 | lea edi, [eax+112] |
|
- | 606 | mov dword [0x80000+256+APPDATA.fpu_state], edi |
|
- | 607 | mov ecx, 112/4 |
|
641 | mov dword [0x80000+256+APPDATA.fpu_state], eax |
608 | @@: |
642 | mov dword [0x80000+256+APPDATA.fpu_handler], 0 |
609 | rep movsd |
643 | mov dword [0x80000+256+APPDATA.sse_handler], 0 |
610 | |
644 | ; task list |
611 | ; task list |
Line 1948... | Line 1915... | ||
1948 | ret |
1915 | ret |
Line 1949... | Line 1916... | ||
1949 | 1916 | ||
1950 | sysfn_shutdown: ; 18.1 = BOOT |
1917 | sysfn_shutdown: ; 18.1 = BOOT |
1951 | mov [0x2f0000+0x9030],byte 0 |
1918 | mov [0x2f0000+0x9030],byte 0 |
- | 1919 | for_shutdown_parameter: |
|
- | 1920 | ||
- | 1921 | call stop_all_services |
|
1952 | for_shutdown_parameter: |
1922 | |
1953 | mov eax,[0x3004] |
1923 | mov eax,[0x3004] |
1954 | add eax,2 |
1924 | add eax,2 |
1955 | mov [shutdown_processes],eax |
1925 | mov [shutdown_processes],eax |
1956 | mov [0xFF00],al |
1926 | mov [0xFF00],al |
Line 3784... | Line 3754... | ||
3784 | 3754 | ||
Line 3785... | Line 3755... | ||
3785 | popad |
3755 | popad |
Line 3786... | Line -... | ||
3786 | - | ||
3787 | ret |
- | |
3788 | - | ||
3789 | - | ||
3790 | 3756 | ||
Line 3791... | Line 3757... | ||
3791 | 3757 | ret |
|
3792 | 3758 | ||
3793 | r_f_port_area: |
3759 | r_f_port_area: |
Line 3873... | Line 3839... | ||
3873 | mov [edi+8],ecx |
3839 | mov [edi+8],ecx |
Line 3874... | Line 3840... | ||
3874 | 3840 | ||
3875 | xor eax, eax |
3841 | xor eax, eax |
Line 3876... | Line -... | ||
3876 | ret |
- | |
3877 | - | ||
3878 | - | ||
3879 | 3842 | ret |
|
Line 3880... | Line 3843... | ||
3880 | 3843 | ||
Line 3881... | Line 3844... | ||
3881 | free_port_area: |
3844 | free_port_area: |
Line 3980... | Line 3943... | ||
3980 | dec ecx |
3943 | dec ecx |
3981 | ril1: |
3944 | ril1: |
3982 | mov [esp+36],ecx ; return in eax |
3945 | mov [esp+36],ecx ; return in eax |
3983 | ret |
3946 | ret |
Line 3984... | Line -... | ||
3984 | - | ||
3985 | - | ||
3986 | 3947 | ||
3987 | drawbackground: |
3948 | drawbackground: |
3988 | inc [mouse_pause] |
3949 | inc [mouse_pause] |
3989 | cmp [0xfe0c],word 0x12 |
3950 | cmp [0xfe0c],word 0x12 |
3990 | je dbrv20 |
3951 | je dbrv20 |
Line 4297... | Line 4258... | ||
4297 | ret_rdtsc: |
4258 | ret_rdtsc: |
4298 | mov edx,0xffffffff |
4259 | mov edx,0xffffffff |
4299 | mov eax,0xffffffff |
4260 | mov eax,0xffffffff |
4300 | ret |
4261 | ret |
Line 4301... | Line -... | ||
4301 | - | ||
4302 | - | ||
4303 | 4262 | ||
Line 4304... | Line 4263... | ||
4304 | rerouteirqs: |
4263 | rerouteirqs: |
Line 4305... | Line 4264... | ||
4305 | 4264 | ||
Line 5032... | Line 4991... | ||
5032 | 4991 | ||
5033 | buttontype dd 0x0 |
4992 | buttontype dd 0x0 |
Line 5034... | Line 4993... | ||
5034 | windowtypechanged dd 0x0 |
4993 | windowtypechanged dd 0x0 |
- | 4994 | ||
5035 | 4995 | align 4 |
|
5036 | align 4 |
4996 | cpu_caps dd 4 dup(0) |
5037 | pg_data PG_DATA |
- | |
5038 | heap_test dd ? |
4997 | pg_data PG_DATA |
Line 5039... | Line 4998... | ||
5039 | cpu_caps dd 4 dup(0) |
4998 | heap_test dd ? |
5040 | endg |
4999 | endg |
5041 | 5000 |