From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20140815203034.51aa9e77@zinc.9fans.fr> References: <20140815092301.0b0a85bb@zinc.9fans.fr> <20140815203034.51aa9e77@zinc.9fans.fr> Date: Sat, 16 Aug 2014 16:29:28 -0400 Message-ID: From: cherry To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] Loongson port, and 64 bit MIPS Topicbox-Message-UUID: 10b76dc0-ead9-11e9-9d60-3106f5b1d025 On Fri, Aug 15, 2014 at 2:30 PM, David du Colombier <0intro@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 >