reduce memory size

git-svn-id: svn://kolibrios.org@472 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge)
2007-04-28 12:45:22 +00:00
parent 614fe2dab1
commit 0cca9c7b8c
6 changed files with 37 additions and 40 deletions

View File

@@ -6,7 +6,7 @@ $Revision$
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Low-level driver for HDD access
; Low-level driver for HDD access
; DMA support by Mario79
;**************************************************************************
@@ -33,7 +33,7 @@ hd_read:
push ecx esi edi ; scan cache
mov ecx,cache_max ; entries in cache
mov esi,OS_BASE+0x600000+8
mov esi,HD_CACHE+8
mov edi,1
hdreadcache:
@@ -62,7 +62,7 @@ hd_read:
call hd_read_pio
@@:
lea esi,[edi*8+OS_BASE+0x600000]
lea esi,[edi*8+HD_CACHE]
mov [esi],eax ; sector number
mov dword [esi+4],1 ; hd read - mark as same as in hd
@@ -70,7 +70,7 @@ hd_read:
mov esi,edi
shl esi,9
add esi,OS_BASE+0x600000+65536
add esi,HD_CACHE+65536
mov edi,ebx
mov ecx,512/4
cld
@@ -123,7 +123,7 @@ hd_read_pio:
cli
push edi
shl edi,9
add edi,OS_BASE+0x600000+65536
add edi,HD_CACHE+65536
mov ecx,256
mov edx,[hdbase]
cld
@@ -161,7 +161,7 @@ hd_write:
; check if the cache already has the sector and overwrite it
mov ecx,cache_max
mov esi,OS_BASE+0x600000+8
mov esi,HD_CACHE+8
mov edi,1
hdwritecache:
@@ -186,7 +186,7 @@ hd_write:
cmp [hd_error],0
jne hd_write_access_denied
lea esi,[edi*8+OS_BASE+0x600000]
lea esi,[edi*8+HD_CACHE]
mov [esi],eax ; sector number
yes_in_cache_write:
@@ -194,7 +194,7 @@ hd_write:
mov dword [esi+4],2 ; write - differs from hd
shl edi,9
add edi,OS_BASE+0x600000+65536
add edi,HD_CACHE+65536
mov esi,ebx
mov ecx,512/4
cld
@@ -213,7 +213,7 @@ write_cache:
; write difference ( 2 ) from cache to hd
mov ecx,cache_max
mov esi,OS_BASE+0x600000+8
mov esi,HD_CACHE+8
mov edi,1
write_cache_more:
@@ -331,7 +331,7 @@ cache_write_pio:
; cli
mov esi,edi
shl esi,9
add esi,OS_BASE+0x600000+65536 ; esi = from memory position
add esi,HD_CACHE+65536 ; esi = from memory position
mov ecx,256
mov edx,[hdbase]
cld
@@ -365,7 +365,7 @@ find_empty_slot:
inside_cache:
cmp dword [edi*8+OS_BASE+0x600000+4],2 ; get cache slot info
cmp dword [edi*8+HD_CACHE+4],2 ; get cache slot info
jb found_slot ; it's empty or read
dec ecx
jnz search_for_empty
@@ -386,7 +386,7 @@ align 4
clear_hd_cache:
push eax ecx edi
mov edi,OS_BASE+0x600000
mov edi, HD_CACHE
mov ecx,16384
xor eax,eax
cld
@@ -680,7 +680,7 @@ hd_read_dma:
push ecx esi edi
mov esi, eax
shl edi, 9
add edi, OS_BASE+0x610000
add edi, HD_CACHE+0x10000
mov ecx, 512/4
cld
rep movsd
@@ -775,7 +775,7 @@ write_cache_chain:
mov eax, IDE_descriptor_table
mov edx, [cache_chain_pos]
shl edx, 9
add edx, 0x610000
add edx, DMA_HD_MEM+0x10000
mov [eax], edx
movzx edx, [cache_chain_size]
shl edx, 9
@@ -786,7 +786,7 @@ write_cache_sector:
mov eax, IDE_descriptor_table
mov edx, edi
shl edx, 9
add edx, 0x610000
add edx, DMA_HD_MEM+0x10000
mov [eax], edx
mov word [eax+4], 0x200
do_write_dma: