flat assembler
Message board for the users of flat assembler.
Index
> DOS > How interfacing with PCI-soundcards under bare DOS? Goto page 1, 2 Next |
Author |
|
Tomasz Grysztar 23 Aug 2004, 18:40
Everything depends on what chipset is on the PCI card you want to access. For accessing PCI you can use BIOS functions, though I prefer to do it directly (ports 0CF8h-0CFCh, they are described in Ralf's ports list).
As for the sound chips specifications you can look for them in the internet, but in most cases it is unlikely you will find any, because this info is generally kept proprietary (I really don't know what is the reasoning for this). Though I was able to find the specification for ES1371 chip (the CT5880, which is compatible with ES1371, was used by "Sound Blaster 4.1" PCI cards) through Google. Last edited by Tomasz Grysztar on 23 Aug 2004, 18:51; edited 3 times in total |
|||
23 Aug 2004, 18:40 |
|
Tomasz Grysztar 23 Aug 2004, 18:47
Below is the sample of functions you can use to access the PCI devices.
You need to know the "Vendor ID" and "Device ID" of the chip you want to programm - if you've got the specification, it will be stated there. From the the address 10h in PCI configuration space for given device you can read the number of base port where the device-specific registers are mapped. At address 3Ch in PCI configuration the number of IRQ assigned to the device is stored. Hope this helps. Code: find_PCI_device: ; AX = vendor ID ; BX = device ID ; returns: BH = PCI bus, BL = PCI device/function shl ebx,16 mov bx,ax mov ebp,ebx mov bh,0 ; scan bus 0 first scan_PCI_bus: mov bl,0 ; begin from device 0, function 0 try_PCI_device: mov ax,0 call read_PCI_configuration cmp eax,ebp je PCI_device_found inc bl jnz try_PCI_device inc bh cmp bh,16 ; try 16 buses (change if needed) jne scan_PCI_bus stc ; device not found ret PCI_device_found: clc ret read_PCI_configuration: ; BH = PCI bus ; BL = PCI device/function ; AL = address of register ; returns: EAX = value of register mov cl,al and cl,11b ; store offset within double word and al,not 11b ; align address to double word mov dx,bx shl edx,8 mov dl,al mov eax,80000000h or eax,edx mov dx,0CF8h out dx,eax ; map double word at 0CFCh mov dx,0CFCh add dl,cl ; calculate address of mapped register in eax,dx ret |
|||
23 Aug 2004, 18:47 |
|
MCD 23 Aug 2004, 18:56
It's always a bit the same. Standards for newer stuff is always "proprietary". Basically, that's OK, but, as you said it, there is no use "Proprietaring" a standard like the soundcard one, it would cause noone any harm, since even the PCI-soundcard-standard is somewhat outdated.
Well, I already tried accessing a Sounblaster 16PCI on an ASUS P2B-board and my onboard 6.1-Soundcard on an NForce2 board via interrupts (don't know exactly if it was 15h or 1Ah) and raw Ports (0C8Xh). I even debugged an originally creative Soundblaster 16PCI-driver for DOS (which actually didn't work too). All 3 methods reported the same error, something like "PCI-BUS inaccessible", whereas it workes fine under Windows 98(no PCI-problems here). Additionally, I keep asking myself if there's not a simular way accessing USB-devices under DOS, perhaps via EDD functions on interrupt 13h, but it doesn't seem to work neither on my computer. |
|||
23 Aug 2004, 18:56 |
|
MCD 23 Aug 2004, 19:00
thanks, I think I should give it a try.
|
|||
23 Aug 2004, 19:00 |
|
ASHLEY4 23 Aug 2004, 19:27
Here is a link to some asm code for the AC97 chip set, which is on a lot of moden soundcard's, it's a wav player with built in driver for the above chip.
You can get it here: http://www.programmersheaven.com/zone10/cat592/23237.htm \\\\||//// (@@) ASHLEY4. |
|||
23 Aug 2004, 19:27 |
|
Bitdog 05 Sep 2004, 05:38
A nutty thought is:
Since MS wants to rule the world/$ they have cahoots with vendors and made PLUG 'N PLAY So, arn't those config files for each and every DEVICE hackable ? And, why haven't they been?????????? What's the key to PLUG 'N PLAY that us DOS folks haven't got yet ? |
|||
05 Sep 2004, 05:38 |
|
Tomasz Grysztar 05 Sep 2004, 08:13
You still need a drivers, even po so called PnP devices.
|
|||
05 Sep 2004, 08:13 |
|
MCD 15 Sep 2004, 15:38
That's rigth. I know how to get addresses/memory mapped registers and timings from the config ports/BIOS, but I have no idea how to use them, what to write when to them.
|
|||
15 Sep 2004, 15:38 |
|
ASHLEY4 16 Sep 2004, 09:06
MCD , I am working on sound card dev, for my OS and do a lot of my testing on dos.
Most onboard sound and some sound card's use the same codec, and can be made to work from the same basic driver, i have about 12 pc some new and some old, but i can get most working with SB16 compatable or AC97 compatable. So if you send me your soundcard or onboard sound type, i may be able to help ?. \\\\||//// (@@) ASHLEY4. |
|||
16 Sep 2004, 09:06 |
|
MCD 17 Sep 2004, 12:43
Quote:
This is a great little tool! Quote:
Actually, I'm using the onboard sound chipset of the Shuttle AN35-Ultra which uses the NVidia NForce2 Ultra 400 (very nice board, good compatibility, good price, VERY robust and tremendous performance=>Don't mind me, but besides DOS-programming, I'm also gaming laming under Windows). I think this sound device is actually AC97 or SB16 PCI compatible. It currently uses the following PCI-configurations: I/O addresses: 0D400h (128 or 256byte length) 0D800h (128 or 256byte length) Memory mapped registers: 0DA000000h (I think it was 4096byte length, not sure) device class:00000401 PCI stuff: vendor: 10DE (NVidia Corporation) device: 006A revision: A1 specific stuff: bus: 00 device: 06 func: 00 _________________ MCD - the inevitable return of the Mad Computer Doggy -||__/ .|+-~ .|| || |
|||
17 Sep 2004, 12:43 |
|
ASHLEY4 17 Sep 2004, 18:09
Give me a day or two and i will make a test program for your sound card.
Your onboard sound, does look like it's based on the ac97 chip, but some cards that are based on the ac97, just do not work as they should my "vt82c686" is like that. \\\\||//// (@@) ASHLEY4. |
|||
17 Sep 2004, 18:09 |
|
Matrix 16 Nov 2004, 23:20
do you really need to access your video hardware that way?
soundcards usually have a base address, ex.: 0x220 and a DMA like : 5 a sampling rate, bit depth 8/16/24 bits you have seperate MIDI port, and ADLIB is working on each SB card |
|||
16 Nov 2004, 23:20 |
|
bubach 17 Nov 2004, 08:56
here's some stuff about adlib/soundblaster that i found with google in less then 5 min..
http://alexfru.narod.ru/miscdocs/pcgpe1/pcgpe1.zip http://alexfru.narod.ru/miscdocs/sb/sbprog.zip http://www.dcee.net/Files/Programm/Demos/pgloader.zip http://www.programmersheaven.com/zone10/cat586/6356.htm Last edited by bubach on 03 May 2005, 08:18; edited 1 time in total |
|||
17 Nov 2004, 08:56 |
|
tmssux 20 Nov 2004, 14:41
ASHLEY4 wrote: Here is a link to some asm code for the AC97 chip set, which is on a lot of moden soundcard's, it's a wav player with built in driver for the above chip. Quote: Error: Unable to find intel ICH2 based audio device! |
|||
20 Nov 2004, 14:41 |
|
ASHLEY4 20 Nov 2004, 17:02
Try http://board.flatassembler.net/topic.php?t=2353&start=25 and get ichinit.zip
it does more vendors. \\\\||//// (@@) ASHLEY4. Batteries not included, Some assembly required. |
|||
20 Nov 2004, 17:02 |
|
deltre 30 Apr 2005, 10:50
I found this link for PCI devices/vendors which seems to be quite complete (found what i needed):
http://www.pcidatabase.com/ |
|||
30 Apr 2005, 10:50 |
|
THEWizardGenius 22 May 2005, 21:45
Maybe this should be in a separate topic, but I haven't found any documents online at all related to programming PCI things in general. Anything I've found assumes previous knowledge in dealing with PCI cards, of which I have none. Does anyone know where to find out about this? I've found plenty about PCI vendor ID's, device ID's, etc., but nothing about programming PCI. Ralf's list is great, but it doesn't give me a whole lot of information about programming- it's only a reference doc, not a tutorial or guide. Does anyone know how it works?
|
|||
22 May 2005, 21:45 |
|
MCD 23 May 2005, 11:12
THEWizardGenius wrote: Maybe this should be in a separate topic, but I haven't found any documents online at all related to programming PCI things in general. Anything I've found assumes previous knowledge in dealing with PCI cards, of which I have none. Does anyone know where to find out about this? I've found plenty about PCI vendor ID's, device ID's, etc., but nothing about programming PCI. Ralf's list is great, but it doesn't give me a whole lot of information about programming- it's only a reference doc, not a tutorial or guide. Does anyone know how it works? You seem to have exactly the same problem than me. Actually, the only source I know for getting infos about each actual PCI device driver programming are the linux drivers sources, but you will have to hand convert them all from C into Fasm |
|||
23 May 2005, 11:12 |
|
shaolin007 23 May 2005, 14:14
I was working on a sound blaster compatible DOS driver that was going to work on my computer at home but I had trouble accessing my soundcard because it was a Aureal Vortex2 soundcard. But at the computer at work it worked on and I think the computer at work is configured as PCI bus 0, device 31, function 5. If so, then you could use the standard SB ports to program the DSP, Mixer, and Midi. The guide I have is here
http://www.cs.ucla.edu/~kohler/class/04f-aos/ref/hardware/SoundBlaster.pdf |
|||
23 May 2005, 14:14 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.