Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 471 → Rev 472

/kernel/trunk/blkdev/hd_drv.inc
6,7 → 6,7
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
; Low-level driver for HDD access
; Low-level driver for HDD access
; DMA support by Mario79
 
;**************************************************************************
33,7 → 33,7
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
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
 
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
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
; 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
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
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 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
; 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
 
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
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
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
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
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:
/kernel/trunk/const.inc
282,28 → 282,28
RESERVED_PORTS equ (OS_BASE+0x02D0000)
IRQ_SAVE equ (OS_BASE+0x02E0000)
BOOT_VAR equ (OS_BASE+0x02f0000)
WinMapAddress equ (OS_BASE+0x0460000)
display_data equ (OS_BASE+0x0460000)
 
HD_CACHE equ (OS_BASE+0x0600000)
DMA_HD_MEM equ 0x0300000
HD_CACHE equ (OS_BASE+DMA_HD_MEM)
 
stack_data_start equ (OS_BASE+0x0700000)
eth_data_start equ (OS_BASE+0x0700000)
stack_data equ (OS_BASE+0x0704000)
stack_data_end equ (OS_BASE+0x071ffff)
VMODE_BASE equ (OS_BASE+0x0760000)
resendQ equ (OS_BASE+0x0770000)
stack_data_start equ (OS_BASE+0x0400000)
eth_data_start equ (OS_BASE+0x0400000)
stack_data equ (OS_BASE+0x0404000)
stack_data_end equ (OS_BASE+0x041ffff)
resendQ equ (OS_BASE+0x0420000)
VMODE_BASE equ (OS_BASE+0x0428000)
skin_data equ (OS_BASE+0x0430000)
draw_data equ (OS_BASE+0x0438000);
 
skin_data equ (OS_BASE+0x0778000)
 
draw_data equ (OS_BASE+0x0780000);
 
virtual at (OS_BASE+0x0783F80)
virtual at (OS_BASE+0x043BF80)
tss TSS
end virtual
 
tmp_page_tab equ 0x0786000;
WinMapAddress equ (OS_BASE+0x043F000)
display_data equ (OS_BASE+0x043F000)
 
tmp_page_tab equ 0x057F000;
 
HEAP_BASE equ (OS_BASE+tmp_page_tab)
HEAP_MIN_SIZE equ 0x01000000
 
/kernel/trunk/drivers/vmode.asm
16,7 → 16,7
 
macro align value { rb (value-1) - ($ + value-1) mod value }
 
org 0x80760000
org OS_BASE+0x0428000
 
headerstart=$
 
/kernel/trunk/kernel.asm
3568,9 → 3568,6
 
; all black
 
; mov [display_data-8],dword 4 ; size x
; mov [display_data-4],dword 2 ; size y
 
mov edi, [img_background] ;IMG_BACKGROUND ; set background to black
xor eax, eax
mov ecx, 1023 ;0x0fff00 / 4
3579,7 → 3576,7
 
mov edi,display_data ; set os to use all pixels
mov eax,0x01010101
mov ecx,0x15ff00 / 4
mov ecx,1280*1024 / 4
rep stosd
 
mov byte [REDRAW_BACKGROUND], 0 ; do not draw background!
/kernel/trunk/vmodeint.inc
27,7 → 27,7
pushd [ScreenWidth] [ScreenHeight]
popd [old_screen_height] [old_screen_width]
or eax,-1 ; If driver is absent then eax does not change
call OS_BASE+0x760100 ; Entry point of video driver
call (VMODE_BASE+0x100) ; Entry point of video driver
mov [esp+36],eax
mov [esp+24],ebx
mov [esp+32],ecx
/kernel/trunk/vmodeld.inc
9,7 → 9,7
;
; Load of videomode driver in memory
;
; (driver is located at 0x760000-0x768000 - 32kb) // if this area not occuped anything
; (driver is located at VMODE_BASE - 32kb) // if this area not occuped anything
;
; Author: Trans
; Date: 19.07.2003
21,11 → 21,11
; LOAD VIDEOMODE DRIVER
; If vmode.mdr file not found
or eax,-1 ; Driver ID = -1 (not present in system)
mov [OS_BASE+0x760000],eax ;
mov [OS_BASE+0x760100],byte 0xC3 ; Instruction RETN - driver loop
mov [VMODE_BASE],eax ;
mov [VMODE_BASE+0x100],byte 0xC3 ; Instruction RETN - driver loop
 
mov esi, vmode
xor ebx, ebx
mov ecx, 0x8000 ; size of memory area for driver
mov edx, OS_BASE+0x760000 ; Memory position of driver
mov edx, VMODE_BASE ; Memory position of driver
call fs_RamdiskRead