Subversion Repositories Kolibri OS

Rev

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

Rev 5049 Rev 5130
Line 69... Line 69...
69
format binary as "mnt"
69
format binary as "mnt"
Line 70... Line 70...
70
 
70
 
71
include 'macros.inc'
71
include 'macros.inc'
Line 72... Line 72...
72
include 'struct.inc'
72
include 'struct.inc'
Line 73... Line 73...
73
 
73
 
74
$Revision: 5049 $
74
$Revision: 5130 $
Line 289... Line 289...
289
        call    init_mem
289
        call    init_mem
290
        call    init_page_map
290
        call    init_page_map
Line 291... Line 291...
291
 
291
 
Line 292... Line 292...
292
; ENABLE PAGING
292
; ENABLE PAGING
293
 
293
 
Line 294... Line 294...
294
        mov     eax, sys_pgdir-OS_BASE
294
        mov     eax, sys_proc-OS_BASE+PROC.pdt_0
295
        mov     cr3, eax
295
        mov     cr3, eax
296
 
296
 
Line 352... Line 352...
352
        mov     gs, bx
352
        mov     gs, bx
Line 353... Line 353...
353
 
353
 
354
        bt      [cpu_caps], CAPS_PGE
354
        bt      [cpu_caps], CAPS_PGE
Line 355... Line 355...
355
        jnc     @F
355
        jnc     @F
Line 356... Line 356...
356
 
356
 
357
        or      dword [sys_pgdir+(OS_BASE shr 20)], PG_GLOBAL
357
        or      dword [sys_proc+PROC.pdt_0+(OS_BASE shr 20)], PG_GLOBAL
358
 
358
 
359
        mov     ebx, cr4
359
        mov     ebx, cr4
360
        or      ebx, CR4_PGE
360
        or      ebx, CR4_PGE
361
        mov     cr4, ebx
361
        mov     cr4, ebx
362
@@:
362
@@:
Line 363... Line 363...
363
        xor     eax, eax
363
        xor     eax, eax
364
        mov     dword [sys_pgdir], eax
364
        mov     dword [sys_proc+PROC.pdt_0], eax
Line 365... Line 365...
365
        mov     dword [sys_pgdir+4], eax
365
        mov     dword [sys_proc+PROC.pdt_0+4], eax
Line 595... Line 595...
595
        mov     [LFBSize], 0xC00000
595
        mov     [LFBSize], 0xC00000
596
        call    init_LFB
596
        call    init_LFB
597
        call    init_fpu
597
        call    init_fpu
598
        call    init_malloc
598
        call    init_malloc
Line 599... Line 599...
599
 
599
 
600
        stdcall alloc_kernel_space, 0x51000
600
        stdcall alloc_kernel_space, 0x50000         ; FIXME check size
Line 601... Line 601...
601
        mov     [default_io_map], eax
601
        mov     [default_io_map], eax
602
 
602
 
603
        add     eax, 0x2000
603
        add     eax, 0x2000
Line 612... Line 612...
612
 
612
 
613
        add     eax, ebx
613
        add     eax, ebx
Line 614... Line 614...
614
        mov     [proc_mem_tab], eax
614
        mov     [proc_mem_tab], eax
615
 
-
 
616
        add     eax, ebx
-
 
617
        mov     [tmp_task_pdir], eax
-
 
618
 
615
 
Line 619... Line 616...
619
        add     eax, ebx
616
        add     eax, ebx
620
        mov     [tmp_task_ptab], eax
617
        mov     [tmp_task_ptab], eax
Line 672... Line 669...
672
; SET UP OS TASK
669
; SET UP OS TASK
Line 673... Line 670...
673
 
670
 
674
        mov     esi, boot_setostask
671
        mov     esi, boot_setostask
Line -... Line 672...
-
 
672
        call    boot_log
-
 
673
 
-
 
674
        mov     edi, sys_proc
-
 
675
        list_init edi
-
 
676
        lea     ecx, [edi+PROC.thr_list]
-
 
677
        list_init ecx
-
 
678
        mov     [edi+PROC.pdt_0_phys], sys_proc-OS_BASE+PROC.pdt_0
-
 
679
 
-
 
680
        mov     eax, -1
-
 
681
        mov     edi, thr_slot_map+4
-
 
682
        mov     [edi-4], dword 0xFFFFFFF8
-
 
683
        stosd
-
 
684
        stosd
-
 
685
        stosd
-
 
686
        stosd
-
 
687
        stosd
-
 
688
        stosd
-
 
689
        stosd
-
 
690
 
675
        call    boot_log
691
        mov     [current_process], sys_proc
676
 
692
 
677
        mov     edx, SLOT_BASE+256
693
        mov     edx, SLOT_BASE+256*1
678
        mov     ebx, [os_stack_seg]
694
        mov     ebx, [os_stack_seg]
679
        add     ebx, 0x2000
695
        add     ebx, 0x2000
680
        call    setup_os_slot
696
        call    setup_os_slot
Line 1125... Line 1141...
1125
        mov     ds, bx
1141
        mov     ds, bx
1126
        mov     es, bx
1142
        mov     es, bx
1127
        mov     fs, cx
1143
        mov     fs, cx
1128
        mov     gs, bx
1144
        mov     gs, bx
1129
        xor     esp, esp
1145
        xor     esp, esp
1130
        mov     eax, sys_pgdir-OS_BASE
1146
        mov     eax, sys_proc-OS_BASE+PROC.pdt_0
1131
        mov     cr3, eax
1147
        mov     cr3, eax
1132
        lock inc [ap_initialized]
1148
        lock inc [ap_initialized]
