On Fri, Aug 15, 2014 at 2:30 PM, David du Colombier <0in...@gmail.com> wrote:
>> Indeed I have a question about unifying the 2E and 2F kernels.
>> Currently 2F is separated so that it is convenient for me to
>> experiment new code for 2F hardwares without worrying breaking 2E.
>> Eventually it might be better to unify them. I think it is possible to
>> share the C code, with specific hardware enabled/disabled in
>> configuration file. Mainly the differences are some #define'd or enum
>> constants in mem.h and io.h, including IRQ and some addresses. What
>> would be the best way to do it?
>
> Maybe you could define them as variables in the port section
> of the configuration files. I think this is particularly
> relevant for things like screen resolution.
>
> For example:
>
> port
>         int width = 1024;
>         int height = 600;

Thanks for all suggestions. I have unified clock.c and screen.c for
both machines in this way.

>
> You could also define something like ln2e and ln2f variables
> and make some code depending on these conditions. The best
> would be to detect the cpu revision automatically. Is it
> possible in your case?

Yes, it is possible. The cpu revision are different on the two. I may
try this once I get more hardwares working.

>
> Perhaps others have better ideas.
>
>> Would it be possible to upstream this port to distribution? Minux
>> strongly encouraged me to do so.
>
> You may want to contact Jim McKie and explain your work and
> motivations to get it merged into the Plan 9 distribution.
>
Thank you for the information.

> --
> David du Colombier
>

Reply via email to