Skip to contentSkip to conversation

vger-2.3.15 on pmac

PATCH Martin Costabel 5 participants 11 messages Aug 26, 1999 – Aug 28, 1999 1 message not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

Thanks to the efforts of Paul M. and Cort, the 2.3.15 kernel from cvs.on.openprojects is now compiling on a Pmac (first time after 2.3.6, 2 months ago).

I propose 2 patches: The first one is an obvious correction in the valkyriefb driver, and the second one allows to configure support for Apple partition maps without going to the section of exotic partitions. It is obvious, too.

In a second post, I'll have some questions about things that don't yet work. I hope this is the right forum for this. I didn't see many discussions on kernel development for the PPC like on the linux-kernel list.

--
Martin

Index: drivers/video/valkyriefb.c
===================================================================
RCS file: /cvs/linux/linux/drivers/video/valkyriefb.c,v retrieving revision 1.13

video/valkyriefb.c 1999/08/25 16:49:23 renamed from video/valkyriefb.c 1999/08/20 01:43:36 1.13 +1 -1
diff -u -r1.13 valkyriefb.c
@@ -763,7 +763,7 @@
 {
        memset(fix, 0, sizeof(*fix));
        strcpy(fix->id, "valkyrie");
-       fix->mmio_start = (char *)p->valkyrie_regs_phys;
+       fix->mmio_start = p->valkyrie_regs_phys;
        fix->mmio_len = sizeof(struct valkyrie_regs);
        fix->type = FB_TYPE_PACKED_PIXELS;
 

Index: fs/partitions/Config.in
===================================================================
RCS file: /cvs/linux/linux/fs/partitions/Config.in,v retrieving revision 1.1

partitions/Config.in 1999/08/25 16:49:59 renamed from partitions/Config.in 1999/08/20 00:22:30 1.1 +3 -0
diff -u -r1.1 Config.in
@@ -23,6 +23,9 @@
   if [ "$CONFIG_ATARI" = "y" ]; then
     define_bool CONFIG_ATARI_PARTITION y
   fi
+  if [ "$CONFIG_PMAC" = "y" ]; then
+    define_bool CONFIG_MAC_PARTITION y
+  fi
   bool 'SMD disklabel (Sun partition tables) support'

CONFIG_SMD_DISKLABEL
if [ "$ARCH" = "sparc" -o "$CONFIG_SMD_DISKLABEL" = "y" ]; then
define_bool CONFIG_SUN_PARTITION y

===================================================================

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#1 lore raw
Quoted 8 lines · Martin Costabel

Thanks to the efforts of Paul M. and Cort, the 2.3.15 kernel from cvs.on.openprojects is now compiling on a Pmac (first time after 2.3.6, 2 months ago).

I propose 2 patches: The first one is an obvious correction in the valkyriefb driver, and the second one allows to configure support for Apple partition maps without going to the section of exotic partitions. It is obvious, too.

I just checked in the first one (+ a similar fix to chipsfb) at vger, and sent a patch to Linus.

Greetings,

Geert

--
Geert Uytterhoeven [email protected]
Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#2 lore raw
In reply to Martin Costabel
Quoted 4 lines · Martin Costabel

In a second post, I'll have some questions about things that don't yet work. I hope this is the right forum for this. I didn't see many discussions on kernel development for the PPC like on the linux-kernel list.

You'll probably talking about the problems with adbmouse. I have a patch for this one. I have also a fixed version of my Xpmac-style 3-mousebutton emulation with the "buttons locked before 1st use" problem. I'll forward this stuff to Paul later today when I'm home.

What's still NOT fixed in 2.3.15 and really annoying for a lot of users is "FB. overflow" aka "macserial: flipbuffer overflow". This was introduced somewhere late 2.1 or early 2.2. I think this one is responsible for some of the hard crashes reported on linuxppc-users under the "Communicator crashes X" thread.

Another problem probably worth a look is the near to zero serial/PPP performance during heavy disk activity. One could argue this is a problem with my slow 7200/75, but I don't have similar problems under MacOS...

Franz.

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#11 lore raw

vger-2.3.15 and ADB_MOUSE

In reply to Martin Costabel

Trying to make the vger kernel 2.3.15 work on my Pmac 6400, I found how to make my screen work and how to make the kernel read the partition map on my HDs (see my previous post). So now it boots.

It does not, however, start a driver for my adb-mouse. Therefore gpm and also X don't work. Does anyone know if this is a configuration problem or is it known that the adbmouse driver is still broken in 2.3.15?

I had to patch drivers/char/Makefile in order to compile drivers/char/busmouse. otherwise there were undefined symbols (see patch below).

The other thing I can see is seriously broken is hfs. But there I guess we'll have to wait until Adrian Sun finishes his thesis :-) Anyway, I was pleasantly surprised to see that hfsutils work without hfs support compiled into the kernel. So I was able to hcopy -r vmlinux to my MacOS system folder and reboot with BootX without first passing by an older kernel.

--
Martin
Index: drivers/char/Makefile
===================================================================
RCS file: /cvs/linux/linux/drivers/char/Makefile,v retrieving revision 1.98

char/Makefile 1999/08/25 18:49:37 renamed from char/Makefile 1999/08/08 01:35:10 1.98 +2 -2
diff -u -r1.98 Makefile
@@ -198,11 +198,11 @@
   endif
 endif
 
-ifeq ($(CONFIG_MOUSE),y)
+ifeq ($(CONFIG_BUSMOUSE),y)
 M = y
 OX_OBJS += busmouse.o
 else
-  ifeq ($(CONFIG_MOUSE),m)
+  ifeq ($(CONFIG_BUSMOUSE),m)
   MM = m
   MX_OBJS += busmouse.o
   endif

===================================================================

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#4 lore raw
In reply to a message not in the archive

Am Don, 26 Aug 1999 schrieb Martin Costabel:

Quoted 11 lines
Quoted 8 lines · Franz Sirl
Quoted 4 lines · Martin Costabel

In a second post, I'll have some questions about things that don't yet work. I hope this is the right forum for this. I didn't see many discussions on kernel development for the PPC like on the linux-kernel list.

You'll probably talking about the problems with adbmouse.

Yes, you beat me by 6 sec.

:-)
Yeah, I noticed.

