Subversion Repositories Kolibri OS

Rev

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

Rev 2441 Rev 2442
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 2441 $
8
$Revision: 2442 $
9
 
9
 
10
 
10
 
Line 43... Line 43...
43
        mov     [BOOT_VAR-OS_BASE + 0x9110], eax
43
        mov     [BOOT_VAR-OS_BASE + 0x9110], eax
44
.ret:
44
.ret:
45
        ret
45
        ret
46
endp
46
endp
Line -... Line 47...
-
 
47
 
47
 
48
 
48
align 4
49
align 4
-
 
50
proc init_mem
-
 
51
 
-
 
52
        xchg bx, bx
49
proc init_mem
53
 
50
; calculate maximum allocatable address and number of allocatable pages
54
; calculate maximum allocatable address and number of allocatable pages
51
        mov     edi, BOOT_VAR-OS_BASE + 0x9104
55
        mov     edi, BOOT_VAR-OS_BASE + 0x9104
52
        mov     ecx, [edi-4]
56
        mov     ecx, [edi-4]
53
        xor     esi, esi; esi will hold total amount of memory
57
        xor     esi, esi; esi will hold total amount of memory
54
        xor     edx, edx; edx will hold maximum allocatable address
58
        xor     edx, edx; edx will hold maximum allocatable address
55
.calcmax:
59
.calcmax:
56
; round all to pages
60
; round all to pages
-
 
61
        mov     eax, [edi]
-
 
62
        cmp     [edi+16], byte 1
-
 
63
        jne      .unusable
57
        mov     eax, [edi]
64
 
58
        test    eax, 0xFFF
65
        test    eax, 0xFFF
59
        jz      @f
66
        jz      @f
60
        neg     eax
67
        neg     eax
61
        and     eax, 0xFFF
68
        and     eax, 0xFFF