forked from KolibriOS/kolibrios
1)fixed hangup on reboot/restart/poweroff
2)drivers git-svn-id: svn://kolibrios.org@417 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
d4db051a61
commit
ef977fdf26
@ -34,7 +34,7 @@ pci_api:
|
|||||||
or al,al
|
or al,al
|
||||||
jnz pci_fn_1
|
jnz pci_fn_1
|
||||||
; PCI function 0: get pci version (AH.AL)
|
; PCI function 0: get pci version (AH.AL)
|
||||||
movzx eax,word [0x2F0000+0x9022]
|
movzx eax,word [BOOT_VAR+0x9022]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
pci_fn_1:
|
pci_fn_1:
|
||||||
@ -42,14 +42,14 @@ pci_fn_1:
|
|||||||
jnz pci_fn_2
|
jnz pci_fn_2
|
||||||
|
|
||||||
; PCI function 1: get last bus in AL
|
; PCI function 1: get last bus in AL
|
||||||
mov al,[0x2F0000+0x9021]
|
mov al,[BOOT_VAR+0x9021]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
pci_fn_2:
|
pci_fn_2:
|
||||||
cmp al,2
|
cmp al,2
|
||||||
jne pci_fn_3
|
jne pci_fn_3
|
||||||
; PCI function 2: get pci access mechanism
|
; PCI function 2: get pci access mechanism
|
||||||
mov al,[0x2F0000+0x9020]
|
mov al,[BOOT_VAR+0x9020]
|
||||||
ret
|
ret
|
||||||
pci_fn_3:
|
pci_fn_3:
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ pci_make_config_cmd:
|
|||||||
align 4
|
align 4
|
||||||
|
|
||||||
pci_read_reg:
|
pci_read_reg:
|
||||||
cmp byte [0x2F0000+0x9020],2 ;what mechanism will we use?
|
cmp byte [BOOT_VAR+0x9020],2 ;what mechanism will we use?
|
||||||
je pci_read_reg_2
|
je pci_read_reg_2
|
||||||
|
|
||||||
; mechanism 1
|
; mechanism 1
|
||||||
@ -238,7 +238,7 @@ pci_read_reg_err:
|
|||||||
align 4
|
align 4
|
||||||
|
|
||||||
pci_write_reg:
|
pci_write_reg:
|
||||||
cmp byte [0x2F0000+0x9020],2 ;what mechanism will we use?
|
cmp byte [BOOT_VAR+0x9020],2 ;what mechanism will we use?
|
||||||
je pci_write_reg_2
|
je pci_write_reg_2
|
||||||
|
|
||||||
; mechanism 1
|
; mechanism 1
|
||||||
|
@ -484,6 +484,9 @@ struc SRV
|
|||||||
SRV_FD_OFFSET equ 0x18
|
SRV_FD_OFFSET equ 0x18
|
||||||
SRV_SIZE equ 44
|
SRV_SIZE equ 44
|
||||||
|
|
||||||
|
DRV_ENTRY equ 1
|
||||||
|
DRV_EXIT equ -1
|
||||||
|
|
||||||
struc COFF_HEADER
|
struc COFF_HEADER
|
||||||
{ .machine dw ?
|
{ .machine dw ?
|
||||||
.nSections dw ?
|
.nSections dw ?
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
|
|
||||||
DRV_ENTRY equ 1
|
|
||||||
DRV_EXIT equ -1
|
|
||||||
DRV_COMPAT equ 4 ;minimal required drivers version
|
DRV_COMPAT equ 4 ;minimal required drivers version
|
||||||
DRV_CURRENT equ 4 ;current drivers model version
|
DRV_CURRENT equ 4 ;current drivers model version
|
||||||
|
|
||||||
@ -698,23 +696,23 @@ proc load_driver stdcall, driver_name:dword
|
|||||||
file_name rb 14+16+4+1 ; '/rd/1/drivers/<up-to-16-chars>.obj'
|
file_name rb 14+16+4+1 ; '/rd/1/drivers/<up-to-16-chars>.obj'
|
||||||
endl
|
endl
|
||||||
|
|
||||||
lea edx, [file_name]
|
lea edx, [file_name]
|
||||||
mov dword [edx], '/rd/'
|
mov dword [edx], '/rd/'
|
||||||
mov dword [edx+4], '1/dr'
|
mov dword [edx+4], '1/dr'
|
||||||
mov dword [edx+8], 'iver'
|
mov dword [edx+8], 'iver'
|
||||||
mov word [edx+12], 's/'
|
mov word [edx+12], 's/'
|
||||||
mov esi, [driver_name]
|
mov esi, [driver_name]
|
||||||
lea edi, [edx+14]
|
lea edi, [edx+14]
|
||||||
mov ecx, 16
|
mov ecx, 16
|
||||||
@@:
|
@@:
|
||||||
lodsb
|
lodsb
|
||||||
test al, al
|
test al, al
|
||||||
jz @f
|
jz @f
|
||||||
stosb
|
stosb
|
||||||
loop @b
|
loop @b
|
||||||
@@:
|
@@:
|
||||||
mov dword [edi], '.obj'
|
mov dword [edi], '.obj'
|
||||||
mov byte [edi+4], 0
|
mov byte [edi+4], 0
|
||||||
stdcall load_file, edx
|
stdcall load_file, edx
|
||||||
|
|
||||||
test eax, eax
|
test eax, eax
|
||||||
|
@ -452,13 +452,13 @@ align 4
|
|||||||
proc page_fault_handler
|
proc page_fault_handler
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
; push eax
|
push eax
|
||||||
; push edx
|
push edx
|
||||||
; mov edx, 0x400 ;bocsh
|
mov edx, 0x400 ;bocsh
|
||||||
; mov al,0xff ;bocsh
|
mov al,0xff ;bocsh
|
||||||
; out dx, al ;bocsh
|
out dx, al ;bocsh
|
||||||
; pop edx
|
pop edx
|
||||||
; pop eax
|
pop eax
|
||||||
|
|
||||||
mov ebp, esp
|
mov ebp, esp
|
||||||
mov eax, cr2
|
mov eax, cr2
|
||||||
|
@ -65,9 +65,8 @@ R9800 equ 0x4E49 ;R350
|
|||||||
R9800P equ 0x4E48 ;R350
|
R9800P equ 0x4E48 ;R350
|
||||||
R9800XT equ 0x4E4A ;R360
|
R9800XT equ 0x4E4A ;R360
|
||||||
|
|
||||||
OS_BASE equ 0
|
OS_BASE equ 0x80000000
|
||||||
new_app_base equ 0x80000000
|
SLOT_BASE equ (OS_BASE+0x0080000)
|
||||||
SLOT_BASE equ 0x0080000
|
|
||||||
|
|
||||||
PG_SW equ 0x003
|
PG_SW equ 0x003
|
||||||
PG_NOCACHE equ 0x018
|
PG_NOCACHE equ 0x018
|
||||||
|
@ -27,9 +27,11 @@ FORCE_MMX_128 equ 0 ;integer sse2 extensions
|
|||||||
DEBUG equ 1
|
DEBUG equ 1
|
||||||
|
|
||||||
|
|
||||||
OS_BASE equ 0
|
OS_BASE equ 0x80000000
|
||||||
new_app_base equ 0x80000000
|
SLOT_BASE equ (OS_BASE+0x0080000)
|
||||||
SLOT_BASE equ OS_BASE+0x0080000
|
TASK_COUNT equ (OS_BASE+0x0003004)
|
||||||
|
CURRENT_TASK equ (OS_BASE+0x0003000)
|
||||||
|
|
||||||
|
|
||||||
CAPS_SSE2 equ 26
|
CAPS_SSE2 equ 26
|
||||||
PG_SW equ 0x003
|
PG_SW equ 0x003
|
||||||
@ -165,7 +167,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
jne @F
|
jne @F
|
||||||
mov eax, [edi+output]
|
mov eax, [edi+output]
|
||||||
mov eax, [eax]
|
mov eax, [eax]
|
||||||
mov [eax+new_app_base], dword SOUND_VERSION
|
mov [eax], dword SOUND_VERSION
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -177,7 +179,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
pop edi
|
pop edi
|
||||||
mov ecx, [edi+output]
|
mov ecx, [edi+output]
|
||||||
mov ecx, [ecx]
|
mov ecx, [ecx]
|
||||||
mov [ecx+new_app_base], ebx
|
mov [ecx], ebx
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
mov ebx, [edi+input]
|
mov ebx, [edi+input]
|
||||||
@ -206,7 +208,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
movzx eax, word [edx+STREAM.format]
|
movzx eax, word [edx+STREAM.format]
|
||||||
mov ecx, [edi+output]
|
mov ecx, [edi+output]
|
||||||
mov ecx, [ecx]
|
mov ecx, [ecx]
|
||||||
mov [ecx+new_app_base], eax
|
mov [ecx], eax
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -227,13 +229,12 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
pop edi
|
pop edi
|
||||||
mov ecx, [edi+output]
|
mov ecx, [edi+output]
|
||||||
mov ecx, [ecx]
|
mov ecx, [ecx]
|
||||||
mov [ecx+new_app_base], ebx
|
mov [ecx], ebx
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
cmp eax, SND_SETBUFF
|
cmp eax, SND_SETBUFF
|
||||||
jne @F
|
jne @F
|
||||||
mov eax, [ebx+4]
|
mov eax, [ebx+4]
|
||||||
add eax, new_app_base
|
|
||||||
stdcall set_buffer, [ebx],eax,[ebx+8],[ebx+12]
|
stdcall set_buffer, [ebx],eax,[ebx+8],[ebx+12]
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -248,8 +249,6 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
mov eax, [edi+output]
|
mov eax, [edi+output]
|
||||||
mov ecx, [eax]
|
mov ecx, [eax]
|
||||||
mov eax, [eax+4]
|
mov eax, [eax+4]
|
||||||
add ecx, new_app_base
|
|
||||||
add eax, new_app_base
|
|
||||||
stdcall GetBufferVol,[ebx],ecx,eax
|
stdcall GetBufferVol,[ebx],ecx,eax
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -263,7 +262,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
mov eax, [edx+STREAM.pan]
|
mov eax, [edx+STREAM.pan]
|
||||||
mov ebx, [edi+output]
|
mov ebx, [edi+output]
|
||||||
mov ebx, [ebx]
|
mov ebx, [ebx]
|
||||||
mov [ebx+new_app_base], eax
|
mov [ebx], eax
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -271,7 +270,6 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
jne @F
|
jne @F
|
||||||
|
|
||||||
mov eax, [ebx+4]
|
mov eax, [ebx+4]
|
||||||
add eax, new_app_base
|
|
||||||
stdcall wave_out, [ebx],eax,[ebx+8]
|
stdcall wave_out, [ebx],eax,[ebx+8]
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -292,7 +290,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
mov eax, [edx+STREAM.in_size]
|
mov eax, [edx+STREAM.in_size]
|
||||||
mov ecx, [edi+output]
|
mov ecx, [edi+output]
|
||||||
mov ecx, [ecx]
|
mov ecx, [ecx]
|
||||||
mov [ecx+new_app_base], eax
|
mov [ecx], eax
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
@ -308,10 +306,6 @@ restore inp_size
|
|||||||
restore output
|
restore output
|
||||||
restore out_size
|
restore out_size
|
||||||
|
|
||||||
TASK_COUNT equ 0x0003004
|
|
||||||
CURRENT_TASK equ 0x0003000
|
|
||||||
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
proc CreateBuffer stdcall, format:dword, size:dword
|
proc CreateBuffer stdcall, format:dword, size:dword
|
||||||
locals
|
locals
|
||||||
@ -653,8 +647,8 @@ proc wave_out stdcall, str:dword,src:dword,size:dword
|
|||||||
test esi, esi
|
test esi, esi
|
||||||
jz .fail
|
jz .fail
|
||||||
|
|
||||||
cmp esi, new_app_base
|
cmp esi, OS_BASE
|
||||||
jb .fail
|
ja .fail
|
||||||
|
|
||||||
mov [state_saved], 0
|
mov [state_saved], 0
|
||||||
|
|
||||||
|
@ -84,7 +84,6 @@ CTRL_CNT_GIE equ 0x00000001 ; GPI Interrupt Enable
|
|||||||
CODEC_REG_POWERDOWN equ 0x26
|
CODEC_REG_POWERDOWN equ 0x26
|
||||||
CODEC_REG_ST equ 0x26
|
CODEC_REG_ST equ 0x26
|
||||||
|
|
||||||
|
|
||||||
DEV_PLAY equ 1
|
DEV_PLAY equ 1
|
||||||
DEV_STOP equ 2
|
DEV_STOP equ 2
|
||||||
DEV_CALLBACK equ 3
|
DEV_CALLBACK equ 3
|
||||||
@ -243,9 +242,8 @@ end virtual
|
|||||||
|
|
||||||
EVENT_NOTIFY equ 0x00000200
|
EVENT_NOTIFY equ 0x00000200
|
||||||
|
|
||||||
OS_BASE equ 0; 0x80400000
|
OS_BASE equ 0x80000000
|
||||||
SLOT_BASE equ OS_BASE+0x0080000
|
SLOT_BASE equ OS_BASE+0x0080000
|
||||||
new_app_base equ 0x80000000
|
|
||||||
|
|
||||||
public START
|
public START
|
||||||
public service_proc
|
public service_proc
|
||||||
@ -369,15 +367,14 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
cmp eax, DEV_GET_MASTERVOL
|
cmp eax, DEV_GET_MASTERVOL
|
||||||
jne @F
|
jne @F
|
||||||
mov ebx, [edi+output]
|
mov ebx, [edi+output]
|
||||||
add ebx, new_app_base
|
|
||||||
stdcall get_master_vol, ebx
|
stdcall get_master_vol, ebx
|
||||||
ret
|
ret
|
||||||
@@:
|
;@@:
|
||||||
cmp eax, DEV_GET_INFO
|
; cmp eax, DEV_GET_INFO
|
||||||
jne @F
|
; jne @F
|
||||||
mov ebx, [edi+output]
|
; mov ebx, [edi+output]
|
||||||
stdcall get_dev_info, ebx
|
; stdcall get_dev_info, ebx
|
||||||
ret
|
; ret
|
||||||
@@:
|
@@:
|
||||||
.fail:
|
.fail:
|
||||||
or eax, -1
|
or eax, -1
|
||||||
|
@ -270,9 +270,8 @@ end virtual
|
|||||||
|
|
||||||
EVENT_NOTIFY equ 0x00000200
|
EVENT_NOTIFY equ 0x00000200
|
||||||
|
|
||||||
OS_BASE equ 0;
|
OS_BASE equ 0x80000000
|
||||||
SLOT_BASE equ OS_BASE+0x0080000
|
SLOT_BASE equ OS_BASE+0x0080000
|
||||||
new_app_base equ 0x80000000
|
|
||||||
|
|
||||||
public START
|
public START
|
||||||
public service_proc
|
public service_proc
|
||||||
@ -413,7 +412,6 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
cmp eax, DEV_GET_MASTERVOL
|
cmp eax, DEV_GET_MASTERVOL
|
||||||
jne @F
|
jne @F
|
||||||
mov ebx, [edi+output]
|
mov ebx, [edi+output]
|
||||||
add ebx, new_app_base
|
|
||||||
stdcall get_master_vol, ebx
|
stdcall get_master_vol, ebx
|
||||||
ret
|
ret
|
||||||
;@@:
|
;@@:
|
||||||
@ -1409,5 +1407,3 @@ ctrl AC_CNTRL
|
|||||||
|
|
||||||
lpc_bus rd 1
|
lpc_bus rd 1
|
||||||
civ_val rd 1
|
civ_val rd 1
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,7 +164,11 @@ CONNECTION_SIZE equ 7*4
|
|||||||
|
|
||||||
UART_VERSION equ 0x12345678 ;debug
|
UART_VERSION equ 0x12345678 ;debug
|
||||||
|
|
||||||
init_uart_service:
|
proc init_uart_service stdcall, state:dword
|
||||||
|
|
||||||
|
cmp [state], 1
|
||||||
|
jne .stop
|
||||||
|
|
||||||
mov eax, UART_SIZE
|
mov eax, UART_SIZE
|
||||||
call malloc
|
call malloc
|
||||||
test eax, eax
|
test eax, eax
|
||||||
@ -241,10 +245,14 @@ init_uart_service:
|
|||||||
|
|
||||||
stdcall attach_int_handler, COM_1_IRQ, com_1_isr
|
stdcall attach_int_handler, COM_1_IRQ, com_1_isr
|
||||||
stdcall reg_service, sz_uart_srv, uart_proc
|
stdcall reg_service, sz_uart_srv, uart_proc
|
||||||
|
mov [eax+SRV.entry], init_uart_service
|
||||||
ret
|
ret
|
||||||
.fail:
|
.fail:
|
||||||
|
.stop:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
ret
|
ret
|
||||||
|
endp
|
||||||
|
|
||||||
|
|
||||||
handle equ IOCTL.handle
|
handle equ IOCTL.handle
|
||||||
io_code equ IOCTL.io_code
|
io_code equ IOCTL.io_code
|
||||||
|
@ -721,7 +721,7 @@ first_app_found:
|
|||||||
cmp [IDEContrRegsBaseAddr], 0
|
cmp [IDEContrRegsBaseAddr], 0
|
||||||
setnz [dma_hdd]
|
setnz [dma_hdd]
|
||||||
|
|
||||||
call init_uart_service
|
stdcall init_uart_service, DRV_ENTRY
|
||||||
|
|
||||||
sti
|
sti
|
||||||
jmp $ ; wait here for timer to take control
|
jmp $ ; wait here for timer to take control
|
||||||
|
@ -264,7 +264,7 @@ include "video/cursors.inc" ; cursors functions
|
|||||||
|
|
||||||
include "network/stack.inc"
|
include "network/stack.inc"
|
||||||
|
|
||||||
include "drivers/comport.asm"
|
include "drivers/uart.inc"
|
||||||
|
|
||||||
|
|
||||||
; Mouse pointer
|
; Mouse pointer
|
||||||
|
Loading…
Reference in New Issue
Block a user