Quoted 10 lines
Quoted 5 lines

I have a patch
for this one. I have also a fixed version of my Xpmac-style 3-mousebutton emulation with the "buttons locked before 1st use" problem. I'll forward this stuff to Paul later today when I'm home.

Great! Could you CC it to me, please? I am using your patch all the time in 2.2.12. The problem you are talking about, is it the one that forces me to press Opt_R before moving the mouse the first time (gpm and X)? Not very serious, but if you have a fix, umso besser!

Yes, this problem is fixed now.

For Paul, this patch does:
- fixes 2.3.15 compilation issues vs. CONFIG_MOUSE/CONFIG_BUSMOUSE
- convert adb_mouse_setup to new style (compiles, but not tested yet)
- added 2nd Xpmac style mouse button emulation mode:

	adb_buttons=1,x,y: exactly like the old version, one key == one button
	adb_buttons=2,x,y: Xpmac style, one key + mouse click == one button

BTW, Paul, is there any chance we can go back to USB keycodes before 2.4? This seems a lot more logical in the longterm.

Franz.

Index: char/Makefile
===================================================================
RCS file: /cvs/linux/linux/drivers/char/Makefile,v retrieving revision 1.98

Makefile +2 -2
diff -u -p -r1.98 Makefile
@@ -198,11 +198,11 @@ else
   endif
 endif
 
-ifeq ($(CONFIG_MOUSE),y)
+ifeq ($(CONFIG_BUSMOUSE),y)
 M = y
 OX_OBJS += busmouse.o
 else
-  ifeq ($(CONFIG_MOUSE),m)
+  ifeq ($(CONFIG_BUSMOUSE),m)
   MM = m
   MX_OBJS += busmouse.o
   endif

Index: char/adbmouse.c
===================================================================
RCS file: /cvs/linux/linux/drivers/char/adbmouse.c,v retrieving revision 1.18

