From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <92c61013625c4d74cf55c5327091daa2.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199711180440.UAA10881@proto.math.ucdavis.edu> Date: Tue, 18 Nov 1997 08:28:18 +0100 From: Thomas Bogendoerfer Subject: cdrecord on Linux/Alpha works 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 #include @@ -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 #include @@ -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