Do we already have support in the compiler to being able to use attributes in the kernel code? (well, at least, being able to read them back?)
i'll give more feedback later (when i'm not so damn tired) On Fri, Jul 25, 2008 at 7:08 AM, Phil Garcia <[EMAIL PROTECTED]> wrote: > Hi! > > I wanted to get some feedback (good and bad) on using attributes for device > drivers. Here's what I'm thinking: > > For non-plug and play ISA devices, the attributes define: 1) if the driver > will automatically load on boot, 2) the port range, 3) the memory region, 4) > the IRQ, and 5) command line option to force the driver to load. Here are > some examples: > > [ISADeviceSignature(AutoLoad = true, BasePort = 0x1F0, PortRange = 8)] > [ISADeviceSignature(AutoLoad = false, BasePort = 0x170, PortRange = 8, > ForceOption = "ide2")] > [ISADeviceSignature(AutoLoad = true, BasePort = 0x03B0, PortRange = 0x1F, > BaseAddress = 0xB0000, AddressRange = 0x4000)] > [ISADeviceSignature(AutoLoad = true, BasePort = 0x03F8, PortRange = 8, IRQ = > 4)] > [ISADeviceSignature(AutoLoad = false, BasePort = 0x02F8, PortRange = 8, IRQ > = 3)] > [ISADeviceSignature(AutoLoad = false, BasePort = 0x03E8, PortRange = 8, IRQ > = 4, ForceOption="com3")] > [ISADeviceSignature(AutoLoad = false, BasePort = 0x02E8, PortRange = 8, IRQ > = 3, ForceOption="com4")] > > Drivers may have multiple signatures, for example, the first two above are > for the primary and secondary IDE devices and the last four are for the > serial ports. > > For PCI devices, the attributes define the binding requirements of the > device driver. Here are some examples: > > [PCIDeviceSignature(VendorID = ABCD, DeviceID = 0x1000)] > [PCIDeviceSignature(VendorID = ABCD, DeviceID = 0x2000)] > [PCIDeviceSignature(ClassCode=0xFFFF, SubClassCode=0xFF)] > > PCI devices have a specific binding order to decide the best driver in the > case of ambiguity (see wiki for details). All other settings for PCI > devices, like IO ports, memory regions and IRQ are driven and set by the > BIOS during boot, so attributes to define those settings are not required. > > In the future, I'll add an option for specifying which platforms the device > driver will work on. For example, the CMOS device is only available on the > x86 and x64 platforms. Unlike Linux, we are not going to support every > possible device, especially on the ISA bus, so I didn't include support for > multiple port ranges or memory regions for ISA devices to keep it simple. I > also have not considered plug and play ISA devices yet. > > I'd appreciate any comments, suggestions, or insights. You can find actual > code for all of this in the Ensemble SVN. I'll port it back to SharpOS once > attributes methods are implemented. > > Phil ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ SharpOS-Developers mailing list SharpOS-Developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sharpos-developers