xxxxx@hotmail.com wrote:
Tim a grand thanks so much. I do have a couple of questions to ask of you. When a user plugs in a USB flash drive in a computer does the Southbridge/Platform Controller Hub send initial notification and the data to the OS by way of the Northbridge chipset then to the CPU which notifies the OS yes ?
You are assigning active roles to the bridges that simply do not exist.
The BIOS configures the bridges during boot, and Windows tweaks that
configuration when it starts. After that, the bridges are very little
more than plumbing. There’s no active communication between Windows and
the bridges. Remember, the processor doesn’t have a separate path to
the bridges. In hardware terms, it’s not aware that bridges exist. The
processor simply has an address and data bus. When a driver wants to
talk to a device on a PCIe bus, it knows the physical address that
device was assigned. The code just does normal memory references to
those addresses, and the bridges pass the memory references back and
forth to the bus, transparently. The processor doesn’t know whether the
address goes to memory, I/O, ISA, PCIe, or VME.
When the user plugs in a USB flash drive, the USB host controller (which
might be on the same piece of silicon as the south bridge) notifies its
driver by firing an interrupt. The driver then creates USB requests to
go find out what the device was. Those USB requests are handled by
writing blocks of memory and putting them into a DMA chain.
Also, I don’t think it’s helpful to think about the CPU notifying the
OS. The CPU is really fairly stupid. It doesn’t think it terms of
abstractions. It just executes a stream instructions. You can say that
the host controller notifies the OS, and the way it does that is by
raising an interrupt, which causes the CPU to change the program counter
so that the OS starts running. The CPU doesn’t really know whether the
new location is in an operating system, or a game, or a driver, or a
virus. It’s just following it’s very basic, low-level instructions.
I did take a look at the datasheet for an Intel Southbridge/Platform Controller Hub chipset and there were no instruction set or interface which a developer or Windows could use in order to interface with it at least I could not see.
Right, because you DON’T interface with it. You configure it at boot
time, then you leave it alone to do its routing.
So that would mean in order for the OS to interface with a IO device (USB/Audio/HDD) it would have to be via the instruction set of the CPU which should have certain instructions in order to communicate with the IO device via the Northbridge and then onto the Southbridge chipset yes ?
Virtually all I/O on x86 systems is done through memory-mapping. There
are no special instructions. To communicate with a device, you write to
addresses in the memory range assigned to that device. The processor
doesn’t know that it’s an I/O device. It just generates memory reads
and memory writes. The bridges, by looking at the address in the
request, route it to memory or to a bus, all transparently. There is no
special action by software or hardware to force a request to one of the
bridges.
The x86 does have the IN and OUT instructions for doing I/O. They are
rarely used any more, because their performance is not good, but to the
CPU those are exactly the same as a memory access. There is an
additional pin that says “this address is a memory address” or “this
address is an I/O space address”.
One last thing could you correct the following excerpts from the following website http://www.wisegeek.com/what-is-the-difference-between-a-chipset-and-a-cpu.htm
“The information, entered through the keyboard, would travel through the Southbridge section of the chipset to the Northbridge section and into the CPU. The CPU would figure out the answer and send it to the program via the Southbridge and then to the graphics system, so it may be displayed on the screen, via the Northbridge. This is a very basic example, but it serves to illustrate the separation of the two components”
Reading the above excerpt why then would the CPU send it to the program via the Southbridge chipset ? Have I missed anything but why would the CPU not notify the OS of the data waiting for the application without having to go through the Southbridge or Platform Controller Hub ? The OS would then notify the application of the pending keyboard entry.
There’s nothing fundamentally wrong with that excerpt, but you are
reading WAY more into this than you really should. One of the key
points you are missing is that all of that signal routing is automatic
and transparent. Yes, a keystroke will travel through the southbridge
and the northbridge into the CPU, but no one has to take any action to
make that happen. The bridges just pass the signals along, based on
their boot-time configuration.
Also, remember that nothing happens on its own. The keyboard can’t
magically force a keystroke to take the path described above. There
might be an interrupt to say that “the keyboard device has something for
you”, but processor has to go read a memory-mapped address to discover
what the key was. That key then gets translated into window messages
and written into memory, where some application will read it later. If
the application decides to display that character on the screen, it
makes an operating system call that eventually writes the data to the
memory addresses assigned to the graphics card. That memory write will
be directed by the northbridge to the graphics chip, but transparently.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.