A method and apparatus for constructing an executable program, such as drivers
in memory, obtains system configuration parameters and dynamically constructs driver
code bundles from a set of code modules obtained from a library, based on the actual
system configuration parameters. The set of code modules includes code modules
associated with a plurality of system configuration parameters. One example of
the system configuration parameter include static system configuration parameters
such as in the case of a computer, a CPU type, clock speed and system memory size.
Other actual system configuration parameters include dynamic configuration parameters
which can be changed by the user. One example of a dynamic configuration parameter
may be, for example, pixel depth and display screen resolution. After obtaining
optimal system configuration depending upon a system's setting or configurations,
dedicated code modules are used and stored in system memory or other suitable memory.
Accordingly, optimal driver code is loaded at all times for a particular chip set
and no unnecessary code is loaded from a CD ROM or other source.