Alpha linux-user support
Hello
I forget who is working on the Alpha architecture support.
I've managed to scrounge together a working Alpha machine from that parts of 3 broken machines, and it is running debian and has been stable so far.
I tried compiling some simple binaries (on the Alpha) and running them with qemu alpha-linux-user (on an x86_64 machine) with no luck. The gdb interface seems to be broken as well, making it hard to track down what the issues are.
Is there anything I can do to help out the architecture, or should I wait until some more TCG work has been done?
Vince
Quoted 3 lines · Vince Weaver
I tried compiling some simple binaries (on the Alpha) and running them with qemu alpha-linux-user (on an
x86_64machine) with no luck.
How is it failing? All I was able to run was some simple hand written assembly programs. For C programs I got:
- Illegal instruction, no matter what CPU setting I am giving to gcc;
to get around this try to add ctx->amask |= AMASK_BWX to
cpu_alpha_init- once the amask is set I get "kernel too old".
Basically my Alpha cross toolchain does not look right or there's a bug in the translator.
Laurent
Hello
First, I found a bug in the alpha emulation of the "ret" instruction, see a separate e-mail to the list.
Quoted 2 lines
How is it failing? All I was able to run was some simple hand written assembly programs. For C programs I got:
For C programs I get infinite "Unsupported Syscall 394" errors.
This is the futex() syscall. Maybe my toolchain (gcc 4.2.4) is trying to make NPTL binaries. Hmmm.
I've attached my simple assembly program I am working with. It should print hello world, but doesn't because the address passed to the write syscall is wrong. I can't easily track down where things are going wrong though because the gdbstub doesn't work for alpha. Does anyone know the status of that?
Vince
# as -o hello.o hello.s ; ld -o hello hello.o
.equ SYSCALL_EXIT,1
.equ SYSCALL_WRITE,4
.equ STDIN,0
.equ STDOUT,1
.equ STDERR,2
.globl _start_start:
br $27,0 # fake branch, to grab the location
# of our entry point
ldgp $gp,0($27) # load the GP proper for our entry point
# this does automagic stuff... # gp is used for 64-bit jumps and constants # so if you use "la" and the like it will # load from gp for you.
lda $17,hello_string
br $26,write_stdout
#================================
# Exit
#================================
exit:
clr $16 # 0 exit value
mov SYSCALL_EXIT,$0 # put the exit syscall number in v0
callsys # and exit
#================================
# WRITE_STDOUT
#================================
# $17 has string
# $1 is trashed
write_stdout:
ldil $0,SYSCALL_WRITE # Write syscall in $0 ldil $16,STDOUT # 1 in $16 (stdout) clr $18 # 0 (count) in $18
str_loop1:
addq $17,$18,$1 # offset in $1 ldbu $1,0($1) # load byte addq $18,1,$18 # increment pointer bne $1,str_loop1 # if not nul, repeat subq $18,1,$18 # correct count callsys # Make syscall ret $26 # return
#===========================================================================
.data
#===========================================================================
hello_string: .ascii "Hello World\n\0"
Quoted 3 lines · Vince Weaver
First, I found a bug in the alpha emulation of the "ret" instruction, see a separate e-mail to the list.
[...]
Quoted 5 lines
I've attached my simple assembly program I am working with. It should print hello world, but doesn't because the address passed to the write syscall is wrong. I can't easily track down where things are going wrong though because the gdbstub doesn't work for alpha. Does anyone know the status of that?
After applying your ret patch, it works for me on an x86_64 platform. However the first callsys instruction fails on ia32 and returns EFAULT (bad address).
In fact what happens looks like a problem of 64 -> 32 bit mapping:page_check_range fails (called by access_ok which is called by lock_user in do_syscall). It doesn't like the 0x120010100 address.
Laurent
Vince,
I did some work on the alpha side.
There is at least a compilable example in test/ dir.
Using a slightly older version of glibc and -static, I was also able to run some native programs (ie an hello-world using printf is ok).
Use a 64 bits host.
Tristan.
Quoted 3 lines · Vince Weaver
Hello
I forget who is working on the Alpha architecture support.
There is no maintainer, only a few people sending patches
Quoted 8 lines
I've managed to scrounge together a working Alpha machine from that parts of 3 broken machines, and it is running debian and has been stable so far.
I tried compiling some simple binaries (on the Alpha) and running them with qemu alpha-linux-user (on an
x86_64machine) with no luck. The gdb interface seems to be broken as well, making it hard to track down what the issues are.
I am personally able to run statically compiled C program if they are built with a non-NPTL toolchain.
Quoted 3 lines
Is there anything I can do to help out the architecture, or should I wait until some more TCG work has been done?
Patches are welcome.
Aurelien
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net