As is said above, in multitasking protected operating systems to which the Linux belongs too, a programmer cannot access hardware directly from the application level (the "User Mode") where the greater part of development work usually happens. Hardware access is allowed only from within the operating system itself (the "Kernel Mode"'), by software modules called "Device Drivers" or their prevalent Linux adaption called "Loadable Kernel Modules". In order to access a custom hardware device from the application level, a programmer must do the following:
KylixDriver eliminates the need for you to be familiar with the Linux internals or to have any device driver knowledge while accessing hardware from RAD Kylix. Sounds cool? Read on…
KylixDriver introduces a set of Kylix components and classes specially elaborated for this goal. Amongst Kylix components which model different hardware resources and amongst other subsidiary classes introduced, there is a friendly wizard calledCardBuilder that helps you to produce the definition of device model and the diagnostics of corresponding hardware at design time, straight in Kylix IDE. The definition of device model is a process of attaching proper resources to some trunk resource with consequent adjusting these resources to keep initial characteristic data. Each of these attached resources is represented by a specific Kylix component. Each specific Kylix component is adequate to (one can say ‘it models’) a real resource of hardware, such as: memory, port, interrupt and other. As soon as with a few clicks of mouse and a few key pressures on keyboard the device model is constructed and hardware is diagnosed, your current Kylix project turns out to be already stuffed with proper components whose properties, methods and events are ready to be involved. After all Kylix IDE work is completed, your Kylix application compiled is almost a ready-made "User Mode" driver. And, as you could guess, for hardware access this application makes calls to KylixDriver kernel module named GDD (Acronym GDD stands for Generic Device Driver) which, in turn, accesses the hardware for you through native calls of the Linux OS. And what is more - CardBuilder can also automatically generate a special testing application for your device relying on its resources currently present. All resources are made thread-safe - hardware can be accessed from application threads!
Figure 1: KylixDriver Architecture