From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 15 Aug 2014 20:30:34 +0200 From: David du Colombier <0intro@gmail.com> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20140815203034.51aa9e77@zinc.9fans.fr> In-Reply-To: References: <20140815092301.0b0a85bb@zinc.9fans.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Loongson port, and 64 bit MIPS Topicbox-Message-UUID: 10a541fe-ead9-11e9-9d60-3106f5b1d025 > 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; 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? 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. -- David du Colombier