Converted sound driver selector to PE format.

git-svn-id: svn://kolibrios.org@5070 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-08-29 19:11:18 +00:00
parent 1bf349abae
commit 205caf29cf
2 changed files with 26 additions and 36 deletions

View File

@ -131,7 +131,6 @@ FASM_PROGRAMS:=\
drivers/emu10k1x.obj:DRIVERS/EMU10K1X.OBJ:$(KERNEL)/drivers/emu10k1x.asm \
drivers/fm801.obj:DRIVERS/FM801.OBJ:$(KERNEL)/drivers/fm801.asm \
drivers/infinity.obj:DRIVERS/INFINITY.OBJ:$(KERNEL)/drivers/infinity.asm \
drivers/sound.obj:DRIVERS/SOUND.OBJ:$(KERNEL)/drivers/sound.asm \
drivers/intelac97.obj:DRIVERS/INTELAC97.OBJ:$(KERNEL)/drivers/intelac97.asm \
drivers/vt823x.obj:DRIVERS/VT823X.OBJ:$(KERNEL)/drivers/vt823x.asm \
drivers/3c59x.obj:DRIVERS/3C59X.OBJ:$(REPOSITORY)/drivers/ethernet/3c59x.asm \
@ -230,6 +229,7 @@ FASM_PROGRAMS_PESTRIP:=\
drivers/tmpdisk.sys:DRIVERS/TMPDISK.SYS:$(REPOSITORY)/drivers/disk/tmpdisk.asm \
drivers/intel_hda.sys:DRIVERS/intel_hda.sys:$(REPOSITORY)/drivers/audio/intel_hda/intel_hda.asm \
drivers/sb16.sys:DRIVERS/SB16.SYS:$(REPOSITORY)/drivers/audio/sb16/sb16.asm \
drivers/sound.sys:DRIVERS/SOUND.SYS:$(REPOSITORY)/drivers/audio/sound.asm \
# end of list
# The list of all FASM programs with one main FASM file for CD image.
# Format of an item is exactly the same as in the previous list.

View File

@ -5,14 +5,16 @@
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
format MS COFF
format PE DLL native 0.05
entry START
DEBUG = 1
DEBUG = 1
include 'proc32.inc'
include 'imports.inc'
section '.flat' code readable writable executable
include '../proc32.inc'
include '../struct.inc'
include '../macros.inc'
include '../peimport.inc'
VID_INTEL = 0x8086
VID_NVIDIA = 0x10DE
@ -145,12 +147,6 @@ CTRL_RDC_R3010 = 0x3010
CTRL_VMWARE_UNK1 = 0x1977
API_VERSION = 0x01000100
public START
public service_proc
public version
struct SRV
srv_name rb 16 ;ASCIIZ string
magic dd ? ;+0x10 ;'SRV '
@ -164,17 +160,14 @@ struct SRV
ends
section '.flat' code readable align 16
proc START c, state:dword, cmdline:dword
proc START stdcall, state:dword
mov eax, [srv_entry]
cmp [state], 1
jne .stop
if DEBUG
mov esi, msgInit
call SysMsgBoardStr
invoke SysMsgBoardStr
end if
test eax, eax
@ -191,26 +184,24 @@ proc START stdcall, state:dword
ret
endp
align 4
proc service_proc stdcall, ioctl:dword
or eax, -1
ret
endp
align 4
proc detect_controller
locals
last_bus dd ?
bus dd ?
devfn dd ?
endl
locals
last_bus dd ?
bus dd ?
devfn dd ?
endl
xor eax, eax
mov [bus], eax
inc eax
call PciApi
invoke PciApi
cmp eax, -1
je .err
@ -219,7 +210,7 @@ proc detect_controller
.next_bus:
and [devfn], 0
.next_dev:
stdcall PciRead32, [bus], [devfn], dword 0
invoke PciRead32, [bus], [devfn], dword 0
test eax, eax
jz .next
cmp eax, -1
@ -250,16 +241,16 @@ proc detect_controller
if DEBUG
mov esi, msgLoading
call SysMsgBoardStr
invoke SysMsgBoardStr
mov esi, dword[edi+4]
call SysMsgBoardStr
invoke SysMsgBoardStr
mov esi, msgNewline
call SysMsgBoardStr
invoke SysMsgBoardStr
end if
stdcall GetService, dword[edi+4]
invoke GetService, dword[edi+4]
test eax, eax
jz .err
@ -270,7 +261,7 @@ proc detect_controller
.err:
if DEBUG
mov esi, msgFail
call SysMsgBoardStr
invoke SysMsgBoardStr
end if
xor eax, eax
@ -399,11 +390,9 @@ devices dd (CTRL_ICH shl 16)+VID_INTEL, intelac97
; VMware
dd (CTRL_VMWARE_UNK1 shl 16)+VID_VMWARE, intelhda
dd 0 ;terminator
dd 0 ; terminator
version dd (5 shl 16) or (API_VERSION and 0xFFFF)
srv_entry dd 0
intelac97 db 'INTELAC97', 0
@ -419,5 +408,6 @@ msgFail db 'No compatible soundcard found!',13,10,0
msgLoading db 'Loading ',0
msgNewline db 13,10,0
section '.data' data readable writable align 16
align 4
data fixups
end data