Rev 1638 | Rev 2015 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1638 | Rev 2010 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; |
2 | ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. |
3 | ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. |
4 | ;; PROGRAMMING: |
4 | ;; PROGRAMMING: |
5 | ;; Ivan Poddubny |
5 | ;; Ivan Poddubny |
6 | ;; Marat Zakiyanov (Mario79) |
6 | ;; Marat Zakiyanov (Mario79) |
7 | ;; VaStaNi |
7 | ;; VaStaNi |
8 | ;; Trans |
8 | ;; Trans |
Line 17... | Line 17... | ||
17 | ;; Sergey Semyonov (Serge) |
17 | ;; Sergey Semyonov (Serge) |
18 | ;; Johnny_B |
18 | ;; Johnny_B |
19 | ;; SPraid (simba) |
19 | ;; SPraid (simba) |
20 | ;; Hidnplayr |
20 | ;; Hidnplayr |
21 | ;; Alexey Teplov ( |
21 | ;; Alexey Teplov ( |
- | 22 | ;; Rus |
|
- | 23 | ;; Nable |
|
- | 24 | ;; shurf |
|
- | 25 | ;; Alver |
|
- | 26 | ;; Maxis |
|
- | 27 | ;; Galkov |
|
- | 28 | ;; CleverMouse |
|
- | 29 | ;; tsdima |
|
- | 30 | ;; turbanoff |
|
- | 31 | ;; Asper |
|
- | 32 | ;; art_zh |
|
22 | ;; |
33 | ;; |
23 | ;; Data in this file was originally part of MenuetOS project which is |
34 | ;; Data in this file was originally part of MenuetOS project which is |
24 | ;; distributed under the terms of GNU GPL. It is modified and redistributed as |
35 | ;; distributed under the terms of GNU GPL. It is modified and redistributed as |
25 | ;; part of KolibriOS project under the terms of GNU GPL. |
36 | ;; part of KolibriOS project under the terms of GNU GPL. |
26 | ;; |
37 | ;; |
Line 55... | Line 66... | ||
55 | ;; |
66 | ;; |
56 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 57... | Line 68... | ||
57 | 68 | ||
Line 58... | Line 69... | ||
58 | include 'macros.inc' |
69 | include 'macros.inc' |
Line 59... | Line 70... | ||
59 | 70 | ||
Line 60... | Line 71... | ||
60 | $Revision: 1638 $ |
71 | $Revision: 2010 $ |
Line 218... | Line 229... | ||
218 | mov esp,0x3ec00 ; Set stack |
229 | mov esp,0x3ec00 ; Set stack |
Line 219... | Line 230... | ||
219 | 230 | ||
Line 220... | Line 231... | ||
220 | ; CLEAR 0x280000 - HEAP_BASE |
231 | ; CLEAR 0x280000 - HEAP_BASE |
221 | 232 | ||
222 | xor eax,eax |
233 | xor eax,eax |
223 | mov edi,0x280000 |
234 | mov edi,CLEAN_ZONE |
224 | mov ecx,(HEAP_BASE-OS_BASE-0x280000) / 4 |
235 | mov ecx,(HEAP_BASE-OS_BASE-CLEAN_ZONE) / 4 |
Line 225... | Line 236... | ||
225 | cld |
236 | cld |
226 | rep stosd |
237 | rep stosd |
Line 235... | Line 246... | ||
235 | rep stosd |
246 | rep stosd |
Line 236... | Line 247... | ||
236 | 247 | ||
Line 237... | Line 248... | ||
237 | ; SAVE & CLEAR 0-0xffff |
248 | ; SAVE & CLEAR 0-0xffff |
238 | 249 | ||
239 | xor esi, esi |
250 | xor esi, esi |
240 | mov edi,0x2F0000 |
251 | mov edi,(BOOT_VAR-OS_BASE) |
241 | mov ecx,0x10000 / 4 |
252 | mov ecx,0x10000 / 4 |
242 | rep movsd |
253 | rep movsd |
243 | mov edi,0x1000 |
254 | mov edi,0x1000 |
Line 603... | Line 614... | ||
603 | call APIC_init |
614 | call APIC_init |
Line 604... | Line 615... | ||
604 | 615 | ||
605 | ; Enable timer IRQ (IRQ0) and hard drives IRQs (IRQ14, IRQ15) |
616 | ; Enable timer IRQ (IRQ0) and hard drives IRQs (IRQ14, IRQ15) |
606 | ; they are used: when partitions are scanned, hd_read relies on timer |
617 | ; they are used: when partitions are scanned, hd_read relies on timer |
- | 618 | call unmask_timer |
|
- | 619 | stdcall enable_irq, 12 |
|
607 | call unmask_timer |
620 | stdcall enable_irq, 1 |
608 | stdcall enable_irq, 14 |
621 | stdcall enable_irq, 14 |
Line 609... | Line 622... | ||
609 | stdcall enable_irq, 15 |
622 | stdcall enable_irq, 15 |
610 | 623 | ||
Line 619... | Line 632... | ||
619 | include 'detect/disks.inc' |
632 | include 'detect/disks.inc' |
620 | ;!!!!!!!!!!!!!!!!!!!!!!!!!! |
633 | ;!!!!!!!!!!!!!!!!!!!!!!!!!! |
Line 621... | Line 634... | ||
621 | 634 | ||
Line -... | Line 635... | ||
- | 635 | call Parser_params |
|
- | 636 | ||
622 | call Parser_params |
637 | if ~ defined extended_primary_loader |
Line 623... | Line 638... | ||
623 | 638 | ; ramdisk image should be loaded by extended primary loader if it exists |
|
624 | ; READ RAMDISK IMAGE FROM HD |
639 | ; READ RAMDISK IMAGE FROM HD |
625 | 640 | ||
- | 641 | ;!!!!!!!!!!!!!!!!!!!!!!! |
|
626 | ;!!!!!!!!!!!!!!!!!!!!!!! |
642 | include 'boot/rdload.inc' |
627 | include 'boot/rdload.inc' |
643 | ;!!!!!!!!!!!!!!!!!!!!!!! |
Line 628... | Line 644... | ||
628 | ;!!!!!!!!!!!!!!!!!!!!!!! |
644 | end if |
Line 778... | Line 794... | ||
778 | sub eax,ecx |
794 | sub eax,ecx |
779 | shl eax,2 |
795 | shl eax,2 |
780 | mov [CPU_FREQ],eax ; save tsc / sec |
796 | mov [CPU_FREQ],eax ; save tsc / sec |
781 | ; mov ebx, 1000000 |
797 | ; mov ebx, 1000000 |
782 | ; div ebx |
798 | ; div ebx |
- | 799 | ; ¢®®¡é¥-â® ¯à®¨§¢®¤¨â¥«ì®áâì ¢ ¤ ®¬ ª®ªà¥â®¬ ¬¥á⥠|
|
- | 800 | ; ᮢ¥à襮 ¥ªà¨â¨ç , ® çâ®¡ë § âªãâì «î¡¨â¥«¥© |
|
- | 801 | ; ®¯â¨¬¨§¨àãîé¨å ª®¬¯¨«ïâ®à®¢ ... |
|
783 | mov edx, 2251799814 |
802 | mov edx, 2251799814 |
784 | mul edx |
803 | mul edx |
785 | shr edx, 19 |
804 | shr edx, 19 |
786 | mov [stall_mcs], edx |
805 | mov [stall_mcs], edx |
787 | ; PRINT CPU FREQUENCY |
806 | ; PRINT CPU FREQUENCY |
Line 958... | Line 977... | ||
958 | out dx, al |
977 | out dx, al |
Line 959... | Line 978... | ||
959 | 978 | ||
Line 960... | Line 979... | ||
960 | 979 | ||
Line 961... | Line 980... | ||
961 | end if |
980 | end if |
962 | 981 | ||
963 | ;-=-=-=-=-=-=- START MULTITASKING -=-=-=-=-=-=-=-=- |
982 | ; START MULTITASKING |
964 | 983 | ||
Line 2773... | Line 2792... | ||
2773 | 2792 | ||
2774 | ; Window state |
2793 | ; Window state |
2775 | mov al, [ecx+window_data+WDATA.fl_wstate] |
2794 | mov al, [ecx+window_data+WDATA.fl_wstate] |
Line -... | Line 2795... | ||
- | 2795 | stosb |
|
- | 2796 | ||
- | 2797 | ; Event mask (+71) |
|
- | 2798 | mov EAX, dword [ECX+CURRENT_TASK+TASKDATA.event_mask] |
|
2776 | stosb |
2799 | stosd |
2777 | 2800 | ||
Line 2778... | Line 2801... | ||
2778 | pop esi |
2801 | pop esi |
2779 | pop edi |
2802 | pop edi |
Line 5049... | Line 5072... | ||
5049 | call sys_cd_audio |
5072 | call sys_cd_audio |
Line 5050... | Line 5073... | ||
5050 | 5073 | ||
5051 | yes_shutdown_param: |
5074 | yes_shutdown_param: |
Line -... | Line 5075... | ||
- | 5075 | cli |
|
5052 | cli |
5076 | |
5053 | 5077 | if ~ defined extended_primary_loader |
|
5054 | mov eax, kernel_file ; load kernel.mnt to 0x7000:0 |
5078 | mov eax, kernel_file ; load kernel.mnt to 0x7000:0 |
5055 | push 12 |
5079 | push 12 |
5056 | pop esi |
5080 | pop esi |
Line 5061... | Line 5085... | ||
5061 | 5085 | ||
5062 | mov esi, restart_kernel_4000+OS_BASE+0x10000 ; move kernel re-starter to 0x4000:0 |
5086 | mov esi, restart_kernel_4000+OS_BASE+0x10000 ; move kernel re-starter to 0x4000:0 |
5063 | mov edi,OS_BASE+0x40000 |
5087 | mov edi,OS_BASE+0x40000 |
5064 | mov ecx,1000 |
5088 | mov ecx,1000 |
- | 5089 | rep movsb |
|
Line 5065... | Line 5090... | ||
5065 | rep movsb |
5090 | end if |
5066 | 5091 | ||
5067 | mov esi,OS_BASE+0x2F0000 ; restore 0x0 - 0xffff |
5092 | mov esi, BOOT_VAR ; restore 0x0 - 0xffff |
5068 | mov edi, OS_BASE |
5093 | mov edi, OS_BASE |
5069 | mov ecx,0x10000/4 |
5094 | mov ecx,0x10000/4 |