Page 1 of 1

Chipsets

Posted: Tue Oct 16, 2007 8:22 am
by einsteinjunior
Hi out there.
Does anyone out there know how programming of a chipset is done?
Thanks.

Posted: Tue Oct 16, 2007 8:34 am
by Brynet-Inc
Well Mr Vague.. ;)

Can you be a little more... specific? :roll:

Posted: Tue Oct 16, 2007 8:40 am
by einsteinjunior
Ok then,
I wish to use USB on my OS and also directly probe the memory available in the system.But i don't want to go through the BIOS.
I know i can program the chipset registers for that.
How to proceed is the question.

Posted: Tue Oct 16, 2007 8:46 am
by Korona
You cannot do that without having a driver for each chipset. Memory detection depends heavily on your chipset, there is no common way to probe for useable memory without using the BIOS.

Posted: Tue Oct 16, 2007 8:49 am
by einsteinjunior
So how do i write a driver for a chipset?
There is this old version of linux working with some sort of "generic" chipset driver.
Thats exactly what i need.

Posted: Tue Oct 16, 2007 8:55 am
by os64dev
einsteinjunior wrote:Ok then,
I wish to use USB on my OS and also directly probe the memory available in the system.But i don't want to go through the BIOS.
I know i can program the chipset registers for that.
How to proceed is the question.
einstein shame on you [-X direct probing is very hazardous for you system. Hence the int $15/$E820 function in the BIOS which is very reliable BTW.

Posted: Tue Oct 16, 2007 8:58 am
by einsteinjunior
There is no shame on me!!!
Direct probing can be done SAFELY using the CHIPSET.
Got that?

Posted: Tue Oct 16, 2007 9:02 am
by Brynet-Inc
Typically a small EEPROM on SDRAM modules is interpreted by the BIOS, I'm assuming that's how the BIOS detects available RAM these days.. (Not direct probing..)

http://en.wikipedia.org/wiki/Serial_Presence_Detect

Posted: Tue Oct 16, 2007 9:05 am
by Korona
I do not think Linux uses a chipset driver to detect available memory. I guess Linux as well as Windows uses Int 0x15/ Function 0xE820 to detect memory (and then falls back to some other BIOS calls). There is no way to write a generic chipset driver that is able to detect every kind of memory that is present in the system.

Posted: Tue Oct 16, 2007 9:22 am
by Brendan
Hi,
einsteinjunior wrote:I wish to use USB on my OS and also directly probe the memory available in the system.But i don't want to go through the BIOS.
I know i can program the chipset registers for that.
How to proceed is the question.
The USB controller is the same as any other PCI card - use PCI configuration space to detect it, find/configure the resources it's using, etc. It's not "chipset specific" (even when there's USB controllers built into the chipset they behave exactly the same as a USB controller in a plug-in PCI card).

For memory detection, every chipset does it differently and it's impossible to detect RAM using chipset registers while your code is running from RAM because you need to severely mess with the RAM chips. The BIOS can do it because the BIOS is designed specifically for the chipset and runs from ROM.

Rather than using chipset registers for memory detection, you could manually probe for RAM (e.g. write a value at an address and read it back to see if it was stored). This is a highly dodgy method with many problems. For example, you can't tell the different between RAM and memory mapped I/O (e.g. video card display memory). It's also very slow - e.g. for a 3 GHz CPU with 4 GB of RAM it could take 16 seconds.

Lastly, detecting "present RAM" is mostly useless anyway - you need to detect "usable/free RAM". This is partly because the BIOS uses some RAM for other things, like SMM (System Management Mode) that the OS has no control over, and partly because the BIOS can put tables in RAM for the OS to use that your OS might want later.

Basically, if your OS can't use BIOS functions (or firmware) for memory detection then it has severe design flaws - fixing those design flaws makes a lot more sense than using any unreliable hack.


Cheers,

Brendan

Posted: Tue Oct 16, 2007 9:23 am
by einsteinjunior
I am primarily not interested in direct memory probing using chipset since i can do it using BIOS.What i really need is a chipset driver for USB.
Thanks.

Posted: Tue Oct 16, 2007 10:07 am
by Brendan
Hi,
einsteinjunior wrote:I am primarily not interested in direct memory probing using chipset since i can do it using BIOS.What i really need is a chipset driver for USB.
Hmm...

Are you sure you don't need a generic USB driver for PCI, or does it have to be for a specific chipset (e.g. a chipset with broken/dodgy USB hardware that doesn't follow standards)?


Cheers,

Brendan

Posted: Wed Oct 17, 2007 12:04 am
by AndrewAPrice
Are you sure what you're looking for isn't BIOS calls? (Still possibly in protected mode using v86 emulation).

Posted: Wed Oct 17, 2007 12:49 pm
by Crazed123
We're in OS Design and Theory right now? You know, the place without hardware-hacking newbies asking utterly underspecified questions?

Posted: Wed Oct 17, 2007 1:36 pm
by Candy
Let me fix that then. USB implementation is only barely theory or design, mostly... implementation...