Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
[parent not found: <Pine.GSO.3.96.971118102415.23264A-100000@yacht.ee.fit.edu>]
* cdrecord on Linux/Alpha works
@ 1997-11-18  7:28 Thomas Bogendoerfer
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 1997-11-18  7:28 UTC (permalink / raw)


Hi,

I've asked a couple of days ago wether someone has used cdrecord on
Linux/Alpha successfully. As nobody had success with it, I debugged
cdrecord and found the usally problems (100 instead of HZ, casts
from pointers to ints and two functions which assume sizeof(long)==4).
Below is a patch, which fixes these problems. I was able to successful
"burn" two CDs in dummy mode and one in "real" mode (this wasn't quite
successful as the fixiating stage didn't finish, but I doubt that's a
problem with my JVC and even with the interrupted fixiating stage it is
readable).

There are still some unaligned traps in cdrecord, but I don't quite under-
stand where they happen:

Nov 16 22:54:06 alpha kernel: cdrecord(345): unaligned trap at 
	0000000000000028: 0000000120129fde 2c 31

When I look at this address with gdb, it indicates, that it's sigstack+40,
but that doesn't help me much. Any hints ?

BTW while grepping through my /var/log/messages file I also found following 
unaligned trap:

Nov 16 23:58:07 alpha kernel: netstat(606): unaligned trap at 0000000000000029: 
000000011ffff83c 2d 10

Which is very surprising for me as the PC isn't longword aligned. How could
this happen ?

Thomas.

diff -ru orig/cdrecord-1.6/cdrecord/fifo.c cdrecord-1.6/cdrecord/fifo.c
--- orig/cdrecord-1.6/cdrecord/fifo.c	Wed Nov  5 17:43:41 1997
+++ cdrecord-1.6/cdrecord/fifo.c	Sun Nov 16 01:25:15 1997
@@ -62,7 +62,7 @@
 #define	EDEBUG(a)
 #endif
 
-#define palign(x, a)	(((char *)(x)) + ((a) - 1 - (((unsigned)((x)-1))%(a))))
+#define palign(x, a)	(((char *)(x)) + ((a) - 1 - (((unsigned long)((x)-1))%(a))))
 
 typedef enum faio_owner {
 	owner_none,
diff -ru orig/cdrecord-1.6/cdrecord/scsi-linux-sg.c cdrecord-1.6/cdrecord/scsi-linux-sg.c
--- orig/cdrecord-1.6/cdrecord/scsi-linux-sg.c	Tue Nov  4 10:35:03 1997
+++ cdrecord-1.6/cdrecord/scsi-linux-sg.c	Sun Nov 16 14:18:33 1997
@@ -312,9 +312,9 @@
 	int	f;
 	int	tmo;
 {
-	tmo *= 100;
+	tmo *= HZ;
 	if (tmo)
-		tmo += 50;
+		tmo += HZ/2;
 
 	if (ioctl(f, SG_SET_TIMEOUT, &tmo) < 0)
 		comerr("Cannot set SG_SET_TIMEOUT.\n");
diff -ru orig/cdrecord-1.6/include/standard.h cdrecord-1.6/include/standard.h
--- orig/cdrecord-1.6/include/standard.h	Sun Jan 26 12:49:31 1997
+++ cdrecord-1.6/include/standard.h	Sun Nov 16 01:41:15 1997
@@ -182,7 +182,7 @@
 extern	int	wait_chld __PR((int));
 extern	int	geterrno __PR((void));
 extern	void	raisecond __PR((const char *, long));
-extern	int	snprintf __PR((char *, unsigned, const char *, ...));
+/* extern	int	snprintf __PR((char *, unsigned, const char *, ...)); */
 /*extern	int	sprintf __PR((char *, const char *, ...)); ist woanders falsch deklariert !!!*/
 extern	char	*strcatl __PR((char *, ...));
 extern	int	streql __PR((const char *, const char *));
diff -ru orig/cdrecord-1.6/lib/fillbytes.c cdrecord-1.6/lib/fillbytes.c
--- orig/cdrecord-1.6/lib/fillbytes.c	Sun Feb  4 18:40:33 1996
+++ cdrecord-1.6/lib/fillbytes.c	Sun Nov 16 14:15:19 1997
@@ -19,6 +19,21 @@
  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  */
 
+#ifdef __alpha__
+/* the fillbytes() below doesn't work on machines with sizeof(long) != 4 */
+/* and at least on Linux/Alpha memset does a better job */
+#ifdef	PROTOTYPES
+char *fillbytes(void *tov, int cnt, char val)
+#else
+char *fillbytes(tov, cnt, val)
+	void	*tov;
+	int	cnt;
+	char	val;
+#endif
+{
+	memset (tov, val, cnt);
+}
+#else
 #include <standard.h>
 #include <align.h>
 
@@ -83,3 +98,4 @@
 	} while (--n > 0);
 	return (to);
 }
+#endif
diff -ru orig/cdrecord-1.6/lib/movebytes.c cdrecord-1.6/lib/movebytes.c
--- orig/cdrecord-1.6/lib/movebytes.c	Sun Feb  4 18:40:34 1996
+++ cdrecord-1.6/lib/movebytes.c	Sun Nov 16 14:14:57 1997
@@ -19,6 +19,17 @@
  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  */
 
+#ifdef __alpha__
+/* the movebytes() below doesn't work on machines with sizeof(long) != 4 */
+/* and at least on Linux/Alpha memmove() does a better job */
+char *movebytes(fromv, tov, cnt)
+	const void	*fromv;
+	void		*tov;
+	int		cnt;
+{
+	memmove (tov, fromv, cnt);
+}
+#else
 #include <standard.h>
 #include <align.h>
 
@@ -117,3 +128,4 @@
 		return (ep);
 	}
 }
+#endif

-- 
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
                   [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1997-11-19 22:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <19971118082818.61406@alpha.franken.de>
1997-11-18 15:36 ` cdrecord on Linux/Alpha works Christopher Curtis
1997-11-19 21:30 ` Thomas Bogendoerfer
     [not found] <Pine.GSO.3.96.971118102415.23264A-100000@yacht.ee.fit.edu>
1997-11-19 22:33 ` Thomas Bogendoerfer
1997-11-18  7:28 Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox