Subversion Repositories Kolibri OS

Rev

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

Rev 3626 Rev 3725
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: 3626 $
74
$Revision: 3725 $
Line 356... Line 356...
356
 
356
 
357
        mov     ecx, application_table_mutex
357
        mov     ecx, application_table_mutex
Line 358... Line 358...
358
        call    mutex_init
358
        call    mutex_init
-
 
359
 
-
 
360
; SAVE REAL MODE VARIABLES
-
 
361
        xor     eax, eax
359
 
362
        mov     ax, [BOOT_VAR + BOOT_IDE_PI_16]
360
; SAVE REAL MODE VARIABLES
363
        mov     [IDEContrProgrammingInterface], ax
-
 
364
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
-
 
365
        mov     [IDEContrRegsBaseAddr], ax
-
 
366
        mov     ax, [BOOT_VAR + BOOT_IDE_BAR0_16]
-
 
367
        mov     [IDE_BAR0_val], ax
-
 
368
 
-
 
369
        cmp     ax, 0
-
 
370
        je      @f
-
 
371
 
-
 
372
        cmp     ax, 1
-
 
373
        je      @f
-
 
374
 
-
 
375
        and     ax, 0xfff0
-
 
376
        mov     [StandardATABases], ax
-
 
377
        mov     [hd_address_table], eax
-
 
378
        mov     [hd_address_table+8], eax
-
 
379
@@:
-
 
380
        mov     ax, [BOOT_VAR + BOOT_IDE_BAR1_16]
-
 
381
        mov     [IDE_BAR1_val], ax
-
 
382
        mov     ax, [BOOT_VAR + BOOT_IDE_BAR2_16]
-
 
383
        mov     [IDE_BAR2_val], ax
-
 
384
 
-
 
385
        cmp     ax, 0
-
 
386
        je      @f
-
 
387
 
-
 
388
        cmp     ax, 1
-
 
389
        je      @f
-
 
390
 
-
 
391
        and     ax, 0xfff0
-
 
392
        mov     [StandardATABases+2], ax
-
 
393
        mov     [hd_address_table+16], eax
-
 
394
        mov     [hd_address_table+24], eax
-
 
395
@@:
-
 
396
        mov     ax, [BOOT_VAR + BOOT_IDE_BAR3_16]
361
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
397
        mov     [IDE_BAR3_val], ax
Line 362... Line 398...
362
        mov     [IDEContrRegsBaseAddr], ax
398
 
363
; --------------- APM ---------------------
399
; --------------- APM ---------------------
364
 
400
 
Line 1012... Line 1048...
1012
        jnz     @F
1048
        jnz     @F
1013
        mov     al, 1                             ; at least one CPU
1049
        mov     al, 1                             ; at least one CPU
1014
@@:
1050
@@:
1015
        DEBUGF  1, "K : %d CPU detected\n", eax
1051
        DEBUGF  1, "K : %d CPU detected\n", eax
Line -... Line 1052...
-
 
1052
 
-
 
1053
        DEBUGF  1, "K : BAR0 %x \n", [IDE_BAR0_val]:4
-
 
1054
        DEBUGF  1, "K : BAR1 %x \n", [IDE_BAR1_val]:4
-
 
1055
        DEBUGF  1, "K : BAR2 %x \n", [IDE_BAR2_val]:4
-
 
1056
        DEBUGF  1, "K : BAR3 %x \n", [IDE_BAR3_val]:4
-
 
1057
        DEBUGF  1, "K : BAR4 %x \n", [IDEContrRegsBaseAddr]:4
1016
 
1058
        DEBUGF  1, "K : IDEContrProgrammingInterface %x \n", [IDEContrProgrammingInterface]:4
Line 1017... Line 1059...
1017
; START MULTITASKING
1059
; START MULTITASKING
1018
 
1060
 
