Subversion Repositories Kolibri OS

Rev

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

Rev 840 Rev 841
Line 53... Line 53...
53
;;
53
;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 55... Line 55...
55
 
55
 
Line 56... Line 56...
56
include 'macros.inc'
56
include 'macros.inc'
Line -... Line 57...
-
 
57
 
-
 
58
$Revision: 841 $
57
 
59
 
Line 58... Line 60...
58
$Revision: 840 $
60
 
59
 
61
fastcall equ call
60
 
62
 
Line 318... Line 320...
318
           mov edx, eax
320
           mov edx, eax
319
           mov [pg_data.pages_count], eax
321
           mov [pg_data.pages_count], eax
320
           shr eax, 3
322
           shr eax, 3
321
           and eax, -4
323
           and eax, -4
322
           mov [pg_data.pagemap_size], eax
324
           mov [pg_data.pagemap_size], eax
323
 
-
 
-
 
325
           mov ecx, eax
-
 
326
           fastcall _balloc
324
           ret
327
           ret
Line 325... Line 328...
325
 
328
 
326
align 4
329
align 4
Line 331... Line 334...
331
           shr ecx, 2
334
           shr ecx, 2
332
           or eax, -1
335
           or eax, -1
333
           cld
336
           cld
334
           rep stosd
337
           rep stosd
Line -... Line 338...
-
 
338
 
-
 
339
           xchg bx, bx
335
 
340
 
336
           mov ecx, 0x800000                        ;reserve 8 Mb
341
           mov ecx, [_last_page]
337
           mov edx, [pg_data.pages_count]
342
           mov edx, [pg_data.pages_count]
338
           shr ecx, 12
343
           shr ecx, 12
339
           sub edx, ecx
344
           sub edx, ecx
Line 393... Line 398...
393
 
398
 
Line 394... Line 399...
394
; MEMORY MODEL
399
; MEMORY MODEL
Line -... Line 400...
-
 
400
 
-
 
401
           call init_mem
-
 
402
 
-
 
403
           mov ecx, 1280*1024
-
 
404
           fastcall _balloc
-
 
405
           mov [_display_data], eax
-
 
406
 
-
 
407
           mov ecx, (unpack.LZMA_BASE_SIZE+(unpack.LZMA_LIT_SIZE shl \
-
 
408
                    (unpack.lc+unpack.lp)))*4
-
 
409
           fastcall _balloc
-
 
410
           mov [unpack.p], eax
-
 
411
 
-
 
412
           mov ecx, (RING0_STACK_SIZE+512)
-
 
413
           fastcall _balloc
-
 
414
           mov [os_stack_seg], eax
-
 
415
 
-
 
416
	   lea esp, [eax+RING0_STACK_SIZE]
-
 
417
 
-
 
418
	   mov [tss._ss0], os_stack
-
 
419
	   mov [tss._esp0], esp
-
 
420
	   mov [tss._esp], esp
-
 
421
	   mov [tss._cs],os_code
-
 
422
	   mov [tss._ss],os_stack
-
 
423
	   mov [tss._ds],app_data
-
 
424
	   mov [tss._es],app_data
-
 
425
	   mov [tss._fs],app_data
-
 
426
	   mov [tss._gs],app_data
-
 
427
	   mov [tss._io],128
-
 
428
;Add IO access table - bit array of permitted ports
-
 
429
	   mov edi, tss._io_map_0
-
 
430
	   xor eax, eax
-
 
431
	   not eax
-
 
432
	   mov ecx, 8192/4
-
 
433
	   rep stosd		     ; access to 4096*8=65536 ports
-
 
434
 
-
 
435
	   mov	ax,tss0
-
 
436
	   ltr	ax
395
 
437
 
Line 396... Line 438...
396
           call init_mem
438
           call init_kernel_heap     ; FIXME initialize heap after pager
397
 
439
 
