Messages in this thread | | | Date | Wed, 23 Jul 1997 10:16:35 -0200 (GMT+2) | From | Pieter Nagel <> | Subject | Re: Kernel cpu selection + other platforms? |
| |
On Tue, 22 Jul 1997, Richard B. Johnson wrote:
> So with Intel, we have to make a kernel which will run with anything, then > rebuild the sources to take advantage of the platform's latest CPU > advances.
An option is to identify critical functions, like the scheduler or memory management, which stand to win most by processor-specific optimizations, and build a handfull of architecture-dependent variants of each.
As soon as architecture is detected, the unneeded functions become eligible to be discarded just as if they were _initfunc's. In many cases, ensuring that the correct 'variant' is called at run-time could be handled by modifying the initialization code for the relevant function pointer - or mucking with the syscall tables.
The cleanest way to do this is to place these architecture-variable functions one each in their own .c file, and have the Makefile loop through all relevant architecture-specific #define's and recompile them. Either do a little name mangling (i.e. schedule_amdk6, schedule_ppro etc.) or emit them into special per-architecture segments. Their ought do be a clean way to do the late binding.
,_ /_) /| / / i e t e r / |/ a g e l
PGP: finger pnagel@epiuse.co.za
| |