Subversion Repositories Kolibri OS

Rev

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

Rev 3627 Rev 3702
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: 3627 $
74
$Revision: 3702 $
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
	cmp	ax,1
-
 
372
	je	@f
-
 
373
	and 	ax,0xfff0
-
 
374
	mov	[StandardATABases],ax
-
 
375
	mov	[hd_address_table],eax
-
 
376
	mov	[hd_address_table+8],eax
-
 
377
@@:
-
 
378
	mov     ax, [BOOT_VAR + BOOT_IDE_BAR1_16]
-
 
379
        mov     [IDE_BAR1_val], ax
-
 
380
        mov     ax, [BOOT_VAR + BOOT_IDE_BAR2_16]
-
 
381
        mov     [IDE_BAR2_val], ax
-
 
382
 
-
 
383
	cmp	ax,0
-
 
384
	je	@f
-
 
385
	cmp	ax,1
-
 
386
	je	@f
-
 
387
	and 	ax,0xfff0
-
 
388
	mov	[StandardATABases+2],ax
-
 
389
	mov	[hd_address_table+16],eax
-
 
390
	mov	[hd_address_table+24],eax
-
 
391
@@:
-
 
392
        mov     ax, [BOOT_VAR + BOOT_IDE_BAR3_16]
361
        mov     ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR]
393
        mov     [IDE_BAR3_val], ax
Line 362... Line 394...
362
        mov     [IDEContrRegsBaseAddr], ax
394
	
363
; --------------- APM ---------------------
395
; --------------- APM ---------------------
364
 
396
 
Line 1012... Line 1044...
1012
        jnz     @F
1044
        jnz     @F
1013
        mov     al, 1                             ; at least one CPU
1045
        mov     al, 1                             ; at least one CPU
1014
@@:
1046
@@:
1015
        DEBUGF  1, "K : %d CPU detected\n", eax
1047
        DEBUGF  1, "K : %d CPU detected\n", eax
Line -... Line 1048...
-
 
1048
 
-
 
1049
	movzx	eax,[IDE_BAR0_val]
-
 
1050
        DEBUGF  1, "K : BAR0 %x \n", eax
-
 
1051
	movzx	eax,[IDE_BAR1_val]
-
 
1052
        DEBUGF  1, "K : BAR1 %x \n", eax
-
 
1053
	movzx	eax,[IDE_BAR2_val]
-
 
1054
        DEBUGF  1, "K : BAR2 %x \n", eax
-
 
1055
	movzx	eax,[IDE_BAR3_val]
-
 
1056
        DEBUGF  1, "K : BAR3 %x \n", eax
-
 
1057
	movzx	eax,[IDEContrRegsBaseAddr]
-
 
1058
        DEBUGF  1, "K : BAR4 %x \n", eax
-
 
1059
	movzx	eax,[IDEContrProgrammingInterface]
1016
 
1060
        DEBUGF  1, "K : IDEContrProgrammingInterface %x \n", eax
Line 1017... Line 1061...
1017
; START MULTITASKING
1061
; START MULTITASKING
1018
 
1062
 
1019
; A 'All set - press ESC to start' messages if need
1063
; A 'All set - press ESC to start' messages if need
Line 1026... Line 1070...
1026
        jne     .bll1
1070
        jne     .bll1
1027
end if
1071
end if
Line 1028... Line 1072...
1028
 
1072
 
1029
        cmp     [IDEContrRegsBaseAddr], 0
1073
        cmp     [IDEContrRegsBaseAddr], 0
-
 
1074
        setnz   [dma_hdd]
-
 
1075
	
-
 
1076
        cmp     [dma_hdd],0
-
 
1077
        je      .print_pio
-
 
1078
.print_dma:
-
 
1079
        DEBUGF  1, "K : IDE DMA mode\n"
-
 
1080
        jmp     .continue
-
 
1081
	
-
 
1082
.print_pio:
-
 
1083
        DEBUGF  1, "K : IDE PIO mode\n"
-
 
1084
.continue:
1030
        setnz   [dma_hdd]
1085
	
Line 1031... Line 1086...
1031
        mov     [timer_ticks_enable], 1         ; for cd driver
1086
        mov     [timer_ticks_enable], 1         ; for cd driver
1032
 
1087
 
Line 1583... Line 1638...
1583
        ja      nosesl
1638
        ja      nosesl
1584
        mov     [cd_base], cl
1639
        mov     [cd_base], cl
Line 1585... Line 1640...
1585
 
