Hello!
I dealt with learning the basics and have done quite a lot since then.
My next step is usb1.1 and sound.
I fear that audio is the hardest thing to implement.
I had a look at the linux sound system.
Obviously one can take ideas but i think that recreating a alsa system is.. Huge.
There is a need for only one or two devices so it is not as big but still the structure to follow is not clear.
Are there experienced users who could share their knowledge, feelings?
Thanks
Concern about sound system
-
- Member
- Posts: 97
- Joined: Tue Mar 10, 2015 10:08 am
Concern about sound system
Last edited by JulienDarc on Tue Mar 24, 2015 9:48 am, edited 1 time in total.
Re: Concern about sound system in custom os
Obviously, you can make a sound system as complicated as you like. But just getting something out of your speakers isn't that hard. You have to initialise the sound card and then feed it some buffer that contains the audio data (and keep feeding new data as long as you keep playing). Once you're there, you can start implementing additional features, e.g. adding a mixer, distinguish different outputs etc.
For USB, on the other hand, I'm afraid there aren't many shortcuts, so this might turn out harder than you think.
For USB, on the other hand, I'm afraid there aren't many shortcuts, so this might turn out harder than you think.
-
- Member
- Posts: 97
- Joined: Tue Mar 10, 2015 10:08 am
Re: Concern about sound system in custom os
Thanks Kevin,
I already have all the reference for usb 1.1 and 2.0, and yes, it is *not* easy
Ok, so I am reassured as for the sound system.
I already have all the reference for usb 1.1 and 2.0, and yes, it is *not* easy
Ok, so I am reassured as for the sound system.
Re: Concern about sound system in custom os
If you need some simple driver code to compare to, you can have a look at the CDI drivers ac97 and hdaudio, which both do more or less the bare minimum. But if you know how to read specs, there isn't really anything new in the code.
-
- Member
- Posts: 119
- Joined: Tue Jan 20, 2015 9:01 am
- Libera.chat IRC: glauxosdever
Re: Concern about sound system in custom os
You could also see TatOS usb related source code. My code (not released yet) is heavily based on it.
For ehci:
I have not implemented it yet. It is for low speed devices, and not flash drives.
PS. Why did you pose two completly different questions in one topic?
PPS. Also, there is no need for writing "in custom os" in your title. Everyone here knows you are making your own.
For ehci:
- First you need to find the ehci controller on pci. Its address varies. Just use the bios to get it.
- Then you need to initialize it.
1. Get base address, operational base address, extended capabilities offset.
2. Request ownership from the bios.
3. Reset controller - Scan for devices (for now I recommend sticking with one device only).
- Reset and enable the port that has the device connected.
- Using control endpoint and address 0 get device-configuration-endpoint descriptors
- Using endpoints got from endpoint descriptors, set unique address on usb bus. From now use only this address.
- Similarly, set configuration.
- Send inquiry command.
- Test unit ready
- Read capacity
- Only then request Read10 / Read16 command
I have not implemented it yet. It is for low speed devices, and not flash drives.
PS. Why did you pose two completly different questions in one topic?
PPS. Also, there is no need for writing "in custom os" in your title. Everyone here knows you are making your own.
Last edited by glauxosdev on Tue Mar 24, 2015 9:57 am, edited 1 time in total.
-
- Member
- Posts: 97
- Joined: Tue Mar 10, 2015 10:08 am
Re: Concern about sound system in custom os
@Kevin : thanks for the pointer
@glauxosdev : you are right, specifying "custom" is stupid here Two questions ? I am sorry about that I just wanted to ask about the sound system. The usb part was just to set the context. Your pointers are very interesting.
I, too for the moment, will stick with modern technologies because I know the machines the OS could run on.. one day.
Thanks a lot by the way !
Julien
@glauxosdev : you are right, specifying "custom" is stupid here Two questions ? I am sorry about that I just wanted to ask about the sound system. The usb part was just to set the context. Your pointers are very interesting.
I, too for the moment, will stick with modern technologies because I know the machines the OS could run on.. one day.
Thanks a lot by the way !
Julien