* 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
* Re: cdrecord on Linux/Alpha works
[not found] <19971118082818.61406@alpha.franken.de>
@ 1997-11-18 15:36 ` Christopher Curtis
1997-11-19 21:30 ` Thomas Bogendoerfer
1 sibling, 0 replies; 4+ messages in thread
From: Christopher Curtis @ 1997-11-18 15:36 UTC (permalink / raw)
On Tue, 18 Nov 1997, Thomas Bogendoerfer wrote:
> 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).
Hello,
Sorry for my ignorance, but we got an Alpha UDB as an entry-level system
to learn some of the peculiarities of porting to a 64 it system. We
haven't finished our code yet (doh!) to start going 64-bit clean; what is
"HZ" and its relationship to 100 (or not, in the Linux/Alpha case)?
Also, if you don't mind me asking, what can I do about this? Our code is
into two distinct parts: a UI portion, and a DLL portion (yeah, it's an NT
thing), which does all the needed calculations and memory operations. The
API is hidden behind 'wrapper' functions, such as:
MyAPI_Get( MyAPIptr, API_TYPE, "an.api.property" ); (MT-Unsafe)
MyAPI_Set( MyAPIptr, API_TYPE, "an.api.property", void *Value );
This was halfheartedly designed in the XView paradigm (typically a SunOS
shop) where all return values are strings and the "void *Value" bit can
be anything, which is typcast as needed by the property. But I have a
problem: For one specific property, I want to pass the address of a
function (callback handler). GCC complains to no ends about it.
Naturally, the Microsoft compiler thinks it's great. :)
I guess my question is will this work on an Alpha? Will a function
pointer fit within a void pointer? Does anyone know about the UltraSPARC?
Or a 'proper' workaround that adds no complexity to the user API?
Thanks immensely,
--
Christopher Curtis - http://www.ee.fit.edu/users/ccurtis
Florida Institute of Technology - System Administrator, Programmer
Melbourne, Florida USA - http://www.lp.org/
--
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
* Re: cdrecord on Linux/Alpha works
[not found] <19971118082818.61406@alpha.franken.de>
1997-11-18 15:36 ` Christopher Curtis
@ 1997-11-19 21:30 ` Thomas Bogendoerfer
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 1997-11-19 21:30 UTC (permalink / raw)
> Below is a patch, which fixes these problems. I was able to successful
I've forgot to mention that this patch is against cdrecord-1.6a5.tar.gz
from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/alpha
Some other notes I've forgot in my first mail:
You need to increase the maximum size of a shared memory segment to
be able to use the default fifo size of 4BM (increase SHMMAX in
asm-alpha/shmparam.h; I'm using 0x2000000, which I took from
asm-i386/shmparam.h). You can also reduce the fifo size by using
fs= as cdrecord option.
You need the patch for mlockall(), which is included in 2.0.31 (neither
2.0.31 nor 2.0.32pre5 worked for me without flaws on my Alpha, so I took
the patch from 2.0.31 (only for file mm/mlock.c) and put it into my
2.0.29 kernel.
And finally I had to upgrade the NCR538xx driver to the version included
in 2.0.31 or higher (I'm using 2.6b), otherwise the scsi driver couldn't
interpret the respones from my JVC XR2010.
Thomas.
--
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
* Re: cdrecord on Linux/Alpha works
[not found] <Pine.GSO.3.96.971118102415.23264A-100000@yacht.ee.fit.edu>
@ 1997-11-19 22:33 ` Thomas Bogendoerfer
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 1997-11-19 22:33 UTC (permalink / raw)
> Sorry for my ignorance, but we got an Alpha UDB as an entry-level system
> to learn some of the peculiarities of porting to a 64 it system. We
> haven't finished our code yet (doh!) to start going 64-bit clean; what is
> "HZ" and its relationship to 100 (or not, in the Linux/Alpha case)?
some timers and timeouts are measured in ticks. One tick is 10ms on
Linux/Intel, but 1ms (1/1024s to be exact) on Linux/Alpha. The HZ
define gives you the number of ticks per second, so nobody has to
hardcode it in its source, which leads to wrong timings when compiled
on the "wrong" platform.
> I guess my question is will this work on an Alpha? Will a function
> pointer fit within a void pointer? Does anyone know about the UltraSPARC?
sure. And I don't see a reason, why this shouln'd work on UltraSPARC too.
Thomas.
--
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] <Pine.GSO.3.96.971118102415.23264A-100000@yacht.ee.fit.edu>
1997-11-19 22:33 ` cdrecord on Linux/Alpha works Thomas Bogendoerfer
[not found] <19971118082818.61406@alpha.franken.de>
1997-11-18 15:36 ` Christopher Curtis
1997-11-19 21:30 ` 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