From mboxrd@z Thu Jan 1 00:00:00 1970 From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] drawterm and linux 2.4.4 SMP MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20010721023834.60B961998A@mail.cse.psu.edu> Date: Fri, 20 Jul 2001 22:38:30 -0400 Topicbox-Message-UUID: d2850f62-eac9-11e9-9e20-41e7f4b1d025 On Fri Jul 20 21:16:24 EDT 2001, crdevilb@mtu.edu wrote: > I remember there was talk on the list some time ago about drawterm for > linux and how it may very well be broken under linux 2.4; well, that > time is here. It seems (to me) that it is broken because I was just > stepping through the source (because it was SEGVing), and the macro CT > (at linux.c:30) seems to nondeterministically alternate between giving > the right answer and giving NULL, because linux.c:/^gettss(void) > nondeterministically alternates between returning 6 and 8... > > Was there some suggestion or patch anybody had to fix this, or am I > going to be digging into the linux kernel to find yet another hack to > solve this? > > Thanks in advance for any help. > > -- > Colin DeVilbiss > crdevilb@mtu.edu I haven't looked at that code but from the description it looks like the thread switch hack Phil Winterbottom and I did when we ported Inferno to Linux a very long time ago. At that time Linux used the task switch capabililty of the x86 (why, I don't know) so it was possible to use the contents of the task-switch register as an index to find the process context in the shared memory as there was no other private per-process memory available (Plan 9 at least gives each process a private stack). You will need to find some other way to do it, but it will probably be just as much of a hack. I don't know what possibilities there are under Linux 2.4, but they must surely have added something (that could be used). Perhaps someone who is more familiar with both the thread-switching scheme used in drawterm and Linux can give a better answer.