adbmouse.c +30 -8
diff -u -p -r1.18 adbmouse.c
@@ -53,6 +53,8 @@ extern void (*adb_mouse_interrupt_hook)(
 extern int adb_emulate_buttons;
 extern int adb_button2_keycode;
 extern int adb_button3_keycode;
+extern int adb_modifier_keys_state;
+
 extern int console_loglevel;
 
 /*
@@ -95,6 +97,19 @@ static void adb_mouse_interrupt(unsigned
 	   Button 3 (middle): bit 1, busmouse button 2
 	 */
 
+	if (nb < 4 && adb_emulate_buttons == 2) {
+		buf[3] = 0x80;
+		if (adb_modifier_keys_state & 0x01) {
+			buf[2] |= 0x80;
+			buf[2] &= (buf[1] & 0x80) | 0x7f;
+			buf[1] |= 0x80;
+		}
+		else if (adb_modifier_keys_state & 0x02) {
+			buf[3] = buf[1] & 0x80;
+			buf[1] |= 0x80;
+		}
+	}
+
 	/* x/y and buttons swapped */
 
 	id = (buf[0] >> 4) & 0xf;
@@ -111,7 +126,7 @@ static void adb_mouse_interrupt(unsigned
 	 *  on a logitech mouseman, the right and mid buttons sometimes behave
 	 *  strangely until they both have been pressed after booting. */
 	/* data valid only if extended mouse format ! */
-	if (nb >= 4)
+	if (nb >= 4 || adb_emulate_buttons == 2)
 		buttons = (buttons & 6) | (buf[3] & 0x80 ? 1 : 0); /* 1+3 unchanged */
 
 	adb_mouse_buttons[id] = buttons;
@@ -125,8 +140,8 @@ static void adb_mouse_interrupt(unsigned
 	busmouse_add_movementbuttons(msedev, dx, -dy, buttons);
 
 	if (console_loglevel >= 8)
-		printk(" %X %X %X dx %d dy %d \n",
-		       buf[1], buf[2], buf[3], dx, dy);
+		printk(" %d %X %X %X %X dx %d dy %d buttons %d\n",
+		       msedev, adb_modifier_keys_state, buf[1], buf[2], buf[3], dx, dy, buttons);
 }
 
 static int release_mouse(struct inode *inode, struct file *file)
@@ -138,7 +153,11 @@ static int release_mouse(struct inode *i
 
 static int open_mouse(struct inode *inode, struct file *file)
 {
+	int id;
+
 	MOD_INC_USE_COUNT;
+	for (id = 0; id < 16; ++id)
+        	adb_mouse_buttons[id] = 7;      /* all buttons up */
 	adb_mouse_interrupt_hook = adb_mouse_interrupt;
 	return 0;
 }
@@ -174,16 +193,19 @@ __initfunc(int adb_mouse_init(void))
  * option, which is about using ADB keyboard buttons to emulate
  * mouse buttons. -- paulus
  */
-__initfunc(void adb_mouse_setup(char *str, int *ints))
+static int __init adb_mouse_setup(char *str, int *ints)
 {
 	if (ints[0] >= 1) {
-		adb_emulate_buttons = ints[1] > 0;
-		if (ints[1] > 1)
-			adb_button2_keycode = ints[1];
+		adb_emulate_buttons = ints[1];
 		if (ints[0] >= 2)
-			adb_button3_keycode = ints[2];
+			adb_button2_keycode = ints[2];
+		if (ints[0] >= 3)
+			adb_button3_keycode = ints[3];
 	}
+	return 1;
 }
+
+__setup("adb_buttons=", adb_mouse_setup);
 
 #ifdef MODULE
 int init_module(void)

Index: char/busmouse.c
===================================================================
RCS file: /cvs/linux/linux/drivers/char/busmouse.c,v retrieving revision 1.26

busmouse.c +0 -3
diff -u -p -r1.26 busmouse.c
@@ -435,9 +435,6 @@ unregister_busmouse(int mousedev)
 __initfunc(int
 bus_mouse_init(void))
 {
-#ifdef CONFIG_BUSMOUSE
-	bus_mouse_init();
-#endif
 #ifdef CONFIG_MS_BUSMOUSE
 	ms_bus_mouse_init();
 #endif

Index: char/misc.c
===================================================================
RCS file: /cvs/linux/linux/drivers/char/misc.c,v
retrieving revision 1.51

misc.c +1 -1
diff -u -p -r1.51 misc.c
@@ -187,7 +187,7 @@ int __init misc_init(void)
 	proc_misc = create_proc_entry("misc", 0, 0);
 	if (proc_misc)
 		proc_misc->read_proc = misc_read_proc;
-#ifdef CONFIG_MOUSE
+#ifdef CONFIG_BUSMOUSE
 	bus_mouse_init();
 #endif
 #if defined CONFIG_82C710_MOUSE

Index: macintosh/mac_keyb.c
===================================================================
RCS file: /cvs/linux/linux/drivers/macintosh/mac_keyb.c,v retrieving revision 1.32

mac_keyb.c +10 -1
diff -u -p -r1.32 mac_keyb.c
@@ -245,6 +245,7 @@ void (*adb_mouse_interrupt_hook)(unsigne
 int adb_emulate_buttons = 0;
 int adb_button2_keycode = 0x7d;	/* right control key */
 int adb_button3_keycode = 0x7c; /* right option key */
+int adb_modifier_keys_state = 0;
 #endif
 
 extern int console_loglevel;
@@ -344,7 +345,7 @@ input_keycode(int keycode, int repeat)
 	 *	Might also want to know how many buttons need to be emulated.
 	 *	-> hide this as function in arch/m68k/mac ?
 	 */
-	if (adb_emulate_buttons
+	if (adb_emulate_buttons == 1
 	    && (keycode == adb_button2_keycode
 		|| keycode == adb_button3_keycode)
 	    && (adb_mouse_interrupt_hook || console_loglevel == 10)) {
@@ -363,6 +364,14 @@ input_keycode(int keycode, int repeat)
 				adb_mouse_interrupt_hook(data, 4);
 		}
 		return;
+	} else if (adb_emulate_buttons == 2
+		   && keycode == adb_button2_keycode) {
+		adb_modifier_keys_state &= 0x02;
+		adb_modifier_keys_state |= up_flag ? 0 : 1;
+	} else if (adb_emulate_buttons == 2
+		   && keycode == adb_button3_keycode) {
+		adb_modifier_keys_state &= 0x01;
+		adb_modifier_keys_state |= up_flag ? 0 : 2;
 	}
 #endif /* CONFIG_ADBMOUSE */
 
#5 lore raw

Am Fre, 27 Aug 1999 schrieb Franz Sirl:

Quoted 1 line

- convert adb_mouse_setup to new style (compiles, but not tested yet)

AAARGH! Everything has changed with the setup code. Use the following diff for the adb_mouse_setup routine:

@@ -174,16 +193,22 @@ __initfunc(int adb_mouse_init(void))
* option, which is about using ADB keyboard buttons to emulate
* mouse buttons. -- paulus
*/
-__initfunc(void adb_mouse_setup(char *str, int *ints)) +static int __init adb_mouse_setup(char *str)
{
+ int ints[4];
+

+       str = get_options(str,ARRAY_SIZE(ints),ints);
        if (ints[0] >= 1) {
-               adb_emulate_buttons = ints[1] > 0;
-               if (ints[1] > 1)
-                       adb_button2_keycode = ints[1];
+               adb_emulate_buttons = ints[1];
                if (ints[0] >= 2)
-                       adb_button3_keycode = ints[2];
+                       adb_button2_keycode = ints[2];
+               if (ints[0] >= 3)
+                       adb_button3_keycode = ints[3];
        }

+ return 1;
}
+
+__setup("adb_buttons=", adb_mouse_setup);

#ifdef MODULE
int init_module(void)

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#6 lore raw
Quoted 6 lines · Franz Sirl

Am Fre, 27 Aug 1999 schrieb Franz Sirl:

Quoted 1 line

- convert adb_mouse_setup to new style (compiles, but not tested yet)

AAARGH! Everything has changed with the setup code. Use the following diff for the adb_mouse_setup routine:

Thanks, Franz!

Everything is working. I am writing this now from 2.3.15 on my Performa 6400.

For drivers/macintosh/mac_keyb.c, I applied also BenH's patches that are in the 2.2 branch on vger, but not yet in the main branch. For me, this has the effect that the keyboard gets put on handler 3 instead of 5, so that in raw mode it produces different keycodes for the right modifier keys, and I can therefore use adb_buttons=2,58,124 to get button2=Opt_L+click, button3=Opt_R+click, like in Xpmac.

What is still not working are the LEDs and the ScrollLock and NumLock keys. But this is a different story that started way back before 2.3.x and is not very important.

--
Martin

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#7 lore raw
Quoted 2 lines · Martin Costabel

Everything is working. I am writing this now from 2.3.15 on my Performa 6400.

Little postscriptum: When I hit the "Send" button for my previous message, everything froze. Couldn't kill X, nothing. After a while, the system rebooted on its own. And the message got sent, it seems. Now I'll press this "Send" button again...

--
Martin

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#8 lore raw
In reply to Martin Costabel
Quoted 6 lines · Martin Costabel

For drivers/macintosh/mac_keyb.c, I applied also BenH's patches that are in the 2.2 branch on vger, but not yet in the main branch. For me, this has the effect that the keyboard gets put on handler 3 instead of 5, so that in raw mode it produces different keycodes for the right modifier keys, and I can therefore use adb_buttons=2,58,124 to get button2=Opt_L+click, button3=Opt_R+click, like in Xpmac.

I'm not sure my patches are still needed. The last time I synced with Paul's tree, the handler ID bug was fixed, but I didn't check vger yet.

Signature · 9 lines
           Perso. e-mail: <mailto:[email protected]>
           Work   e-mail: <mailto:[email protected]>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>


[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]
#9 lore raw
In reply to Franz Sirl
Quoted 5 lines · Franz Sirl

What's still NOT fixed in 2.3.15 and really annoying for a lot of users is "FB. overflow" aka "macserial: flipbuffer overflow". This was introduced somewhere late 2.1 or early 2.2. I think this one is responsible for some of the hard crashes reported on linuxppc-users under the "Communicator crashes X" thread.

I don't know if it is related, but I had several other hard freezes in the
meantime. One reproducible method is to run xdir (or gftp, works too), connect to a remote site, wait until the connection is established, choose "quit" from the menu, confirm, and boom! hard freeze. If I don't connect to a remote site, there is no freeze. I don't know how to debug this, because I don't see any error messages.

The other kernel panics arrived at the end of the boot process or during login. The message was "kernel stack overflow, in swapper task, not syncing", many lines of "page fault in interrupt handler, addr=c". The kernel addresses given were all init_task_union + offset.

Another strange thing, or maybe it is related, are error messages in my /var/log/dhcpd.log file:

Aug 27 12:04:42 rennes-28 dhcpcd[185]: corrupted UDP msg with
uh_ulen=312 in_cksum=-2 discarded 
Aug 27 12:05:37 rennes-28 last message repeated 16 times
Aug 27 12:06:28 rennes-28 last message repeated 3 times

Such messages appear irregularly, about every 10 minutes. There is no clear relation with the dialog with my dhcp server. Otherwise the net traffic over ethrnet/adsl/dhcp seems to work correctly.

This happens only with 2.3.15, not with 2.2.12. In the log file I find that I had such messages also between June 3 and June 13. I think these were the times when I tried 2.3.x kernels.

--
Martin

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#10 lore raw
Quoted 4 lines · Martin Costabel

The other kernel panics arrived at the end of the boot process or during login. The message was "kernel stack overflow, in swapper task, not syncing", many lines of "page fault in interrupt handler, addr=c". The kernel addresses given were all init_task_union + offset.

I saw the page fault in interrupt handler, addr=c' too (first call addr=0'), until I found out that strcmp() was passed a NULL pointer in fs/proc/proc_devtree.c. I have no idea why it didn't happen before.

Greetings,

Geert

--
Geert Uytterhoeven [email protected]
Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]