forked from KolibriOS/kolibrios
fixed bug in init_LFB()
git-svn-id: svn://kolibrios.org@389 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
9140ef0cce
commit
3764b8d630
@ -9,7 +9,7 @@ uglobal
|
|||||||
endg
|
endg
|
||||||
|
|
||||||
fdc_init: ;start with clean tracks.
|
fdc_init: ;start with clean tracks.
|
||||||
mov edi,0xD201
|
mov edi,OS_BASE+0xD201
|
||||||
mov al,0
|
mov al,0
|
||||||
mov ecx,160
|
mov ecx,160
|
||||||
rep stosb
|
rep stosb
|
||||||
@ -22,7 +22,7 @@ fdc_filesave: ;ebx: cluster to be saved.
|
|||||||
mov bl,18
|
mov bl,18
|
||||||
div bl
|
div bl
|
||||||
mov ah,0
|
mov ah,0
|
||||||
add eax,0xD201
|
add eax,OS_BASE+0xD201
|
||||||
mov [eax],byte 1 ;This track is now dirty.
|
mov [eax],byte 1 ;This track is now dirty.
|
||||||
popa
|
popa
|
||||||
ret
|
ret
|
||||||
|
@ -25,7 +25,7 @@ hd_read:
|
|||||||
push ecx esi edi ; scan cache
|
push ecx esi edi ; scan cache
|
||||||
|
|
||||||
mov ecx,cache_max ; entries in cache
|
mov ecx,cache_max ; entries in cache
|
||||||
mov esi,0x600000+8
|
mov esi,OS_BASE+0x600000+8
|
||||||
mov edi,1
|
mov edi,1
|
||||||
|
|
||||||
hdreadcache:
|
hdreadcache:
|
||||||
@ -54,7 +54,7 @@ hd_read:
|
|||||||
call hd_read_pio
|
call hd_read_pio
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
lea esi,[edi*8+0x600000]
|
lea esi,[edi*8+OS_BASE+0x600000]
|
||||||
mov [esi],eax ; sector number
|
mov [esi],eax ; sector number
|
||||||
mov dword [esi+4],1 ; hd read - mark as same as in hd
|
mov dword [esi+4],1 ; hd read - mark as same as in hd
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ hd_read:
|
|||||||
|
|
||||||
mov esi,edi
|
mov esi,edi
|
||||||
shl esi,9
|
shl esi,9
|
||||||
add esi,0x600000+65536
|
add esi,OS_BASE+0x600000+65536
|
||||||
mov edi,ebx
|
mov edi,ebx
|
||||||
mov ecx,512/4
|
mov ecx,512/4
|
||||||
cld
|
cld
|
||||||
@ -77,7 +77,7 @@ hd_read_pio:
|
|||||||
|
|
||||||
call wait_for_hd_idle
|
call wait_for_hd_idle
|
||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne hd_read_error
|
jne hd_read_error
|
||||||
|
|
||||||
cli
|
cli
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
@ -115,7 +115,7 @@ hd_read_pio:
|
|||||||
cli
|
cli
|
||||||
push edi
|
push edi
|
||||||
shl edi,9
|
shl edi,9
|
||||||
add edi,0x600000+65536
|
add edi,OS_BASE+0x600000+65536
|
||||||
mov ecx,256
|
mov ecx,256
|
||||||
mov edx,[hdbase]
|
mov edx,[hdbase]
|
||||||
cld
|
cld
|
||||||
@ -126,7 +126,7 @@ hd_read_pio:
|
|||||||
pop edx eax
|
pop edx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
disable_ide_int:
|
disable_ide_int:
|
||||||
; mov edx,[hdbase]
|
; mov edx,[hdbase]
|
||||||
; add edx,0x206
|
; add edx,0x206
|
||||||
; mov al,2
|
; mov al,2
|
||||||
@ -153,7 +153,7 @@ hd_write:
|
|||||||
; check if the cache already has the sector and overwrite it
|
; check if the cache already has the sector and overwrite it
|
||||||
|
|
||||||
mov ecx,cache_max
|
mov ecx,cache_max
|
||||||
mov esi,0x600000+8
|
mov esi,OS_BASE+0x600000+8
|
||||||
mov edi,1
|
mov edi,1
|
||||||
|
|
||||||
hdwritecache:
|
hdwritecache:
|
||||||
@ -178,7 +178,7 @@ hd_write:
|
|||||||
cmp [hd_error],0
|
cmp [hd_error],0
|
||||||
jne hd_write_access_denied
|
jne hd_write_access_denied
|
||||||
|
|
||||||
lea esi,[edi*8+0x600000]
|
lea esi,[edi*8+OS_BASE+0x600000]
|
||||||
mov [esi],eax ; sector number
|
mov [esi],eax ; sector number
|
||||||
|
|
||||||
yes_in_cache_write:
|
yes_in_cache_write:
|
||||||
@ -186,7 +186,7 @@ hd_write:
|
|||||||
mov dword [esi+4],2 ; write - differs from hd
|
mov dword [esi+4],2 ; write - differs from hd
|
||||||
|
|
||||||
shl edi,9
|
shl edi,9
|
||||||
add edi,0x600000+65536
|
add edi,OS_BASE+0x600000+65536
|
||||||
mov esi,ebx
|
mov esi,ebx
|
||||||
mov ecx,512/4
|
mov ecx,512/4
|
||||||
cld
|
cld
|
||||||
@ -205,7 +205,7 @@ write_cache:
|
|||||||
; write difference ( 2 ) from cache to hd
|
; write difference ( 2 ) from cache to hd
|
||||||
|
|
||||||
mov ecx,cache_max
|
mov ecx,cache_max
|
||||||
mov esi,0x600000+8
|
mov esi,OS_BASE+0x600000+8
|
||||||
mov edi,1
|
mov edi,1
|
||||||
|
|
||||||
write_cache_more:
|
write_cache_more:
|
||||||
@ -323,7 +323,7 @@ cache_write_pio:
|
|||||||
; cli
|
; cli
|
||||||
mov esi,edi
|
mov esi,edi
|
||||||
shl esi,9
|
shl esi,9
|
||||||
add esi,0x600000+65536 ; esi = from memory position
|
add esi,OS_BASE+0x600000+65536 ; esi = from memory position
|
||||||
mov ecx,256
|
mov ecx,256
|
||||||
mov edx,[hdbase]
|
mov edx,[hdbase]
|
||||||
cld
|
cld
|
||||||
@ -357,7 +357,7 @@ find_empty_slot:
|
|||||||
|
|
||||||
inside_cache:
|
inside_cache:
|
||||||
|
|
||||||
cmp dword [edi*8+0x600000+4],2 ; get cache slot info
|
cmp dword [edi*8+OS_BASE+0x600000+4],2 ; get cache slot info
|
||||||
jb found_slot ; it's empty or read
|
jb found_slot ; it's empty or read
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz search_for_empty
|
jnz search_for_empty
|
||||||
@ -378,7 +378,7 @@ align 4
|
|||||||
clear_hd_cache:
|
clear_hd_cache:
|
||||||
|
|
||||||
push eax ecx edi
|
push eax ecx edi
|
||||||
mov edi,0x600000
|
mov edi,OS_BASE+0x600000
|
||||||
mov ecx,16384
|
mov ecx,16384
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
cld
|
cld
|
||||||
@ -484,7 +484,7 @@ wait_for_hd_idle:
|
|||||||
in al,dx
|
in al,dx
|
||||||
test al,128
|
test al,128
|
||||||
jnz wfhil1
|
jnz wfhil1
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
pop edx eax
|
pop edx eax
|
||||||
@ -574,7 +574,7 @@ iglobal
|
|||||||
align 4
|
align 4
|
||||||
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
|
; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary
|
||||||
IDE_descriptor_table:
|
IDE_descriptor_table:
|
||||||
dd 284000h
|
dd OS_BASE+284000h
|
||||||
dw 2000h
|
dw 2000h
|
||||||
dw 8000h
|
dw 8000h
|
||||||
|
|
||||||
@ -607,16 +607,16 @@ hdd_irq14:
|
|||||||
out dx, al
|
out dx, al
|
||||||
call update_counters
|
call update_counters
|
||||||
mov ebx, [dma_process]
|
mov ebx, [dma_process]
|
||||||
cmp [0x3000], ebx
|
cmp [CURRENT_TASK], ebx
|
||||||
jz .noswitch
|
jz .noswitch
|
||||||
mov [dma_task_switched], 1
|
mov [dma_task_switched], 1
|
||||||
mov edi, [dma_slot_ptr]
|
mov edi, [dma_slot_ptr]
|
||||||
mov eax, [0x3000]
|
mov eax, [CURRENT_TASK]
|
||||||
mov [dma_process], eax
|
mov [dma_process], eax
|
||||||
mov eax, [0x3010]
|
mov eax, [TASK_BASE]
|
||||||
mov [dma_slot_ptr], eax
|
mov [dma_slot_ptr], eax
|
||||||
mov [0x3000], ebx
|
mov [CURRENT_TASK], ebx
|
||||||
mov [0x3010], edi
|
mov [TASK_BASE], edi
|
||||||
mov byte [0xFFFF], 1
|
mov byte [0xFFFF], 1
|
||||||
call do_change_task
|
call do_change_task
|
||||||
.noswitch:
|
.noswitch:
|
||||||
@ -638,16 +638,16 @@ hdd_irq15:
|
|||||||
out dx, al
|
out dx, al
|
||||||
call update_counters
|
call update_counters
|
||||||
mov ebx, [dma_process]
|
mov ebx, [dma_process]
|
||||||
cmp [0x3000], ebx
|
cmp [CURRENT_TASK], ebx
|
||||||
jz .noswitch
|
jz .noswitch
|
||||||
mov [dma_task_switched], 1
|
mov [dma_task_switched], 1
|
||||||
mov edi, [dma_slot_ptr]
|
mov edi, [dma_slot_ptr]
|
||||||
mov eax, [0x3000]
|
mov eax, [CURRENT_TASK]
|
||||||
mov [dma_process], eax
|
mov [dma_process], eax
|
||||||
mov eax, [0x3010]
|
mov eax, [TASK_BASE]
|
||||||
mov [dma_slot_ptr], eax
|
mov [dma_slot_ptr], eax
|
||||||
mov [0x3000], ebx
|
mov [CURRENT_TASK], ebx
|
||||||
mov [0x3010], edi
|
mov [TASK_BASE], edi
|
||||||
mov byte [0xFFFF], 1
|
mov byte [0xFFFF], 1
|
||||||
call do_change_task
|
call do_change_task
|
||||||
.noswitch:
|
.noswitch:
|
||||||
@ -668,11 +668,11 @@ hd_read_dma:
|
|||||||
mov eax, [esp+4]
|
mov eax, [esp+4]
|
||||||
sub eax, [dma_cur_sector]
|
sub eax, [dma_cur_sector]
|
||||||
shl eax, 9
|
shl eax, 9
|
||||||
add eax, 0x284000
|
add eax, OS_BASE+0x284000
|
||||||
push ecx esi edi
|
push ecx esi edi
|
||||||
mov esi, eax
|
mov esi, eax
|
||||||
shl edi, 9
|
shl edi, 9
|
||||||
add edi, 0x610000
|
add edi, OS_BASE+0x610000
|
||||||
mov ecx, 512/4
|
mov ecx, 512/4
|
||||||
cld
|
cld
|
||||||
rep movsd
|
rep movsd
|
||||||
@ -681,9 +681,9 @@ hd_read_dma:
|
|||||||
pop eax
|
pop eax
|
||||||
ret
|
ret
|
||||||
.notread:
|
.notread:
|
||||||
mov eax, IDE_descriptor_table
|
mov eax, IDE_descriptor_table-OS_BASE
|
||||||
mov dword [eax], 0x284000
|
mov dword [eax+OS_BASE], 0x284000
|
||||||
mov word [eax+4], 0x2000
|
mov word [eax+4+OS_BASE], 0x2000
|
||||||
mov dx, [IDEContrRegsBaseAddr]
|
mov dx, [IDEContrRegsBaseAddr]
|
||||||
cmp [hdbase], 0x1F0
|
cmp [hdbase], 0x1F0
|
||||||
jz @f
|
jz @f
|
||||||
@ -734,9 +734,9 @@ hd_read_dma:
|
|||||||
@@:
|
@@:
|
||||||
mov al, 9
|
mov al, 9
|
||||||
out dx, al
|
out dx, al
|
||||||
mov eax, [0x3000]
|
mov eax, [CURRENT_TASK]
|
||||||
mov [dma_process], eax
|
mov [dma_process], eax
|
||||||
mov eax, [0x3010]
|
mov eax, [TASK_BASE]
|
||||||
mov [dma_slot_ptr], eax
|
mov [dma_slot_ptr], eax
|
||||||
cmp [hdbase], 0x1F0
|
cmp [hdbase], 0x1F0
|
||||||
jnz .ide1
|
jnz .ide1
|
||||||
@ -766,7 +766,7 @@ write_cache_chain:
|
|||||||
mov eax, IDE_descriptor_table
|
mov eax, IDE_descriptor_table
|
||||||
mov edx, [cache_chain_pos]
|
mov edx, [cache_chain_pos]
|
||||||
shl edx, 9
|
shl edx, 9
|
||||||
add edx, 0x610000
|
add edx, OS_BASE+0x610000
|
||||||
mov [eax], edx
|
mov [eax], edx
|
||||||
movzx edx, [cache_chain_size]
|
movzx edx, [cache_chain_size]
|
||||||
shl edx, 9
|
shl edx, 9
|
||||||
@ -777,7 +777,7 @@ write_cache_sector:
|
|||||||
mov eax, IDE_descriptor_table
|
mov eax, IDE_descriptor_table
|
||||||
mov edx, edi
|
mov edx, edi
|
||||||
shl edx, 9
|
shl edx, 9
|
||||||
add edx, 0x610000
|
add edx, OS_BASE+0x610000
|
||||||
mov [eax], edx
|
mov [eax], edx
|
||||||
mov word [eax+4], 0x200
|
mov word [eax+4], 0x200
|
||||||
do_write_dma:
|
do_write_dma:
|
||||||
@ -832,9 +832,9 @@ do_write_dma:
|
|||||||
@@:
|
@@:
|
||||||
mov al, 1
|
mov al, 1
|
||||||
out dx, al
|
out dx, al
|
||||||
mov eax, [0x3000]
|
mov eax, [CURRENT_TASK]
|
||||||
mov [dma_process], eax
|
mov [dma_process], eax
|
||||||
mov eax, [0x3010]
|
mov eax, [TASK_BASE]
|
||||||
mov [dma_slot_ptr], eax
|
mov [dma_slot_ptr], eax
|
||||||
cmp [hdbase], 0x1F0
|
cmp [hdbase], 0x1F0
|
||||||
jnz .ide1
|
jnz .ide1
|
||||||
|
@ -424,19 +424,22 @@ proc init_LFB
|
|||||||
|
|
||||||
.map_page_tables:
|
.map_page_tables:
|
||||||
|
|
||||||
@@:
|
|
||||||
call alloc_page
|
call alloc_page
|
||||||
stdcall map_page_table, edx, eax
|
stdcall map_page_table, edx, eax
|
||||||
add esi, 0x00400000
|
add edx, 0x00400000
|
||||||
dec edi
|
dec edi
|
||||||
jnz @B
|
jnz .map_page_tables
|
||||||
|
|
||||||
mov eax, [LFBAddress]
|
mov eax, [LFBAddress]
|
||||||
mov edi, page_tabs + (LFB_BASE shr 10)
|
mov edi, page_tabs + (LFB_BASE shr 10)
|
||||||
or eax, PG_UW
|
or eax, PG_UW
|
||||||
mov ecx, [pg_count]
|
mov ecx, [pg_count]
|
||||||
cld
|
cld
|
||||||
rep stosd
|
@@:
|
||||||
|
stosd
|
||||||
|
add eax, 0x1000
|
||||||
|
dec ecx
|
||||||
|
jnz @B
|
||||||
|
|
||||||
mov dword [LFBAddress], LFB_BASE
|
mov dword [LFBAddress], LFB_BASE
|
||||||
mov eax, cr3 ;flush TLB
|
mov eax, cr3 ;flush TLB
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
;; ;;
|
;; ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
align 4
|
||||||
idtreg:
|
idtreg:
|
||||||
dw 8*0x41-1
|
dw 8*0x41-1
|
||||||
dd idts+8
|
dd idts+8
|
||||||
|
@ -12,25 +12,25 @@ FindHDD:
|
|||||||
mov [DiskNumber],0
|
mov [DiskNumber],0
|
||||||
call FindHDD_3
|
call FindHDD_3
|
||||||
; mov ax,[Sector512+176]
|
; mov ax,[Sector512+176]
|
||||||
; mov [0x40006],ax
|
; mov [DRIVE_DATA+6],ax
|
||||||
; mov ax,[Sector512+126]
|
; mov ax,[Sector512+126]
|
||||||
; mov [0x40008],ax
|
; mov [DRIVE_DATA+8],ax
|
||||||
; mov ax,[Sector512+128]
|
; mov ax,[Sector512+128]
|
||||||
; mov [0x40008],ax
|
; mov [DRIVE_DATA+8],ax
|
||||||
mov [DiskNumber],1
|
mov [DiskNumber],1
|
||||||
call FindHDD_3
|
call FindHDD_3
|
||||||
; mov al,[Sector512+176]
|
; mov al,[Sector512+176]
|
||||||
; mov [0x40007],al
|
; mov [DRIVE_DATA+7],al
|
||||||
inc [ChannelNumber]
|
inc [ChannelNumber]
|
||||||
mov [DiskNumber],0
|
mov [DiskNumber],0
|
||||||
call FindHDD_3
|
call FindHDD_3
|
||||||
; mov al,[Sector512+176]
|
; mov al,[Sector512+176]
|
||||||
; mov [0x40008],al
|
; mov [DRIVE_DATA+8],al
|
||||||
mov [DiskNumber],1
|
mov [DiskNumber],1
|
||||||
call FindHDD_1
|
call FindHDD_1
|
||||||
; mov al,[Sector512+176]
|
; mov al,[Sector512+176]
|
||||||
; mov [0x40009],al
|
; mov [DRIVE_DATA+9],al
|
||||||
|
|
||||||
jmp EndFindHDD
|
jmp EndFindHDD
|
||||||
|
|
||||||
FindHDD_1:
|
FindHDD_1:
|
||||||
@ -41,7 +41,7 @@ FindHDD_1:
|
|||||||
ja FindHDD_2
|
ja FindHDD_2
|
||||||
cmp [Sector512+12],word 255
|
cmp [Sector512+12],word 255
|
||||||
ja FindHDD_2
|
ja FindHDD_2
|
||||||
inc byte [0x40001]
|
inc byte [DRIVE_DATA+1]
|
||||||
jmp FindHDD_2_2
|
jmp FindHDD_2_2
|
||||||
FindHDD_2:
|
FindHDD_2:
|
||||||
call DeviceReset
|
call DeviceReset
|
||||||
@ -50,14 +50,14 @@ FindHDD_1:
|
|||||||
call ReadCD_ID
|
call ReadCD_ID
|
||||||
cmp [DevErrorCode],0
|
cmp [DevErrorCode],0
|
||||||
jne FindHDD_2_2
|
jne FindHDD_2_2
|
||||||
inc byte [0x40001]
|
inc byte [DRIVE_DATA+1]
|
||||||
inc byte [0x40001]
|
inc byte [DRIVE_DATA+1]
|
||||||
FindHDD_2_2:
|
FindHDD_2_2:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
FindHDD_3:
|
FindHDD_3:
|
||||||
call FindHDD_1
|
call FindHDD_1
|
||||||
shl byte [0x40001],2
|
shl byte [DRIVE_DATA+1],2
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ ReadHDD_ID:
|
|||||||
cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè
|
cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè
|
||||||
jne @@End ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè
|
jne @@End ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè
|
||||||
mov DX,[ATABasePortAddr]
|
mov DX,[ATABasePortAddr]
|
||||||
add DX,7 ;адрес регистра состояния
|
add DX,7 ;àäðåñ ðåãèñòðà ñîñòîÿíè
|
||||||
mov ecx,0xffff
|
mov ecx,0xffff
|
||||||
@@WaitCompleet:
|
@@WaitCompleet:
|
||||||
; Ïðîâåðèòü âðåìÿ âûïîëíåíèÿ êîìàíäû
|
; Ïðîâåðèòü âðåìÿ âûïîëíåíèÿ êîìàíäû
|
||||||
@ -191,15 +191,15 @@ SendCommandToHDD:
|
|||||||
; mov eax,[timer_ticks]
|
; mov eax,[timer_ticks]
|
||||||
; mov [TickCounter_1],eax
|
; mov [TickCounter_1],eax
|
||||||
@@WaitHDReady:
|
@@WaitHDReady:
|
||||||
; Проверить время ожидания
|
; Ïðîâåðèòü âðåìÿ îæèäàíè
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
cmp ecx,0
|
||||||
je @@Err1
|
je @@Err1
|
||||||
; mov eax,[timer_ticks]
|
; mov eax,[timer_ticks]
|
||||||
; sub eax,[TickCounter_1]
|
; sub eax,[TickCounter_1]
|
||||||
; cmp eax,300 ;ожидать 300 тиков
|
; cmp eax,300 ;îæèäàòü 300 òèêîâ
|
||||||
; ja @@Err1 ;îøèáêà òàéì-àóòà
|
; ja @@Err1 ;îøèáêà òàéì-àóòà
|
||||||
; Прочитать регистр состояния
|
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíè
|
||||||
in AL,DX
|
in AL,DX
|
||||||
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY
|
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY
|
||||||
test AL,80h
|
test AL,80h
|
||||||
@ -255,7 +255,7 @@ SendCommandToHDD:
|
|||||||
jmp @@End_2
|
jmp @@End_2
|
||||||
@@Err5: mov [DevErrorCode],5
|
@@Err5: mov [DevErrorCode],5
|
||||||
; Çàâåðøåíèå ðàáîòû ïðîãðàììû
|
; Çàâåðøåíèå ðàáîòû ïðîãðàììû
|
||||||
@@End_2:
|
@@End_2:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;*************************************************
|
;*************************************************
|
||||||
@ -285,7 +285,7 @@ ReadCD_ID:
|
|||||||
add DX,7 ;ïîðò 1õ7h
|
add DX,7 ;ïîðò 1õ7h
|
||||||
mov ecx,0xffff
|
mov ecx,0xffff
|
||||||
@@WaitCompleet_1:
|
@@WaitCompleet_1:
|
||||||
; Проверить время
|
; Ïðîâåðèòü âðåì
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
cmp ecx,0
|
||||||
je @@Error1_1 ;îøèáêà òàéì-àóòà
|
je @@Error1_1 ;îøèáêà òàéì-àóòà
|
||||||
@ -348,11 +348,11 @@ DeviceReset:
|
|||||||
out DX,AL
|
out DX,AL
|
||||||
mov ecx,0x80000
|
mov ecx,0x80000
|
||||||
@@WaitHDReady_1:
|
@@WaitHDReady_1:
|
||||||
; Проверить время ожидания
|
; Ïðîâåðèòü âðåìÿ îæèäàíè
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
cmp ecx,0
|
||||||
je @@Err1_2 ;îøèáêà òàéì-àóòà
|
je @@Err1_2 ;îøèáêà òàéì-àóòà
|
||||||
; Прочитать регистр состояния
|
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíè
|
||||||
in AL,DX
|
in AL,DX
|
||||||
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY
|
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY
|
||||||
test AL,80h
|
test AL,80h
|
||||||
|
@ -389,8 +389,8 @@ choice_necessity_partition:
|
|||||||
choice_necessity_partition_1:
|
choice_necessity_partition_1:
|
||||||
mov ecx,[hdpos]
|
mov ecx,[hdpos]
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
mov [0xfe10], eax ; entries in hd cache
|
mov [hd_entries], eax ; entries in hd cache
|
||||||
mov edx,0x40002
|
mov edx,DRIVE_DATA+2
|
||||||
search_partition_array:
|
search_partition_array:
|
||||||
mov bl,[edx]
|
mov bl,[edx]
|
||||||
movzx ebx,bl
|
movzx ebx,bl
|
||||||
@ -402,7 +402,7 @@ choice_necessity_partition_1:
|
|||||||
dec eax
|
dec eax
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
imul eax,100
|
imul eax,100
|
||||||
add eax,0x4000a
|
add eax,DRIVE_DATA+0xa
|
||||||
mov [transfer_adress],eax
|
mov [transfer_adress],eax
|
||||||
call partition_data_transfer_1
|
call partition_data_transfer_1
|
||||||
ret
|
ret
|
||||||
|
@ -427,7 +427,7 @@ fs_OnHd:
|
|||||||
mov [hdpos], eax
|
mov [hdpos], eax
|
||||||
cmp ecx, 0x100
|
cmp ecx, 0x100
|
||||||
jae .nf
|
jae .nf
|
||||||
cmp cl, [0x40001+eax]
|
cmp cl, [DRIVE_DATA+eax]
|
||||||
jbe @f
|
jbe @f
|
||||||
.nf:
|
.nf:
|
||||||
call free_hd_channel
|
call free_hd_channel
|
||||||
@ -503,7 +503,7 @@ fs_OnCd:
|
|||||||
jae .nf
|
jae .nf
|
||||||
push ecx ebx
|
push ecx ebx
|
||||||
mov cl,al
|
mov cl,al
|
||||||
mov bl,[0x40001]
|
mov bl,[DRIVE_DATA+1]
|
||||||
shr bl,cl
|
shr bl,cl
|
||||||
test bl,2
|
test bl,2
|
||||||
pop ebx ecx
|
pop ebx ecx
|
||||||
|
@ -516,7 +516,7 @@ display_settings:
|
|||||||
|
|
||||||
repos_windows:
|
repos_windows:
|
||||||
mov ecx,[TASK_COUNT]
|
mov ecx,[TASK_COUNT]
|
||||||
mov edi,0x20*2
|
mov edi, OS_BASE+0x20*2
|
||||||
mov byte[REDRAW_BACKGROUND],1
|
mov byte[REDRAW_BACKGROUND],1
|
||||||
dec ecx
|
dec ecx
|
||||||
jge @f
|
jge @f
|
||||||
@ -537,6 +537,7 @@ repos_windows:
|
|||||||
neg eax
|
neg eax
|
||||||
mov [edi+WDATA.box.height],eax
|
mov [edi+WDATA.box.height],eax
|
||||||
.lp1:
|
.lp1:
|
||||||
|
|
||||||
call set_window_clientbox
|
call set_window_clientbox
|
||||||
add edi,0x20
|
add edi,0x20
|
||||||
loop @b
|
loop @b
|
||||||
|
@ -100,6 +100,7 @@ save_draw_mouse:
|
|||||||
mov ecx, [ScreenWidth]
|
mov ecx, [ScreenWidth]
|
||||||
inc ecx
|
inc ecx
|
||||||
mul ecx
|
mul ecx
|
||||||
|
|
||||||
movzx edx, byte [display_data+ebx+eax]
|
movzx edx, byte [display_data+ebx+eax]
|
||||||
shl edx, 8
|
shl edx, 8
|
||||||
mov ecx, [edx+SLOT_BASE+APPDATA.cursor]
|
mov ecx, [edx+SLOT_BASE+APPDATA.cursor]
|
||||||
@ -320,9 +321,10 @@ yes_mouse_disable:
|
|||||||
disable_m:
|
disable_m:
|
||||||
cmp dword [MOUSE_VISIBLE],dword 0
|
cmp dword [MOUSE_VISIBLE],dword 0
|
||||||
jne no_mouse_disable
|
jne no_mouse_disable
|
||||||
|
pushf
|
||||||
cli
|
cli
|
||||||
call draw_mouse_under
|
call draw_mouse_under
|
||||||
sti
|
popf
|
||||||
mov [MOUSE_VISIBLE],dword 1
|
mov [MOUSE_VISIBLE],dword 1
|
||||||
no_mouse_disable:
|
no_mouse_disable:
|
||||||
popad
|
popad
|
||||||
@ -350,9 +352,10 @@ __sys_draw_pointer:
|
|||||||
mov [MOUSE_VISIBLE], dword 0
|
mov [MOUSE_VISIBLE], dword 0
|
||||||
movzx ebx,word [MOUSE_Y]
|
movzx ebx,word [MOUSE_Y]
|
||||||
movzx eax,word [MOUSE_X]
|
movzx eax,word [MOUSE_X]
|
||||||
|
pushfd
|
||||||
cli
|
cli
|
||||||
call save_draw_mouse
|
call save_draw_mouse
|
||||||
sti
|
popfd
|
||||||
nodmu2:
|
nodmu2:
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
@ -367,10 +370,11 @@ chms00:
|
|||||||
jne redrawmouse
|
jne redrawmouse
|
||||||
jmp nodmp
|
jmp nodmp
|
||||||
redrawmouse:
|
redrawmouse:
|
||||||
|
pushfd
|
||||||
cli
|
cli
|
||||||
call draw_mouse_under
|
call draw_mouse_under
|
||||||
call save_draw_mouse
|
call save_draw_mouse
|
||||||
sti
|
popfd
|
||||||
nodmp:
|
nodmp:
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
@ -5061,6 +5061,7 @@ align 4
|
|||||||
cpu_caps dd 4 dup(0)
|
cpu_caps dd 4 dup(0)
|
||||||
pg_data PG_DATA
|
pg_data PG_DATA
|
||||||
heap_test dd ?
|
heap_test dd ?
|
||||||
|
hd_entries rd 1 ;unused ? 0xfe10
|
||||||
endg
|
endg
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
|
@ -18,7 +18,7 @@ SB16_play_music equ 0xc0000001
|
|||||||
DMAPage equ 0x2A
|
DMAPage equ 0x2A
|
||||||
Rate equ 44100
|
Rate equ 44100
|
||||||
SB16Buffer equ 0x2A0000
|
SB16Buffer equ 0x2A0000
|
||||||
SB16_Status equ SB16Buffer+65536
|
;SB16_Status equ SB16Buffer+65536
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
sound_data_format dd 0x1
|
sound_data_format dd 0x1
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
getpixel:
|
getpixel:
|
||||||
push eax ebx edx edi
|
push eax ebx edx edi
|
||||||
call dword [0xe024]
|
call dword [GETPIXEL]
|
||||||
pop edi edx ebx eax
|
pop edi edx ebx eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;
|
;
|
||||||
; Load of videomode driver in memory
|
; Load of videomode driver in memory
|
||||||
;
|
;
|
||||||
; (driver is located at 0x760000-0x768000 - 32kb) // if this area not occuped anything
|
; (driver is located at 0x760000-0x768000 - 32kb) // if this area not occuped anything
|
||||||
;
|
;
|
||||||
; Author: Trans
|
; Author: Trans
|
||||||
@ -13,11 +13,11 @@
|
|||||||
; LOAD VIDEOMODE DRIVER
|
; LOAD VIDEOMODE DRIVER
|
||||||
; If vmode.mdr file not found
|
; If vmode.mdr file not found
|
||||||
or eax,-1 ; Driver ID = -1 (not present in system)
|
or eax,-1 ; Driver ID = -1 (not present in system)
|
||||||
mov [0x760000],eax ;
|
mov [OS_BASE+0x760000],eax ;
|
||||||
mov [0x760100],byte 0xC3 ; Instruction RETN - driver loop
|
mov [OS_BASE+0x760100],byte 0xC3 ; Instruction RETN - driver loop
|
||||||
|
|
||||||
mov esi, vmode
|
mov esi, vmode
|
||||||
xor ebx, ebx
|
xor ebx, ebx
|
||||||
mov ecx, 0x8000 ; size of memory area for driver
|
mov ecx, 0x8000 ; size of memory area for driver
|
||||||
mov edx, 0x760000 ; Memory position of driver
|
mov edx, OS_BASE+0x760000 ; Memory position of driver
|
||||||
call fs_RamdiskRead
|
call fs_RamdiskRead
|
||||||
|
Loading…
Reference in New Issue
Block a user