Skip to contentSkip to conversation

Patch: Sparc system support

Qemu-devel Blue Swirl 5 participants 6 messages Sep 26, 2004 – Oct 2, 2004

lore
Share & tools
lore

Blue Swirl

author
#0 lore raw

Hi,

This version of Sparc system emulation can load ELF kernels (see screenshot), like Linux or *BSD using a hacked (patch attached) Proll. The kernels won't run very far, there is still much work to do. Also new to previous patch is m48t08 NVRAM chip support, based on the PPC's newer m48t59.

How to try: Patch Proll, compile, convert mrcoffee/proll.elf to binary with objdump -O binary. Configure Qemu with ./configure --target-list="sparc-softmmu". Run qemu-system-sparc with -L path_to_proll -kernel vmlinux or bsd.

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

#1 lore raw

I applied your patches with some modifications. Please update your sources with the CVS version and tell me if you see problems in my modifications.

You should provide at least a binary BIOS image so that I can make regression tests. I can also put a link on the web site so that you can give specific information about the SPARC port.

A few notes:

- The 'env->access_type' you used (as in the PowerPC version) will soon be deprecated as it is too complicated and broken. I will make the appropriate modifications.

- 'magic-load.c' is not acceptable as it uses GPL code. Moreover, the user ELF loader code is too complicated, so it is better to rewrite it from scratch. You can still use the ELF swap functions as I wrote them.

Thank you for your work !

Fabrice.

Quoted 20 lines · Blue Swirl

Hi,

This version of Sparc system emulation can load ELF kernels (see screenshot), like Linux or *BSD using a hacked (patch attached) Proll. The kernels won't run very far, there is still much work to do. Also new to previous patch is m48t08 NVRAM chip support, based on the PPC's newer m48t59.

How to try: Patch Proll, compile, convert mrcoffee/proll.elf to binary with objdump -O binary. Configure Qemu with ./configure --target-list="sparc-softmmu". Run qemu-system-sparc with -L
path_to_proll -kernel vmlinux or bsd.

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

------------------------------------------------------------------------

------------------------------------------------------------------------

_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel

#2 lore raw
Quoted 3 lines · Fabrice Bellard

I applied your patches with some modifications. Please update your sources with the CVS version and tell me if you see problems in my modifications.

Yes, I do ;-)

With the latest cvs I get stuck during the compilation inside sparc-user. (I am working on a linuxppc host)

In file included from
/....... /qemu/translate-all.c:41:
op.h: In function `dyngen_code':
op.h:4781: error: parse error before ')' token
op.h:4782: error: parse error before ')' token
op.h:4797: error: parse error before ')' token
op.h:4798: error: parse error before ')' token

In fact there is something wrong in the op.h file:

Line 4778:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 30) = ((long)(&) + 0);
    gen_code_ptr += 56;
}

(long)(&) .... the operand is missing.

The same error appears again some lines below:

Line 4794:

case INDEX_op_fitod: {
    extern void op_fitod();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitod+0), 52);
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 8 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 30) = ((long)(&) + 8);
    gen_code_ptr += 52;
}

ciao
renzo

#3 lore raw

Hi,

Quoted 11 lines · Renzo Davoli

In fact there is something wrong in the op.h file:

Line 4778:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 30) = ((long)(&) + 0);
    gen_code_ptr += 56;
}
Quoted 1 line

(long)(&) .... the operand is missing.

This most likely means that your op.o has a relocation without a proper symbol name. This can happen if a relocation is split into loword and hiword on some architectures. What host are you compiling for?

Looking at target-sparc/op.c, I see that op_fitos does not take any __op_param parameters, but rather just stores env->ft1 into env->ft0. So maybe those relocations are not necessary. You can try that by hacking dyngen.c after the "/* patch relocations */" line to just ignore those without a proper name. YMMV.

Hth,
Dscho

#4 lore raw
Quoted 1 line · Johannes Schindelin

Hi,

Hi,

Quoted 13 lines · Renzo Davoli
Quoted 12 lines

In fact there is something wrong in the op.h file:

Line 4778:

case INDEX_op_fitos: {
    extern void op_fitos();
    memcpy(gen_code_ptr, (void *)((char *)&op_fitos+0), 56);
    *(uint16_t *)(gen_code_ptr + 26) = ((long)(&) + 0 + 0x8000) >> 16;
    *(uint16_t *)(gen_code_ptr + 30) = ((long)(&) + 0);
    gen_code_ptr += 56;
}
Quoted 5 lines
Quoted 1 line

(long)(&) .... the operand is missing.

This most likely means that your op.o has a relocation without a proper symbol name. This can happen if a relocation is split into loword and hiword on some architectures. What host are you compiling for?

I also had issues like this with PPC some opcodes. I noticed that this happened when gcc uses local variables. The solution I found was to rewrite some micro-operations to make them simpler to compile and make others helper functions (so the micro-op is just a function call), for the more complex ones.

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#5 lore raw

Hi,

Quoted 9 lines · J. Mayer
Quoted 3 lines

This most likely means that your op.o has a relocation without a proper symbol name. This can happen if a relocation is split into loword and hiword on some architectures. What host are you compiling for?

I also had issues like this with PPC some opcodes. I noticed that this happened when gcc uses local variables. The solution I found was to rewrite some micro-operations to make them simpler to compile and make others helper functions (so the micro-op is just a function call), for the more complex ones.

I guess that the current CVS reflects your work, right? Anyway, after working a bit on an IRIX host port, I am quite confident that all relocations which don't concern variables beginning with "__op_" are irrelevant, and could be left alone. Those relocations are almost definitely handled by the linker already.

The file op.o *is* linked into libqemu.a, because there would be no code to actually be dynamically copied. I will explain the dynamic translation in an other post very soon.

Ciao,
Dscho