Subversion Repositories Kolibri OS

Rev

Rev 839 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
750 victor 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
593 mikedld 7
 
465 serge 8
$Revision: 847 $
9
 
593 mikedld 10
 
465 serge 11
 
12
 
13
align 4
837 serge 14
 
586 serge 15
init_BIOS32:
16
           mov edi, 0xE0000
17
.pcibios_nxt:
18
           cmp dword[edi], '_32_' ; "magic" word
19
           je .BIOS32_found
20
.pcibios_nxt2:
21
           add edi, 0x10
22
           cmp edi, 0xFFFF0
23
           je .BIOS32_not_found
24
           jmp .pcibios_nxt
25
.BIOS32_found:			; magic word found, check control summ
26
 
27
           movzx ecx, byte[edi + 9]
28
           shl ecx, 4
29
           mov esi, edi
30
           xor eax, eax
31
           cld   ; paranoia
32
@@:	lodsb
33
           add ah, al
34
           loop @b
35
           jnz .pcibios_nxt2 ; control summ must be zero
36
    ; BIOS32 service found !
37
           mov ebp, [edi + 4]
38
           mov [bios32_entry], ebp
39
    ; check PCI BIOS present
40
           mov eax, '$PCI'
41
           xor ebx, ebx
42
           push cs  ; special for 'ret far' from  BIOS
43
           call ebp
44
           test al, al
45
           jnz .PCI_BIOS32_not_found
46
 
47
 ; здесь создаются дискрипторы для PCI BIOS
48
 
49
           add ebx, OS_BASE
50
           dec ecx
51
           mov [(pci_code_32-OS_BASE)], cx    ;limit 0-15
52
           mov [(pci_data_32-OS_BASE)], cx    ;limit 0-15
53
 
54
           mov [(pci_code_32-OS_BASE)+2], bx  ;base  0-15
55
           mov [(pci_data_32-OS_BASE)+2], bx  ;base  0-15
56
 
57
           shr ebx, 16
58
           mov [(pci_code_32-OS_BASE)+4], bl  ;base  16-23
59
           mov [(pci_data_32-OS_BASE)+4], bl  ;base  16-23
60
 
61
           shr ecx, 16
62
           and cl, 0x0F
63
           mov ch, bh
64
           add cx, D32
65
           mov [(pci_code_32-OS_BASE)+6], cx  ;lim   16-19 &
66
           mov [(pci_data_32-OS_BASE)+6], cx  ;base  24-31
67
 
68
           mov [(pci_bios_entry-OS_BASE)], edx
69
         ; jmp .end
70
.PCI_BIOS32_not_found:
71
	; здесь должна заполнятся pci_emu_dat
72
.BIOS32_not_found:
73
.end:
837 serge 74
           ret
586 serge 75