Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1197 → Rev 1198

/kernel/branches/net/detect/biosmem.inc
0,0 → 1,43
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2009. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; Query physical memory map from BIOS.
; diamond, 2009
 
push ds
; first call to fn E820
mov eax, 0xE820
xor ebx, ebx
mov es, bx
mov ds, bx
mov di, 0x9104
mov [di-4], ebx ; no blocks yet
mov ecx, 20
mov edx, 0x534D4150
int 15h
jc no_E820
cmp eax, 0x534D4150
jnz no_E820
e820_mem_loop:
cmp byte [di+16], 1 ; ignore non-free areas
jnz e820_mem_next
inc byte [0x9100]
add di, 20
e820_mem_next:
; consequent calls to fn E820
test ebx, ebx
jz e820_test_done
cmp byte [0x9100], 32
jae e820_test_done
mov eax, 0xE820
int 15h
jc e820_test_done
jmp e820_mem_loop
no_E820:
; let's hope for mem_test from init.inc
e820_test_done:
pop ds
/kernel/branches/net/detect/getcache.inc
70,15 → 70,26
jz .endbd
mov esi,BiosDiskCaches
.loopbd:
cmp byte [BiosDisksData+ecx*4+2],-1
jnz .contbd
push ecx
movsx ecx,byte [BiosDisksData+ecx*4+2]
inc ecx
jz .getbd
add ecx,ecx
movzx eax,byte [DRIVE_DATA+1]
shl eax,cl
and ah,3
cmp ah,1
jz .contbd
pop ecx
mov byte [BiosDisksData+ecx*4+2], -1
push ecx
.getbd:
mov eax,[cache_ide0_size]
mov [esi+cache_ide0_size-cache_ide0],eax
push ecx
mov cl,1
call get_cache_ide
.contbd:
pop ecx
.contbd:
add esi,cache_ide1-cache_ide0
inc ecx
cmp ecx,[NumBiosDisks]