Rev 7122 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7122 | Rev 7132 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2009-2017. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2009-2017. 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: 7122 $ |
8 | $Revision: 7132 $ |
9 | 9 | ||
Line 15... | Line 15... | ||
15 | ; first call to fn E820 |
15 | ; first call to fn E820 |
16 | mov eax, 0xE820 |
16 | mov eax, 0xE820 |
17 | xor ebx, ebx |
17 | xor ebx, ebx |
18 | mov es, bx |
18 | mov es, bx |
19 | mov ds, bx |
19 | mov ds, bx |
20 | mov di, BOOT_MEMMAP_BLOCKS |
20 | mov di, BOOT_LO.memmap_blocks |
21 | mov [BOOT_MEMMAP_BLOCK_CNT], ebx ; no blocks yet |
21 | mov [BOOT_LO.memmap_block_cnt], ebx ; no blocks yet |
22 | mov ecx, 20 |
22 | mov ecx, 20 |
23 | mov edx, 'PAMS' ; 'SMAP' |
23 | mov edx, 'PAMS' ; 'SMAP' |
24 | int 15h |
24 | int 15h |
25 | jc no_E820 |
25 | jc no_E820 |
26 | cmp eax, 'PAMS' |
26 | cmp eax, 'PAMS' |
27 | jnz no_E820 |
27 | jnz no_E820 |
28 | e820_mem_loop: |
28 | e820_mem_loop: |
29 | ; cmp byte [di+16], 1 ; ignore non-free areas |
29 | ; cmp byte [di+16], 1 ; ignore non-free areas |
30 | ; jnz e820_mem_next |
30 | ; jnz e820_mem_next |
31 | inc byte [BOOT_MEMMAP_BLOCK_CNT] |
31 | inc byte [BOOT_LO.memmap_block_cnt] |
32 | add di, sizeof.e820entry |
32 | add di, sizeof.e820entry |
33 | e820_mem_next: |
33 | e820_mem_next: |
34 | ; consequent calls to fn E820 |
34 | ; consequent calls to fn E820 |
35 | test ebx, ebx |
35 | test ebx, ebx |
36 | jz e820_test_done |
36 | jz e820_test_done |
37 | cmp byte [BOOT_MEMMAP_BLOCK_CNT], MAX_MEMMAP_BLOCKS |
37 | cmp byte [BOOT_LO.memmap_block_cnt], MAX_MEMMAP_BLOCKS |
38 | jz e820_test_done |
38 | jz e820_test_done |
39 | mov eax, 0xE820 |
39 | mov eax, 0xE820 |
40 | int 15h |
40 | int 15h |
41 | jc e820_test_done |
41 | jc e820_test_done |
42 | jmp e820_mem_loop |
42 | jmp e820_mem_loop |