1133
        jmp     idle_loop
1149
        jmp     idle_loop
Line 1188... Line 1204...
1188
        mov     dword [edx+APPDATA.fd_obj], eax
1204
        mov     dword [edx+APPDATA.fd_obj], eax
1189
        mov     dword [edx+APPDATA.bk_obj], eax
1205
        mov     dword [edx+APPDATA.bk_obj], eax
Line 1190... Line 1206...
1190
 
1206
 
Line 1191... Line 1207...
1191
        mov     dword [edx+APPDATA.cur_dir], sysdir_path
1207
        mov     dword [edx+APPDATA.cur_dir], sysdir_path
-
 
1208
 
-
 
1209
        mov     [edx + APPDATA.process], sys_proc
-
 
1210
 
-
 
1211
        lea     ebx, [edx+APPDATA.list]
Line 1192... Line 1212...
1192
 
1212
        lea     ecx, [sys_proc+PROC.thr_list]
1193
        mov     [edx + APPDATA.dir_table], sys_pgdir - OS_BASE
1213
        list_add_tail ebx, ecx
1194
 
1214
 
1195
        mov     eax, edx
1215
        mov     eax, edx
Line 2068... Line 2088...
2068
        mov     eax, [def_cursor]
2088
        mov     eax, [def_cursor]
2069
        mov     [ecx+APPDATA.cursor], eax
2089
        mov     [ecx+APPDATA.cursor], eax
Line 2070... Line 2090...
2070
 
2090
 
2071
        movzx   eax, word [MOUSE_Y]
2091
        movzx   eax, word [MOUSE_Y]
2072
        movzx   ebx, word [MOUSE_X]
-
 
2073
;        mov     ecx, [Screen_Max_X]
-
 
2074
;        inc     ecx
-
 
2075
;        mul     ecx
2092
        movzx   ebx, word [MOUSE_X]
Line 2076... Line 2093...
2076
        mov     eax, [d_width_calc_area + eax*4]
2093
        mov     eax, [d_width_calc_area + eax*4]
2077
 
2094
 
2078
        add     eax, [_WinMapAddress]
2095
        add     eax, [_WinMapAddress]
Line 3085... Line 3102...
3085
        lea     edi, [ebx+12]
3102
        lea     edi, [ebx+12]
3086
        xor     eax, eax
3103
        xor     eax, eax
3087
        mov     edx, 0x100000*16
3104
        mov     edx, 0x100000*16
3088
        cmp     ecx, 1 shl 5
3105
        cmp     ecx, 1 shl 5
3089
        je      .os_mem
3106
        je      .os_mem
3090
        mov     edx, [SLOT_BASE+ecx*8+APPDATA.mem_size]
3107
        mov     edx, [SLOT_BASE+ecx*8+APPDATA.process]
-
 
3108
        mov     edx, [edx+PROC.mem_used]
3091
        mov     eax, std_application_base_address
3109
        mov     eax, std_application_base_address
3092
.os_mem:
3110
.os_mem:
3093
        stosd
3111
        stosd
3094
        lea     eax, [edx-1]
3112
        lea     eax, [edx-1]
3095
        stosd
3113
        stosd
Line 3389... Line 3407...
3389
        mov     [esp+32], eax
3407
        mov     [esp+32], eax
3390
        ret
3408
        ret
3391
;---------------------------------------------------------------------------------------------
3409
;---------------------------------------------------------------------------------------------
Line 3392... Line -...
3392
 
-
 
3393
 
-
 
3394
; check if pixel is allowed to be drawn
-
 
3395
 
-
 
3396
;checkpixel:
-
 
3397
;        push    eax edx
-
 
3398
 
-
 
3399
;;        mov     edx, [Screen_Max_X] ; screen x size
-
 
3400
;;        inc     edx
-
 
3401
;;        imul    edx, ebx
-
 
3402
;        mov     edx, [d_width_calc_area + ebx*4]
-
 
3403
;        add     eax, [_WinMapAddress]
-
 
3404
;        mov     dl, [eax+edx]; lea eax, [...]
-
 
3405
 
-
 
3406
;        xor     ecx, ecx
-
 
3407
;        mov     eax, [CURRENT_TASK]
-
 
3408
;        cmp     al, dl
-
 
3409
;        setne   cl
-
 
3410
 
-
 
3411
;        pop     edx eax
-
 
3412
;        ret
3410
 
3413
 
3411
 
3414
iglobal
3412
iglobal
Line 3415... Line 3413...
3415
  cpustring db 'CPU',0
3413
  cpustring db 'CPU',0
Line 3577... Line 3575...
3577
markz:
3575
markz:
3578
        push    ecx edx
3576
        push    ecx edx
3579
        cmp     [edx+TASKDATA.state], 9
3577
        cmp     [edx+TASKDATA.state], 9
3580
        jz      .nokill
3578
        jz      .nokill
3581
        lea     edx, [(edx-(CURRENT_TASK and 1FFFFFFFh))*8+SLOT_BASE]
3579
        lea     edx, [(edx-(CURRENT_TASK and 1FFFFFFFh))*8+SLOT_BASE]
3582
        cmp     [edx+APPDATA.dir_table], sys_pgdir - OS_BASE
3580
        cmp     [edx+APPDATA.process], sys_proc
3583
        jz      .nokill
3581
        jz      .nokill
3584
        call    request_terminate
3582
        call    request_terminate
3585
        jmp     .common
3583
        jmp     .common
3586
.nokill:
3584
.nokill:
3587
        dec     byte [SYS_SHUTDOWN]
3585
        dec     byte [SYS_SHUTDOWN]