Line 546... Line 588...
546
; LOAD IDT
588
; LOAD IDT
Line 547... Line 589...
547
 
589
 
548
	   call build_interrupt_table
590
	   call build_interrupt_table
Line 549... Line -...
549
	   lidt [idtreg]
-
 
550
 
-
 
551
	   call init_kernel_heap
-
 
552
 
-
 
553
           stdcall alloc_pages, (RING0_STACK_SIZE+512) shr 12
-
 
554
           add eax, OS_BASE
-
 
555
	   mov [os_stack_seg], eax
-
 
556
 
-
 
557
	   lea esp, [eax+RING0_STACK_SIZE]
-
 
558
 
-
 
559
	   mov [tss._ss0], os_stack
-
 
560
	   mov [tss._esp0], esp
-
 
561
	   mov [tss._esp], esp
-
 
562
	   mov [tss._cs],os_code
-
 
563
	   mov [tss._ss],os_stack
-
 
564
	   mov [tss._ds],app_data
-
 
565
	   mov [tss._es],app_data
-
 
566
	   mov [tss._fs],app_data
-
 
567
	   mov [tss._gs],app_data
-
 
568
	   mov [tss._io],128
-
 
569
;Add IO access table - bit array of permitted ports
-
 
570
	   mov edi, tss._io_map_0
-
 
571
	   xor eax, eax
-
 
572
	   not eax
-
 
573
	   mov ecx, 8192/4
-
 
574
	   rep stosd		     ; access to 4096*8=65536 ports
-
 
575
 
-
 
576
	   mov	ax,tss0
-
 
577
	   ltr	ax
591
	   lidt [idtreg]
578
 
592
 
579
	   mov [LFBSize], 0x800000
593
           mov [LFBSize], 0x800000
580
	   call init_LFB
594
	   call init_LFB
Line 607... Line 621...
607
	   mov [ipc_pdir], eax
621
	   mov [ipc_pdir], eax
Line 608... Line 622...
608
 
622
 
609
	   add eax, ebx
623
	   add eax, ebx
Line 610... Line -...
610
	   mov [ipc_ptab], eax
-
 
611
 
-
 
612
           stdcall alloc_pages, (1280*1024)/4096
-
 
613
           add eax, OS_BASE
-
 
614
           mov [_display_data], eax
-
 
615
 
-
 
616
	   stdcall kernel_alloc, (unpack.LZMA_BASE_SIZE+(unpack.LZMA_LIT_SIZE shl \
-
 
617
				 (unpack.lc+unpack.lp)))*4
-
 
618
 
-
 
619
	   mov [unpack.p], eax
624
	   mov [ipc_ptab], eax
620
 
625
 
621
	   call init_events
626
	   call init_events
622
	   mov eax, srv.fd-SRV_FD_OFFSET
627
	   mov eax, srv.fd-SRV_FD_OFFSET
Line 936... Line 941...
936
      @@:
941
@@:
937
	in     al,64h
942
	in     al,64h
938
	and    al,00000010b
943
	and    al,00000010b
939
	loopnz @b
944
	loopnz @b
Line 940... Line -...
940
 
-
 
941
       ; mov   al, 0xED       ; svetodiody - only for testing!
-
 
942
       ; call  kb_write
-
 
943
       ; call  kb_read
-
 
944
       ; mov   al, 111b
-
 
945
       ; call  kb_write
-
 
946
       ; call  kb_read
-
 
947
 
945
 
948
	mov   al, 0xF3	     ; set repeat rate & delay
946
	mov   al, 0xF3	     ; set repeat rate & delay
949
	call  kb_write
947
	call  kb_write
950
;        call  kb_read
948
;        call  kb_read
951
	mov   al, 0 ; 30 250 ;00100010b ; 24 500  ;00100100b  ; 20 500
949
	mov   al, 0 ; 30 250 ;00100010b ; 24 500  ;00100100b  ; 20 500