Rev 5363 | Rev 7132 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5363 | Rev 7122 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2009-2015. 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: 5363 $ |
8 | $Revision: 7122 $ |
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, 0x9104 |
20 | mov di, BOOT_MEMMAP_BLOCKS |
21 | mov [di-4], ebx ; no blocks yet |
21 | mov [BOOT_MEMMAP_BLOCK_CNT], ebx ; no blocks yet |
22 | mov ecx, 20 |
22 | mov ecx, 20 |
23 | mov edx, 0x534D4150 |
23 | mov edx, 'PAMS' ; 'SMAP' |
24 | int 15h |
24 | int 15h |
25 | jc no_E820 |
25 | jc no_E820 |
26 | cmp eax, 0x534D4150 |
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 [0x9100] |
31 | inc byte [BOOT_MEMMAP_BLOCK_CNT] |
32 | add di, 20 |
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 [0x9100], 32 |
37 | cmp byte [BOOT_MEMMAP_BLOCK_CNT], MAX_MEMMAP_BLOCKS |
38 | jae 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 |
43 | no_E820: |
43 | no_E820: |