1640
 
1586
        dec     ecx
1641
        dec     ecx
-
 
1642
        jnz     noprma
1587
        jnz     noprma
1643
	mov	eax,[hd_address_table]
1588
        mov     [cdbase], 0x1f0
1644
        mov     [cdbase], eax	;0x1f0
1589
        mov     [cdid], 0xa0
1645
        mov     [cdid], 0xa0
Line 1590... Line 1646...
1590
   noprma:
1646
   noprma:
1591
 
1647
 
-
 
1648
        dec     ecx
1592
        dec     ecx
1649
        jnz     noprsl
1593
        jnz     noprsl
1650
	mov	eax,[hd_address_table]
1594
        mov     [cdbase], 0x1f0
1651
        mov     [cdbase], eax	;0x1f0
1595
        mov     [cdid], 0xb0
1652
        mov     [cdid], 0xb0
1596
   noprsl:
1653
   noprsl:
-
 
1654
        dec     ecx
1597
        dec     ecx
1655
        jnz     nosema
1598
        jnz     nosema
1656
	mov	eax,[hd_address_table+16]
1599
        mov     [cdbase], 0x170
1657
        mov     [cdbase], eax	;0x170
1600
        mov     [cdid], 0xa0
1658
        mov     [cdid], 0xa0
1601
   nosema:
1659
   nosema:
-
 
1660
        dec     ecx
1602
        dec     ecx
1661
        jnz     nosesl
1603
        jnz     nosesl
1662
	mov	eax,[hd_address_table+16]
1604
        mov     [cdbase], 0x170
1663
        mov     [cdbase], eax	;0x170
1605
        mov     [cdid], 0xb0
1664
        mov     [cdid], 0xb0
Line 1606... Line 1665...
1606
   nosesl:
1665
   nosesl:
Line 1628... Line 1687...
1628
        ja      nosethd
1687
        ja      nosethd
1629
        mov     [hd_base], cl
1688
        mov     [hd_base], cl
Line 1630... Line 1689...
1630
 
1689
 
1631
        cmp     ecx, 1
1690
        cmp     ecx, 1
-
 
1691
        jnz     noprmahd
1632
        jnz     noprmahd
1692
	mov	eax,[hd_address_table]	
1633
        mov     [hdbase], 0x1f0
1693
        mov     [hdbase], eax	;0x1f0
1634
        and     dword [hdid], 0x0
1694
        and     dword [hdid], 0x0
1635
        mov     dword [hdpos], ecx
1695
        mov     dword [hdpos], ecx
1636
;     call set_FAT32_variables
1696
;     call set_FAT32_variables
Line 1637... Line 1697...
1637
   noprmahd:
1697
   noprmahd:
1638
 
1698
 
-
 
1699
        cmp     ecx, 2
1639
        cmp     ecx, 2
1700
        jnz     noprslhd
1640
        jnz     noprslhd
1701
	mov	eax,[hd_address_table]
1641
        mov     [hdbase], 0x1f0
1702
        mov     [hdbase], eax	;0x1f0
1642
        mov     [hdid], 0x10
1703
        mov     [hdid], 0x10
1643
        mov     dword [hdpos], ecx
1704
        mov     dword [hdpos], ecx
Line 1644... Line 1705...
1644
;     call set_FAT32_variables
1705
;     call set_FAT32_variables
1645
   noprslhd:
1706
   noprslhd:
-
 
1707
 
1646
 
1708
        cmp     ecx, 3
1647
        cmp     ecx, 3
1709
        jnz     nosemahd
1648
        jnz     nosemahd
1710
	mov	eax,[hd_address_table+16]
1649
        mov     [hdbase], 0x170
1711
        mov     [hdbase], eax	;0x170
1650
        and     dword [hdid], 0x0
1712
        and     dword [hdid], 0x0
Line 1651... Line 1713...
1651
        mov     dword [hdpos], ecx
1713
        mov     dword [hdpos], ecx
1652
;     call set_FAT32_variables
1714
;     call set_FAT32_variables
-
 
1715
   nosemahd:
1653
   nosemahd:
1716
 
1654
 
1717
        cmp     ecx, 4
1655
        cmp     ecx, 4
1718
        jnz     noseslhd
1656
        jnz     noseslhd
1719
	mov	eax,[hd_address_table+16]
1657
        mov     [hdbase], 0x170
1720
        mov     [hdbase], eax	;0x170
1658
        mov     [hdid], 0x10
1721
        mov     [hdid], 0x10