fix SB16 driver broken in r3727, convert to PE
git-svn-id: svn://kolibrios.org@5057 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0ede580d2f
commit
727d1c9b53
@ -131,7 +131,6 @@ FASM_PROGRAMS:=\
|
|||||||
drivers/emu10k1x.obj:DRIVERS/EMU10K1X.OBJ:$(KERNEL)/drivers/emu10k1x.asm \
|
drivers/emu10k1x.obj:DRIVERS/EMU10K1X.OBJ:$(KERNEL)/drivers/emu10k1x.asm \
|
||||||
drivers/fm801.obj:DRIVERS/FM801.OBJ:$(KERNEL)/drivers/fm801.asm \
|
drivers/fm801.obj:DRIVERS/FM801.OBJ:$(KERNEL)/drivers/fm801.asm \
|
||||||
drivers/infinity.obj:DRIVERS/INFINITY.OBJ:$(KERNEL)/drivers/infinity.asm \
|
drivers/infinity.obj:DRIVERS/INFINITY.OBJ:$(KERNEL)/drivers/infinity.asm \
|
||||||
drivers/sb16.obj:DRIVERS/SB16.OBJ:$(KERNEL)/drivers/sb16/sb16.asm \
|
|
||||||
drivers/sound.obj:DRIVERS/SOUND.OBJ:$(KERNEL)/drivers/sound.asm \
|
drivers/sound.obj:DRIVERS/SOUND.OBJ:$(KERNEL)/drivers/sound.asm \
|
||||||
drivers/intelac97.obj:DRIVERS/INTELAC97.OBJ:$(KERNEL)/drivers/intelac97.asm \
|
drivers/intelac97.obj:DRIVERS/INTELAC97.OBJ:$(KERNEL)/drivers/intelac97.asm \
|
||||||
drivers/vt823x.obj:DRIVERS/VT823X.OBJ:$(KERNEL)/drivers/vt823x.asm \
|
drivers/vt823x.obj:DRIVERS/VT823X.OBJ:$(KERNEL)/drivers/vt823x.asm \
|
||||||
@ -230,6 +229,7 @@ FASM_PROGRAMS_PESTRIP:=\
|
|||||||
drivers/ps2mouse.sys:DRIVERS/PS2MOUSE.SYS:$(REPOSITORY)/drivers/mouse/ps2mouse4d/trunk/ps2mouse.asm \
|
drivers/ps2mouse.sys:DRIVERS/PS2MOUSE.SYS:$(REPOSITORY)/drivers/mouse/ps2mouse4d/trunk/ps2mouse.asm \
|
||||||
drivers/tmpdisk.sys:DRIVERS/TMPDISK.SYS:$(REPOSITORY)/drivers/disk/tmpdisk.asm \
|
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/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 \
|
||||||
# end of list
|
# end of list
|
||||||
# The list of all FASM programs with one main FASM file for CD image.
|
# 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.
|
# Format of an item is exactly the same as in the previous list.
|
||||||
|
@ -12,18 +12,6 @@ use_cli_sti equ 1 ;driver become more stable (theoretically)
|
|||||||
;constants--------------------------------------------------------
|
;constants--------------------------------------------------------
|
||||||
API_VERSION equ 0 ;debug
|
API_VERSION equ 0 ;debug
|
||||||
|
|
||||||
OS_BASE equ 0x80000000
|
|
||||||
new_app_base equ 0x0
|
|
||||||
PROC_BASE equ (OS_BASE+0x080000)
|
|
||||||
SB16Buffer equ (OS_BASE+0x2A0000)
|
|
||||||
SB16_Status equ (OS_BASE+0x2B0000)
|
|
||||||
DMAPage equ ((SB16Buffer-OS_BASE) shr 16)
|
|
||||||
|
|
||||||
SB16Buffer0 equ SB16Buffer
|
|
||||||
SB16Buffer1 equ (SB16Buffer+16384)
|
|
||||||
SB16Buffer2 equ (SB16Buffer+(2*16384))
|
|
||||||
SB16Buffer3 equ (SB16Buffer+(3*16384))
|
|
||||||
|
|
||||||
sb_irq_num equ 5 ;default values for SB16, may be overrided by autodetect
|
sb_irq_num equ 5 ;default values for SB16, may be overrided by autodetect
|
||||||
sb_dma_num equ 5 ;default values for SB16, may be overrided by autodetect
|
sb_dma_num equ 5 ;default values for SB16, may be overrided by autodetect
|
||||||
|
|
@ -17,7 +17,7 @@ sb_set_dma:
|
|||||||
.dma_setup_error:
|
.dma_setup_error:
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgErrDMAsetup
|
mov esi, msgErrDMAsetup
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
mov dword[esp], START.stop
|
mov dword[esp], START.stop
|
||||||
ret
|
ret
|
||||||
@ -33,16 +33,20 @@ end if
|
|||||||
lea eax, [ebx+0x58];auto-init mode for channel (ebx)
|
lea eax, [ebx+0x58];auto-init mode for channel (ebx)
|
||||||
out 0xB, al;DMA channel 0-3 mode register
|
out 0xB, al;DMA channel 0-3 mode register
|
||||||
|
|
||||||
|
mov eax, [SB16Buffer]
|
||||||
|
invoke GetPhysAddr
|
||||||
|
mov ecx, eax
|
||||||
|
shr eax, 16
|
||||||
|
|
||||||
movzx edx, byte[ebx+dma_table];page register
|
movzx edx, byte[ebx+dma_table];page register
|
||||||
mov al, DMAPage
|
|
||||||
out dx, al
|
out dx, al
|
||||||
|
|
||||||
lea edx, [ebx*2];DMA channel 0-3 base address
|
lea edx, [ebx*2];DMA channel 0-3 base address
|
||||||
|
|
||||||
mov al, 0;LSB is 0
|
mov al, cl;LSB
|
||||||
out dx, al
|
out dx, al
|
||||||
|
|
||||||
; mov al,0 ;MSB is 0 too
|
mov al, ch;MSB
|
||||||
out dx, al
|
out dx, al
|
||||||
|
|
||||||
inc edx ;DMA channel 0-3 byte count
|
inc edx ;DMA channel 0-3 byte count
|
||||||
@ -78,16 +82,21 @@ end if
|
|||||||
lea eax, [ebx+0x58];auto-init mode for channel (ebx+4)
|
lea eax, [ebx+0x58];auto-init mode for channel (ebx+4)
|
||||||
out 0xD6, al;DMA channel 4-7 mode register
|
out 0xD6, al;DMA channel 4-7 mode register
|
||||||
|
|
||||||
|
mov eax, [SB16Buffer]
|
||||||
|
invoke GetPhysAddr
|
||||||
|
mov ecx, eax
|
||||||
|
shr eax, 16
|
||||||
|
shr ecx, 1 ; 16-bit DMA takes offset in words
|
||||||
|
|
||||||
movzx edx, byte[ebx+dma_table+4];page register
|
movzx edx, byte[ebx+dma_table+4];page register
|
||||||
mov al, DMAPage
|
|
||||||
out dx, al
|
out dx, al
|
||||||
|
|
||||||
lea edx, [ebx*4+0xC0];DMA channel 4-7 base address
|
lea edx, [ebx*4+0xC0];DMA channel 4-7 base address
|
||||||
|
|
||||||
mov al, 0;LSB is 0 ;for 16bit DMA this contains
|
mov al, cl;LSB;for 16bit DMA this contains
|
||||||
out dx, al;A1-A8 lines of address bus, A0 is zero
|
out dx, al;A1-A8 lines of address bus, A0 is zero
|
||||||
|
|
||||||
; mov al,0 ;MSB is 0 too ;for 16bit DMA this contains
|
mov al, ch;MSB;for 16bit DMA this contains
|
||||||
out dx, al;A9-A16 lines of address bus
|
out dx, al;A9-A16 lines of address bus
|
||||||
|
|
||||||
inc edx
|
inc edx
|
@ -1,49 +1,32 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
|
||||||
;; Distributed under terms of the GNU General Public License ;;
|
;; Distributed under terms of the GNU General Public License ;;
|
||||||
;; ;;
|
;; ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
format MS COFF
|
format PE DLL native 0.05
|
||||||
|
entry START
|
||||||
|
|
||||||
include 'CONFIG.INC'
|
include 'CONFIG.INC'
|
||||||
|
|
||||||
;structs----------------------------------------------------------
|
section '.flat' code readable writable executable
|
||||||
struc IOCTL
|
include '..\..\struct.inc'
|
||||||
{ .handle dd ?
|
include '..\..\macros.inc'
|
||||||
.io_code dd ?
|
include '..\..\proc32.inc'
|
||||||
.input dd ?
|
include '..\..\peimport.inc'
|
||||||
.inp_size dd ?
|
|
||||||
.output dd ?
|
|
||||||
.out_size dd ?
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual at 0
|
|
||||||
IOCTL IOCTL
|
|
||||||
end virtual
|
|
||||||
|
|
||||||
;something--------------------------------------------------------
|
|
||||||
public START
|
|
||||||
public service_proc
|
|
||||||
public version
|
|
||||||
|
|
||||||
include '..\proc32.inc'
|
|
||||||
include '..\imports.inc'
|
|
||||||
|
|
||||||
section '.flat' code readable align 16
|
|
||||||
|
|
||||||
include 'SB16.INC'
|
include 'SB16.INC'
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
proc START stdcall, state:dword
|
proc START c uses ebx esi edi, state:dword, cmdline:dword
|
||||||
cmp [state], 1
|
cmp [state], 1
|
||||||
jne .stop
|
jne .stop
|
||||||
.entry:
|
.entry:
|
||||||
|
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgInit
|
mov esi, msgInit
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
|
|
||||||
call detect ;returns DSP version or zero if
|
call detect ;returns DSP version or zero if
|
||||||
@ -64,35 +47,39 @@ if DEBUG
|
|||||||
mov dword[esi], '16 '
|
mov dword[esi], '16 '
|
||||||
.sb_say_about_found_dsp:
|
.sb_say_about_found_dsp:
|
||||||
mov esi, msgDSPFound
|
mov esi, msgDSPFound
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
|
|
||||||
xor ebx, ebx
|
xor ebx, ebx
|
||||||
mov ecx, [sb_base_port]
|
mov ecx, [sb_base_port]
|
||||||
lea edx, [ecx+0xF]
|
lea edx, [ecx+0xF]
|
||||||
call ReservePortArea ;these ports must be mine !
|
invoke ReservePortArea ;these ports must be mine !
|
||||||
|
|
||||||
dec eax
|
dec eax
|
||||||
jnz @f
|
jnz @f
|
||||||
|
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgErrRsrvPorts
|
mov esi, msgErrRsrvPorts
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
jmp .exit
|
jmp .exit
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
|
invoke AllocDMA24, sb_buffer_size
|
||||||
|
test eax, eax
|
||||||
|
jz .exit
|
||||||
|
mov [SB16Buffer], eax
|
||||||
|
|
||||||
call sb_setup ;clock it, etc
|
call sb_setup ;clock it, etc
|
||||||
|
|
||||||
stdcall AttachIntHandler, sb_irq_num, sb_irq, 0
|
invoke AttachIntHandler, sb_irq_num, sb_irq, 0
|
||||||
|
|
||||||
if DEBUG
|
if DEBUG
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jnz @f
|
jnz @f
|
||||||
|
|
||||||
mov esi, msgErrAtchIRQ
|
mov esi, msgErrAtchIRQ
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
|
|
||||||
; stdcall GetIntHandler, sb_irq_num
|
; stdcall GetIntHandler, sb_irq_num
|
||||||
; call SysMsgBoardNum
|
; call SysMsgBoardNum
|
||||||
@ -100,9 +87,9 @@ if DEBUG
|
|||||||
jmp .stop
|
jmp .stop
|
||||||
@@:
|
@@:
|
||||||
mov esi, msgSucAtchIRQ
|
mov esi, msgSucAtchIRQ
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
stdcall RegService, my_service, service_proc
|
invoke RegService, my_service, service_proc
|
||||||
ret
|
ret
|
||||||
.stop:
|
.stop:
|
||||||
call sb_reset
|
call sb_reset
|
||||||
@ -110,7 +97,7 @@ end if
|
|||||||
|
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgExit
|
mov esi, msgExit
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -118,22 +105,14 @@ end if
|
|||||||
endp
|
endp
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
handle equ IOCTL.handle
|
proc service_proc stdcall uses ebx esi edi, ioctl:dword
|
||||||
io_code equ IOCTL.io_code
|
|
||||||
input equ IOCTL.input
|
|
||||||
inp_size equ IOCTL.inp_size
|
|
||||||
output equ IOCTL.output
|
|
||||||
out_size equ IOCTL.out_size
|
|
||||||
|
|
||||||
align 4
|
|
||||||
proc service_proc stdcall, ioctl:dword
|
|
||||||
mov edi, [ioctl]
|
mov edi, [ioctl]
|
||||||
mov eax, [edi+io_code]
|
mov eax, [edi+IOCTL.io_code]
|
||||||
cmp eax, SRV_GETVERSION
|
cmp eax, SRV_GETVERSION
|
||||||
jne @F
|
jne @F
|
||||||
|
|
||||||
mov eax, [edi+output]
|
mov eax, [edi+IOCTL.output]
|
||||||
cmp [edi+out_size], 4
|
cmp [edi+IOCTL.out_size], 4
|
||||||
jne .fail
|
jne .fail
|
||||||
mov [eax], dword API_VERSION
|
mov [eax], dword API_VERSION
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -143,7 +122,7 @@ proc service_proc stdcall, ioctl:dword
|
|||||||
jne @f
|
jne @f
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgPlay
|
mov esi, msgPlay
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
call sb_stop ;to play smth new we must stop smth old
|
call sb_stop ;to play smth new we must stop smth old
|
||||||
|
|
||||||
@ -171,9 +150,9 @@ end if
|
|||||||
jne @f
|
jne @f
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgCallback
|
mov esi, msgCallback
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
mov edi, [edi+input]
|
mov edi, [edi+IOCTL.input]
|
||||||
mov eax, [edi]
|
mov eax, [edi]
|
||||||
mov [callback], eax
|
mov [callback], eax
|
||||||
if DEBUG
|
if DEBUG
|
||||||
@ -188,9 +167,9 @@ end if
|
|||||||
|
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgSetVol
|
mov esi, msgSetVol
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
mov eax, [edi+input]
|
mov eax, [edi+IOCTL.input]
|
||||||
mov eax, [eax]
|
mov eax, [eax]
|
||||||
call sb_set_master_vol
|
call sb_set_master_vol
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -200,9 +179,9 @@ end if
|
|||||||
jne @F
|
jne @F
|
||||||
if DEBUG
|
if DEBUG
|
||||||
mov esi, msgGetVol
|
mov esi, msgGetVol
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
end if
|
end if
|
||||||
mov eax, [edi+output]
|
mov eax, [edi+IOCTL.output]
|
||||||
mov edx, [sb_master_vol]
|
mov edx, [sb_master_vol]
|
||||||
mov [eax], edx
|
mov [eax], edx
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -213,15 +192,7 @@ end if
|
|||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
restore handle
|
|
||||||
restore io_code
|
|
||||||
restore input
|
|
||||||
restore inp_size
|
|
||||||
restore output
|
|
||||||
restore out_size
|
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
align 4
|
|
||||||
proc sb_irq
|
proc sb_irq
|
||||||
mov edx, [sb_base_port];tell the DSP that we have processed IRQ
|
mov edx, [sb_base_port];tell the DSP that we have processed IRQ
|
||||||
add dl, 0xF ;0xF for 16 bit sound, 0xE for 8 bit sound
|
add dl, 0xF ;0xF for 16 bit sound, 0xE for 8 bit sound
|
||||||
@ -235,10 +206,15 @@ pre_fill_data:
|
|||||||
jns .fill_second_half
|
jns .fill_second_half
|
||||||
|
|
||||||
if sb_buffer_size eq small_buffer
|
if sb_buffer_size eq small_buffer
|
||||||
stdcall [callback], SB16Buffer0 ;for 32k buffer
|
mov eax, [SB16Buffer]
|
||||||
|
stdcall [callback], eax ;for 32k buffer
|
||||||
else if sb_buffer_size eq full_buffer
|
else if sb_buffer_size eq full_buffer
|
||||||
stdcall [callback], SB16Buffer0 ;for 64k buffer
|
mov eax, [SB16Buffer]
|
||||||
stdcall [callback], SB16Buffer1 ;for 64k buffer
|
push eax
|
||||||
|
stdcall [callback], eax ;for 64k buffer
|
||||||
|
pop eax
|
||||||
|
add eax, 16384
|
||||||
|
stdcall [callback], eax ;for 64k buffer
|
||||||
end if
|
end if
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
not eax
|
not eax
|
||||||
@ -246,10 +222,17 @@ end if
|
|||||||
|
|
||||||
.fill_second_half:
|
.fill_second_half:
|
||||||
if sb_buffer_size eq small_buffer
|
if sb_buffer_size eq small_buffer
|
||||||
stdcall [callback], SB16Buffer1 ;for 32k buffer
|
mov eax, [SB16Buffer]
|
||||||
|
add eax, 16384
|
||||||
|
stdcall [callback], eax ;for 32k buffer
|
||||||
else if sb_buffer_size eq full_buffer
|
else if sb_buffer_size eq full_buffer
|
||||||
stdcall [callback], SB16Buffer2 ;for 64k buffer
|
mov eax, [SB16Buffer]
|
||||||
stdcall [callback], SB16Buffer3 ;for 64k buffer
|
add eax, 32768
|
||||||
|
push eax
|
||||||
|
stdcall [callback], eax ;for 64k buffer
|
||||||
|
pop eax
|
||||||
|
add eax, 16384
|
||||||
|
stdcall [callback], eax ;for 64k buffer
|
||||||
end if
|
end if
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
not eax
|
not eax
|
||||||
@ -288,7 +271,7 @@ end if
|
|||||||
.sb_card_found:
|
.sb_card_found:
|
||||||
and dl, 0xF0
|
and dl, 0xF0
|
||||||
add dl, 0xC
|
add dl, 0xC
|
||||||
sb_out 0xE1 ;get DSP version
|
sb_out 0xE1 ;get DSP version
|
||||||
add dl, 2
|
add dl, 2
|
||||||
@@:
|
@@:
|
||||||
in al, dx
|
in al, dx
|
||||||
@ -337,13 +320,12 @@ proc SysMsgBoardNum ;warning: destroys eax,ebx,ecx,esi
|
|||||||
shr ebx, 4
|
shr ebx, 4
|
||||||
loop .1
|
loop .1
|
||||||
dec esi
|
dec esi
|
||||||
call SysMsgBoardStr
|
invoke SysMsgBoardStr
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
end if
|
end if
|
||||||
;all initialized data place here
|
;all initialized data place here
|
||||||
align 4
|
align 4
|
||||||
version dd (5 shl 16) or (API_VERSION and 0xFFFF)
|
|
||||||
|
|
||||||
sb_base_port:
|
sb_base_port:
|
||||||
dd 200h ;don't ask me why - see the code&docs
|
dd 200h ;don't ask me why - see the code&docs
|
||||||
@ -384,10 +366,12 @@ sb_DSP_description:
|
|||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
end if
|
end if
|
||||||
|
|
||||||
section '.data' data readable writable align 16
|
align 4
|
||||||
;all uninitialized data place here
|
data fixups
|
||||||
|
end data
|
||||||
|
|
||||||
;pTempBuf rd 1
|
align 4
|
||||||
|
SB16Buffer rd 1
|
||||||
|
|
||||||
callback rd 1
|
callback rd 1
|
||||||
|
|
@ -96,6 +96,7 @@ import core,\
|
|||||||
Kmalloc,\
|
Kmalloc,\
|
||||||
Kfree,\
|
Kfree,\
|
||||||
CreateRingBuffer,\
|
CreateRingBuffer,\
|
||||||
|
AllocDMA24,\
|
||||||
\
|
\
|
||||||
GetPid,\
|
GetPid,\
|
||||||
CreateThread,\
|
CreateThread,\
|
||||||
|
@ -22,11 +22,6 @@ ramdisk_functions:
|
|||||||
.size = $ - ramdisk_functions
|
.size = $ - ramdisk_functions
|
||||||
endg
|
endg
|
||||||
|
|
||||||
; See memmap.inc.
|
|
||||||
; Currently size of memory allocated for the ramdisk is fixed.
|
|
||||||
; This should be revisited when/if memory map would become more dynamic.
|
|
||||||
RAMDISK_CAPACITY = 2880 ; in sectors
|
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
align 4
|
align 4
|
||||||
ramdisk_actual_size dd RAMDISK_CAPACITY
|
ramdisk_actual_size dd RAMDISK_CAPACITY
|
||||||
|
@ -228,10 +228,6 @@ VGABasePtr equ (OS_BASE+0x00A0000)
|
|||||||
CLEAN_ZONE equ (_CLEAN_ZONE-OS_BASE)
|
CLEAN_ZONE equ (_CLEAN_ZONE-OS_BASE)
|
||||||
IDE_DMA equ (_IDE_DMA-OS_BASE)
|
IDE_DMA equ (_IDE_DMA-OS_BASE)
|
||||||
|
|
||||||
; unused?
|
|
||||||
SB16Buffer equ (OS_BASE+0x02A0000)
|
|
||||||
SB16_Status equ (OS_BASE+0x02B0000)
|
|
||||||
|
|
||||||
UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000)
|
UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000)
|
||||||
|
|
||||||
virtual at (OS_BASE+0x05FFF80)
|
virtual at (OS_BASE+0x05FFF80)
|
||||||
|
@ -48,6 +48,7 @@ __exports:
|
|||||||
get_phys_addr, 'GetPhysAddr', \ ; eax
|
get_phys_addr, 'GetPhysAddr', \ ; eax
|
||||||
map_space, 'MapSpace', \
|
map_space, 'MapSpace', \
|
||||||
release_pages, 'ReleasePages', \
|
release_pages, 'ReleasePages', \
|
||||||
|
alloc_dma24, 'AllocDMA24', \ ; stdcall
|
||||||
\
|
\
|
||||||
mutex_init, 'MutexInit', \ ; gcc fastcall
|
mutex_init, 'MutexInit', \ ; gcc fastcall
|
||||||
mutex_lock, 'MutexLock', \ ; gcc fastcall
|
mutex_lock, 'MutexLock', \ ; gcc fastcall
|
||||||
|
@ -350,6 +350,31 @@ proc map_page_table stdcall, lin_addr:dword, phis_addr:dword
|
|||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
uglobal
|
||||||
|
sb16_buffer_allocated db 0
|
||||||
|
endg
|
||||||
|
|
||||||
|
; Allocates [.size] bytes so that the target memory block
|
||||||
|
; is inside one 64K page for 24-bit DMA controller,
|
||||||
|
; that is, somewhere between 00xx0000h and 00xxFFFFh.
|
||||||
|
proc alloc_dma24
|
||||||
|
; Implementation note.
|
||||||
|
; The only user of that function is SB16 driver,
|
||||||
|
; so just return a statically allocated buffer.
|
||||||
|
virtual at esp
|
||||||
|
dd ? ; return address
|
||||||
|
.size dd ?
|
||||||
|
end virtual
|
||||||
|
cmp [sb16_buffer_allocated], 0
|
||||||
|
jnz .fail
|
||||||
|
inc [sb16_buffer_allocated]
|
||||||
|
mov eax, SB16Buffer
|
||||||
|
ret 4
|
||||||
|
.fail:
|
||||||
|
xor eax, eax
|
||||||
|
ret 4
|
||||||
|
endp
|
||||||
|
|
||||||
; Allocates a physical page for master page table
|
; Allocates a physical page for master page table
|
||||||
; that duplicates first Mb of OS_BASE at address 0;
|
; that duplicates first Mb of OS_BASE at address 0;
|
||||||
; used for starting APs and for shutting down,
|
; used for starting APs and for shutting down,
|
||||||
|
@ -523,16 +523,21 @@ end if
|
|||||||
|
|
||||||
org (OS_BASE+0x0100000)
|
org (OS_BASE+0x0100000)
|
||||||
|
|
||||||
RAMDISK: rb 2880*512
|
; Currently size of memory allocated for the ramdisk is fixed.
|
||||||
rb 2856*4 ; not used
|
; This should be revisited when/if memory map would become more dynamic.
|
||||||
|
RAMDISK_CAPACITY = 2880 ; in sectors
|
||||||
|
|
||||||
|
RAMDISK: rb RAMDISK_CAPACITY*512
|
||||||
|
|
||||||
_CLEAN_ZONE:
|
_CLEAN_ZONE:
|
||||||
|
|
||||||
|
BgrAuxTable rb 32768
|
||||||
|
align 65536
|
||||||
|
SB16Buffer rb 65536
|
||||||
|
|
||||||
align 4096
|
align 4096
|
||||||
_IDE_DMA rb 16*512
|
_IDE_DMA rb 16*512
|
||||||
BgrAuxTable rb 32768
|
|
||||||
BUTTON_INFO rb 64*1024
|
BUTTON_INFO rb 64*1024
|
||||||
RESERVED_PORTS: rb 64*1024
|
RESERVED_PORTS: rb 64*1024
|
||||||
FLOPPY_BUFF: rb 18*512 ;one track
|
|
||||||
|
|
||||||
sys_pgmap: rb 1024*1024/8
|
sys_pgmap: rb 1024*1024/8
|
||||||
|
Loading…
Reference in New Issue
Block a user