1019
; A 'All set - press ESC to start' messages if need
1061
; A 'All set - press ESC to start' messages if need
Line 1026... Line 1068...
1026
        jne     .bll1
1068
        jne     .bll1
1027
end if
1069
end if
Line 1028... Line 1070...
1028
 
1070
 
1029
        cmp     [IDEContrRegsBaseAddr], 0
1071
        cmp     [IDEContrRegsBaseAddr], 0
-
 
1072
        setnz   [dma_hdd]
-
 
1073
 
-
 
1074
        cmp     [dma_hdd], 0
-
 
1075
        je      .print_pio
-
 
1076
.print_dma:
-
 
1077
        DEBUGF  1, "K : IDE DMA mode\n"
-
 
1078
        jmp     .continue
-
 
1079
 
-
 
1080
.print_pio:
-
 
1081
        DEBUGF  1, "K : IDE PIO mode\n"
-
 
1082
.continue:
1030
        setnz   [dma_hdd]
1083
 
Line 1031... Line 1084...
1031
        mov     [timer_ticks_enable], 1         ; for cd driver
1084
        mov     [timer_ticks_enable], 1         ; for cd driver
1032
 
1085
 
Line 1583... Line 1636...
1583
        ja      nosesl
1636
        ja      nosesl
1584
        mov     [cd_base], cl
1637
        mov     [cd_base], cl
Line 1585... Line 1638...
1585
 
1638
 
1586
        dec     ecx
1639
        dec     ecx
-
 
1640
        jnz     noprma
1587
        jnz     noprma
1641
        mov     eax, [hd_address_table]
1588
        mov     [cdbase], 0x1f0
1642
        mov     [cdbase], eax    ;0x1f0
1589
        mov     [cdid], 0xa0
1643
        mov     [cdid], 0xa0
Line 1590... Line 1644...
1590
   noprma:
1644
noprma:
1591
 
1645
 
-
 
1646
        dec     ecx
1592
        dec     ecx
1647
        jnz     noprsl
1593
        jnz     noprsl
1648
        mov     eax, [hd_address_table]
1594
        mov     [cdbase], 0x1f0
1649
        mov     [cdbase], eax   ;0x1f0
1595
        mov     [cdid], 0xb0
1650
        mov     [cdid], 0xb0
1596
   noprsl:
1651
noprsl:
-
 
1652
        dec     ecx
1597
        dec     ecx
1653
        jnz     nosema
1598
        jnz     nosema
1654
        mov     eax, [hd_address_table+16]
1599
        mov     [cdbase], 0x170
1655
        mov     [cdbase], eax   ;0x170
1600
        mov     [cdid], 0xa0
1656
        mov     [cdid], 0xa0
1601
   nosema:
1657
nosema:
-
 
1658
        dec     ecx
1602
        dec     ecx
1659
        jnz     nosesl
1603
        jnz     nosesl
1660
        mov     eax, [hd_address_table+16]
1604
        mov     [cdbase], 0x170
1661
        mov     [cdbase], eax    ;0x170
1605
        mov     [cdid], 0xb0
1662
        mov     [cdid], 0xb0
Line 1606... Line 1663...
1606
   nosesl:
1663
nosesl:
Line 1628... Line 1685...
1628
        ja      nosethd
1685
        ja      nosethd
1629
        mov     [hd_base], cl
1686
        mov     [hd_base], cl
Line 1630... Line 1687...
1630
 
1687
 
1631
        cmp     ecx, 1
1688
        cmp     ecx, 1
-
 
1689
        jnz     noprmahd
1632
        jnz     noprmahd
1690
        mov     eax, [hd_address_table]
1633
        mov     [hdbase], 0x1f0
1691
        mov     [hdbase], eax    ;0x1f0
1634
        and     dword [hdid], 0x0
1692
        and     dword [hdid], 0x0
1635
        mov     dword [hdpos], ecx
1693
        mov     dword [hdpos], ecx
