* Porting siocons to Alpha
2003-01-03 19:46 raid 1 and nfs Nelson Brito
@ 2003-01-05 17:53 ` Richard Billingham
2003-01-05 20:06 ` Falk Hueffner
2003-01-06 16:03 ` Jay Estabrook
0 siblings, 2 replies; 6+ messages in thread
From: Richard Billingham @ 2003-01-05 17:53 UTC (permalink / raw)
To: RH alpha list
Hello.
I've got a program called siocons
(http://www.identicalsoftware.com/yaroze/siocons.tgz)
that's used to transfer data via the serial port to a programmable playstation.
The program functions correctly under Linux/Intel, but hangs when I try to use it on my Alpha
box. I'm assuming this means that programming differences on the two
platforms are preventing it from working correctly. My programming skills
are limited, but I found a page stating that some programs assume a long
is 32 bits. With this in mind, I replaced all instances of long with
u_int32_t, but to no avail!
Can you offer any pointers which could help me get this program working?
Regards,
Richard.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Porting siocons to Alpha
@ 2003-01-05 18:09 Robert M. Riches Jr.
2003-01-06 1:01 ` Richard Billingham
0 siblings, 1 reply; 6+ messages in thread
From: Robert M. Riches Jr. @ 2003-01-05 18:09 UTC (permalink / raw)
To: axp-list
> From: Richard Billingham <richard@billingham.co.uk>
> Date: Sun, 5 Jan 2003 17:53:58 +0000 (GMT)
>
> I've got a program called siocons
> (http://www.identicalsoftware.com/yaroze/siocons.tgz)
> that's used to transfer data via the serial port to a programmable playstation.
> The program functions correctly under Linux/Intel, but hangs when I try to use it on my Alpha
> box. I'm assuming this means that programming differences on the two
> platforms are preventing it from working correctly. My programming skills
> are limited, but I found a page stating that some programs assume a long
> is 32 bits. With this in mind, I replaced all instances of long with
> u_int32_t, but to no avail!
>
> Can you offer any pointers which could help me get this program working?
Actually, much if not most of the problem with many of these
programs is abuse of pointers. Some poor programmers seem to
think a pointer can be stuffed into an 'int', not realizing
the potential for size and other issues.
With some of these problematic programs, the -taso compiler
switch helps a great deal. This switch is not always documented
in man pages. IIRC, usage messages are more reliable about
this switch than the man pages. It is sometimes necessary to
prefix the -taso switch to the linker by wrapping it in another
switch. I don't remember off the top of my head the exact
syntax.
Another thing that helps is the personality() call. If you
call it early the program, later calls to malloc() and friends
will keep pointer values within the lower 2GB of address space,
which works around the problem of the program stuffing a pointer
into an int, at least if you're lucky. IIRC, the argument to
pass is PER_LINUX_32BIT. There are other values if the program
was written with other problematic assumptions.
Be careful with signed vs. unsigned. Changing an unqualified
'long' to 'u_int32_t' could cause issues, because if I understand
correctly the former is signed while the latter is unsigned.
(Please disregard if this is not wrong.)
There is hope, given a fair amount of luck. The -taso switch
and the personality(PER_LINUX_32BIT) call were sufficient
(along with fixing a buggy configuration script) to make Squeak
work on Alpha. Squeak is a Smalltalk implementation that is
extremely stuck on the notion that the whole world is 32 bits
wide. Every object reference slash pointer in the whole system
is crammed into 32 bits.
Good luck.
Robert Riches
rm.riches@verizon.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Porting siocons to Alpha
2003-01-05 17:53 ` Porting siocons to Alpha Richard Billingham
@ 2003-01-05 20:06 ` Falk Hueffner
2003-01-06 16:03 ` Jay Estabrook
1 sibling, 0 replies; 6+ messages in thread
From: Falk Hueffner @ 2003-01-05 20:06 UTC (permalink / raw)
To: axp-list
Richard Billingham <richard@billingham.co.uk> writes:
> My programming skills are limited, but I found a page stating that
> some programs assume a long is 32 bits. With this in mind, I
> replaced all instances of long with u_int32_t, but to no avail!
u_int32_t is probably an unsigned type (the C standard only specifies
uint32_t), while long is signed. Try using int32_t.
--
Falk
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Porting siocons to Alpha
2003-01-05 18:09 Porting siocons to Alpha Robert M. Riches Jr.
@ 2003-01-06 1:01 ` Richard Billingham
0 siblings, 0 replies; 6+ messages in thread
From: Richard Billingham @ 2003-01-06 1:01 UTC (permalink / raw)
To: axp-list
On Sun, 5 Jan 2003, Robert M. Riches Jr. wrote:
> With some of these problematic programs, the -taso compiler
>...
> Another thing that helps is the personality() call. If you
>...
> There is hope, given a fair amount of luck.
Thanks for the pointers Robert.
I've tried recompiling with the taso flag and I've inserted some code to
call the personality() function, but no dice...
I had a thought about another way to get this working, which was to use
the Intel binary I have with em86. I recompiled it using the -static flag,
but it still complains about 'no such file or directory' or some such
error. ldd reveals that it isn't dependent upon any external libraries.
any ideas?
Regards,
Richard.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Porting siocons to Alpha
2003-01-05 17:53 ` Porting siocons to Alpha Richard Billingham
2003-01-05 20:06 ` Falk Hueffner
@ 2003-01-06 16:03 ` Jay Estabrook
2003-01-07 23:27 ` Richard Billingham
1 sibling, 1 reply; 6+ messages in thread
From: Jay Estabrook @ 2003-01-06 16:03 UTC (permalink / raw)
To: axp-list
On Sun, Jan 05, 2003 at 05:53:58PM +0000, Richard Billingham wrote:
>
> I've got a program called siocons
>
> (http://www.identicalsoftware.com/yaroze/siocons.tgz)
>
> that's used to transfer data via the serial port to a programmable
> playstation. The program functions correctly under Linux/Intel, but
> hangs when I try to use it on my Alpha box.
When you say "hangs", do you mean the "siocons" program itself, the
playstation, or both?
From a cursory look, the program appears to have two parts: the
file-reading part (ecoff.c), and the downloading part (the rest).
Do you know if the file-reading part works correctly? What I mean is,
can you determine if the ecoff binary is read correctly by the code, and
set-up correctly to be downloaded. If it IS, then you know that the
problem is in the downloading...
--Jay++
-----------------------------------------------------------------------------
Jay A Estabrook HPTC - LINUX support
Hewlett-Packard Company - MRO1-2/K15 (508) 467-2080
200 Forest Street, Marlboro MA 01752 Jay.Estabrook@hp.com
-----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Porting siocons to Alpha
2003-01-06 16:03 ` Jay Estabrook
@ 2003-01-07 23:27 ` Richard Billingham
0 siblings, 0 replies; 6+ messages in thread
From: Richard Billingham @ 2003-01-07 23:27 UTC (permalink / raw)
To: axp-list
On Mon, 6 Jan 2003, Jay Estabrook wrote:
> When you say "hangs", do you mean the "siocons" program itself, the
> playstation, or both?
hello Jay.
the siocons program seems to hang during the transfer, the playstation
indicates that the transfer is 'done'. both the address and size reported
by the playstation are erroneous.
>
> >From a cursory look, the program appears to have two parts: the
> file-reading part (ecoff.c), and the downloading part (the rest).
>
> Do you know if the file-reading part works correctly? What I mean is,
> can you determine if the ecoff binary is read correctly by the code, and
> set-up correctly to be downloaded. If it IS, then you know that the
> problem is in the downloading...
>
> --Jay++
while having a poke around with some rudimentary reporting, to try to
figure out if the size was being calculated wrongly i inserted a line in
handshake_send from file.c :
/* write */
if ((n = write(ps_fd, &dat, 1)) < 0)
perror("write");
fprintf(stderr, "Writing: [%08x]", &dat); <-- inserted line
return n;
this seemed to affect the size the playstation was reporting. the first
time i tried it the transfer worked and the game loaded correctly, however
on subsequent tries the transfer aborted with a 'sync error'. i'm guessing
i've stumbled on a time-critical portion of the code? redirecting the rest
of the output to /dev/null got the transfers working again.
i've tried the program with a few other transfers and they are hit and
miss - sometimes they work, sometimes they don't. curiouser and curiouser!
is there some difference in the timings between the intel/alpha platforms
that would affect the transfer?
Regards,
Richard.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-01-07 23:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-05 18:09 Porting siocons to Alpha Robert M. Riches Jr.
2003-01-06 1:01 ` Richard Billingham
-- strict thread matches above, loose matches on Subject: below --
2003-01-03 19:46 raid 1 and nfs Nelson Brito
2003-01-05 17:53 ` Porting siocons to Alpha Richard Billingham
2003-01-05 20:06 ` Falk Hueffner
2003-01-06 16:03 ` Jay Estabrook
2003-01-07 23:27 ` Richard Billingham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox