Skip to contentSkip to conversation

Porting QEMU to PalmOS

Qemu-devel sinisa marovic 4 participants 5 messages Jun 4, 2007 – Jul 1, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

thanks for the tip about position-independent. I did compile with -fno-pic, and the
op.h was then generated without error. Now I have a different problem that might be related to PIC. The thing is, because of the nature of PalmOS, I had to link with -fPIC. Now, after removing the faults, I have reached the execution loop in cpu-exec.c and invoking of gen_func, nothing is realy happening, the loop is being executed, but after printing the data at the address of gen_func, I could see that there are all zeroes. Might that be because of linking with -fPIC? If so, I will have to use different way to link it, and it might take a while.
If not, where to search for the fault? I have also debugged the host_alarm_handler, and found out that although realtime timer expires, it is not initialized again. Where exactly in the code is it done? I tried to find the place, but those timer functions are structure members, and it is hard to find a place.

/Voda

----- Original Message ----
From: Wolfgang Schildbach <[email protected]>
To: [email protected]
Sent: Wednesday, May 23, 2007 5:23:51 PM
Subject: Re: [Qemu-devel] Porting QEMU to PalmOS

Try compiling as position-dependent (i.e. not PIC) code. GOT is a typical feature of position independent code.

- Wolfgang

qemu-devel-bounces+wolfgang.schildbach=codingtechnologies.com@nongnu.org wrote on 23.05.2007 13:20:22:

Quoted 8 lines

Hi Johannes,

thanks for your quick response.
I thought QEMU was already compiled and run on an ARM machine? If so, how come that noone else had such problem (I searched for it on google),
and PXA255 is a standard ARM CPU with a few additional instructions. And how to make them not come from GOT, those vars are declared as

extern,

Quoted 25 lines

so they are globals?

BR,
Voda.

----- Original Message ----
From: Johannes Schindelin <[email protected]>
To: sinisa marovic <[email protected]>
Cc: [email protected]
Sent: Wednesday, May 23, 2007 12:48:59 PM
Subject: Re: [Qemu-devel] Porting QEMU to PalmOS

Hi,

Quoted 9 lines · sinisa marovic

Relocation types that fail are 25 and 26, which are R_ARM_GOTPC and R_ARM_GOT32 respectively. Their names are:

_GLOBAL_OFFSET_TABLE_
cc_table
__op_param1
__op_param2
__op_param3

Quoted 4 lines
Quoted 1 line

Is there a way to fix this?

The GOT is an offset table. Many CPUs have fixed-size instruction sets, which means that you cannot easily jump to an absolute address, since

the

Quoted 4 lines

address alone would already fill up the size.

Of course, this is a no-no for QEmu, since the _same_ function snippet will be reused _multiple_ times. So, the address must not come from a

GOT,

Quoted 3 lines

but be inserted directly into the code.

I do not remember off-hand how I managed to do this a couple of years

ago,

Quoted 1 line

when I worked on a MIPS host, but there _are_ gcc options to avoid a

GOT.

Quoted 7 lines

Hth,
Dscho

Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.

____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

#1 lore raw
Quoted 5 lines · sinisa marovic

I'm afraid I will have to dissapoint you: it will be only isapc with no networking or other fancy devices. Main goal is the ability to run dos games. I do not know how familiar are you with PalmOS developer support. It is poor, gcc lack many important functions that have to be written from scratch. When I ported dosbox (which is written in c++)

(Happily violating the GPL)

Will the qemu port also be binary only?

Sorry for being off-topic.
Regards

#2 lore raw
Quoted 10 lines · andrzej zaborowski
Quoted 5 lines · sinisa marovic

I'm afraid I will have to dissapoint you: it will be only isapc with no networking or other fancy devices. Main goal is the ability to run dos games. I do not know how familiar are you with PalmOS developer support. It is poor, gcc lack many important functions that have to be written from scratch. When I ported dosbox (which is written in c++)

(Happily violating the GPL)

Will the qemu port also be binary only?

What did he say that violates the GPL? Just because he is only porting the isapc stuff? I don't know any part of the GPL saying "when you port this, you must port all the features"... Or would such a port be inherently a violation due to system libraries being incompatible with the [L]GPL?

#3 lore raw

Hi,

Quoted 10 lines · Luke-Jr
Quoted 7 lines · andrzej zaborowski
Quoted 1 line · sinisa marovic

[...] When I ported dosbox (which is written in c++)

(Happily violating the GPL)

Will the qemu port also be binary only?

What did he say that violates the GPL?

I think he was talking about dosbox. And expressing an implicit interest that whatever will be ported from qemu be handled differently.

Ciao,
Dscho

#4 lore raw
In reply to Luke-Jr
Quoted 7 lines · Luke-Jr
Quoted 6 lines · andrzej zaborowski
Quoted 5 lines · sinisa marovic

I'm afraid I will have to dissapoint you: it will be only isapc with no networking or other fancy devices. Main goal is the ability to run dos games. I do not know how familiar are you with PalmOS developer support. It is poor, gcc lack many important functions that have to be written from scratch. When I ported dosbox (which is written in c++)

Referring to this sentence ^

Quoted 9 lines
Quoted 4 lines

(Happily violating the GPL)

Will the qemu port also be binary only?

What did he say that violates the GPL? Just because he is only porting the isapc stuff? I don't know any part of the GPL saying "when you port this, you must port all the features"... Or would such a port be inherently a violation due to system libraries being incompatible with the [L]GPL?

Releasing the dosbox PalmOS binary and not releasing the sources even when explicitly asked to is a violation of GPL and of the policy of sourceforge.net and a couple of other websites on which the binary appears.

Regards