1636
;     call set_FAT32_variables
1694
;     call set_FAT32_variables
Line 1637... Line 1695...
1637
   noprmahd:
1695
   noprmahd:
1638
 
1696
 
-
 
1697
        cmp     ecx, 2
1639
        cmp     ecx, 2
1698
        jnz     noprslhd
1640
        jnz     noprslhd
1699
        mov     eax, [hd_address_table]
1641
        mov     [hdbase], 0x1f0
1700
        mov     [hdbase], eax  ;0x1f0
1642
        mov     [hdid], 0x10
1701
        mov     [hdid], 0x10
1643
        mov     dword [hdpos], ecx
1702
        mov     dword [hdpos], ecx
Line 1644... Line 1703...
1644
;     call set_FAT32_variables
1703
;     call set_FAT32_variables
1645
   noprslhd:
1704
   noprslhd:
-
 
1705
 
1646
 
1706
        cmp     ecx, 3
1647
        cmp     ecx, 3
1707
        jnz     nosemahd
1648
        jnz     nosemahd
1708
        mov     eax, [hd_address_table+16]
1649
        mov     [hdbase], 0x170
1709
        mov     [hdbase], eax	;0x170
1650
        and     dword [hdid], 0x0
1710
        and     dword [hdid], 0x0
Line 1651... Line 1711...
1651
        mov     dword [hdpos], ecx
1711
        mov     dword [hdpos], ecx
1652
;     call set_FAT32_variables
1712
;     call set_FAT32_variables
-
 
1713
   nosemahd:
1653
   nosemahd:
1714
 
1654
 
1715
        cmp     ecx, 4
1655
        cmp     ecx, 4
1716
        jnz     noseslhd
1656
        jnz     noseslhd
1717
	mov	eax,[hd_address_table+16]
1657
        mov     [hdbase], 0x170
1718
        mov     [hdbase], eax	;0x170
1658
        mov     [hdid], 0x10
1719
        mov     [hdid], 0x10
Line 5407... Line 5468...
5407
align 4
5468
align 4
5408
calculate_fast_getting_offset_for_WinMapAddress:
5469
calculate_fast_getting_offset_for_WinMapAddress:
5409
; calculate data area for fast getting offset to _WinMapAddress
5470
; calculate data area for fast getting offset to _WinMapAddress
5410
        xor     eax, eax
5471
        xor     eax, eax
5411
        mov     ecx, [_display.height]
5472
        mov     ecx, [_display.height]
5412
        inc     ecx
-
 
5413
        mov     edi, d_width_calc_area
5473
        mov     edi, d_width_calc_area
5414
        cld
5474
        cld
5415
@@:
5475
@@:
5416
        stosd
5476
        stosd
5417
        add     eax, [_display.width]
5477
        add     eax, [_display.width]
Line 5422... Line 5482...
5422
align 4
5482
align 4
5423
calculate_fast_getting_offset_for_LFB:
5483
calculate_fast_getting_offset_for_LFB:
5424
; calculate data area for fast getting offset to LFB
5484
; calculate data area for fast getting offset to LFB
5425
        xor     eax, eax
5485
        xor     eax, eax
5426
        mov     ecx, [_display.height]
5486
        mov     ecx, [_display.height]
5427
        inc     ecx
-
 
5428
        mov     edi, BPSLine_calc_area
5487
        mov     edi, BPSLine_calc_area
5429
        cld
5488
        cld
5430
@@:
5489
@@:
5431
        stosd
5490
        stosd
5432
        add     eax, [_display.pitch]
5491
        add     eax, [_display.pitch]
Line 5814... Line 5873...
5814
 
5873
 
Line 5815... Line 5874...
5815
include "data32.inc"
5874
include "data32.inc"
Line 5816... Line -...
5816
 
-
 
5817
__REV__ = __REV
5875
 
5818
 
5876
__REV__ = __REV
5819
uglobals_size = $ - endofcode
5877