English Amiga Board


Go Back   English Amiga Board > Support > support.OtherUAE

 
 
Thread Tools
Old 08 April 2010, 08:34   #121
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
@foul: i need to see "bt" from gdb :}
and why didn't you mention that you don't have sound?

Quote:
ALSA lib pcm_dmix.c:975snd_pcm_dmix_open) unable to create IPC semaphore
SDL: Couldn't open audio: Fragment size must be a power of two
Sound driver unavailable: Sound output disabled
________
BMW R68

Last edited by GnoStiC; 20 January 2011 at 11:14.
GnoStiC is offline  
Old 08 April 2010, 09:09   #122
gilgamesh
Linux snob
 
gilgamesh's Avatar
 
Join Date: Sep 2008
Location: Monkey Island
Posts: 997
problems resolved, I could do my favourite test: Turrican2
gilgamesh is offline  
Old 08 April 2010, 09:42   #123
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
Quote:
@xaind: this should fix some of your problems as well.
and i need you to post/mail me the sigcontext.h from your apple
Ok, that's fixed the issue with the zfile symbol. I still get this problem though.

Code:
Undefined symbols:
  "regflags", referenced from:
      _op_0000_0_ff in libcpuemu.a(cpuemu_0.o)
      _op_0000_0_ff in libcpuemu.a(cpuemu_0.o)
      ... skipping a few hundred of these ...
      _op_e7f9_12_ff in libcpuemu.a(cpuemu_12.o)
      _op_e7f9_12_ff in libcpuemu.a(cpuemu_12.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I can't figure out why the linker can't see the regflags defined in newcpu.o.

Regarding sigcontext: There is no sigcontext.h in my headers. There is a sigcontext structure defined in the one of the PPC headers, which won't help here, but there's nothing in the i386 headers.

It looks like Apple expects you to either

a) Have a signal handler that only takes one integer argument

OR

b) Use the sigaction() system call to set up the signal handler with the SA_SIGINFO flag. The handler function can then be defined to take the integer, a pointer to a siginfo structure, and a pointer to a ucontext structure. The ucontext structure contains an mcontext structure, which has a member structure containing all the members required (eax, eip etc.) except cr2.

That's about as much as I've been able to figure out so far. More info here and here.
xaind is offline  
Old 08 April 2010, 09:54   #124
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,545
my problem has changed from 'mouse' to 'joystick' in this version

Code:
gcc -DHAVE_CONFIG_H -I. -I../../src  -DCPUEMU_0 -DCPUEMU_11 -DCPUEMU_12 -DCPUEMU_20 -DCPUEMU_31 -DMMU -DFPUEMU -DUNALIGNED_PROFITABLE -DJIT -DAGA -DAUTOCONFIG -DFILESYS -DBSDSOCKET -DSUPPORT_THREADS -DFDI2RAW -DDEBUGGER -DSAVESTATE -DENFORCER -DACTION_REPLAY -DXARCADE -DDRIVESOUND -DSHM_SUPPORT_LINKS=1 -I../../src/include -I../../src -I../../src  -fomit-frame-pointer -ffast-math   -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes -fno-strength-reduce -DREGPARAM="__attribute__((regparm(3)))"      -m32 -MT joystick.o -MD -MP -MF .deps/joystick.Tpo -c -o joystick.o joystick.c
joystick.c:68: warning: initialization from incompatible pointer type
joystick.c:69: warning: initialization from incompatible pointer type
joystick.c:71: warning: initialization from incompatible pointer type
joystick.c:72: warning: initialization from incompatible pointer type
joystick.c:73: warning: initialization from incompatible pointer type
joystick.c:74: warning: initialization from incompatible pointer type
joystick.c:76: warning: initialization from incompatible pointer type
joystick.c:76: warning: missing initializer
joystick.c:76: warning: (near initialization for ‘inputdevicefunc_joystick.get_widget_first’)
joystick.c:82: error: conflicting types for ‘input_get_default_joystick’
../../src/include/inputdevice.h:73: error: previous declaration of ‘input_get_default_joystick’ was here
make[3]: *** [joystick.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
sorry for the short report, i need to get to work!
Hungry Horace is offline  
Old 08 April 2010, 09:57   #125
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
@xaind:
i'll code something "blindly" hoping that it'll work and upload asap.. :}
________
herbal vaporizers

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 08 April 2010, 10:14   #126
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
Quote:
Originally Posted by GnoStiC View Post
@foul: i need to see "bt" from gdb :}
and why didn't you mention that you don't have sound?
just because i can't reach the workbench to launch some progs .. and with a floppy game, i got sounds

i'm @ work ... will post the "bt" report asap..

and just a word to say thank you for all your work
Foul is offline  
Old 08 April 2010, 10:23   #127
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
more fixes;
http://www.gamzeguckiran.com/puaex_2010_04_08-2.tar.gz

@xaind: i hope this works for you :}
________
vaporizer pipe

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 08 April 2010, 10:26   #128
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,573
Looks like (function names in compilation errors look very familiar..) this is quick'n'dirty partial winuae merge

Nothing bad in that, at least there is finally some real progress, unfortunately I don't think I can't really help with these kind of issues.
Toni Wilen is offline  
Old 08 April 2010, 10:35   #129
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
puae (e-uae) has different deps for different machines/oses.. sometimes i choose to, sometimes i forget to code/patch every dependencies..

besides i only have ubuntu x86 here so i can't test for apple, ppc etc :}

and what i'm trying to do is to have a winuae clone so that when you release a newer version, it'll be easy for me to patch puae :}

cheers,

Quote:
Originally Posted by Toni Wilen View Post
Looks like (function names in compilation errors look very familiar..) this is quick'n'dirty partial winuae merge

Nothing bad in that, at least there is finally some real progress, unfortunately I don't think I can't really help with these kind of issues.
________
cheap easy vape vaporizer

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 08 April 2010, 10:41   #130
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
@GnoStiC: I have attached modified versions of compemu_support.c and compemu_raw_x86.c. I think this correctly implements the sigaction way of handling the signal. It compiles, at least.

(These are modified from the 2010_04_08 versions of these files, *not* the 2010_04_08-2 versions.)

Now all that remains is the undefined symbol "regflags" problem.
Attached Files
File Type: zip Compemu_Mac.zip (42.9 KB, 129 views)
xaind is offline  
Old 08 April 2010, 10:49   #131
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
P.S. to my above post: In the code I posted the line

Code:
uae_u32 addr = uap->uc_mcontext->es.faultvaddr;
is a complete guess. The "es" member of us_mcontext is the "exception state". It contains members trapno, err and faultvaddr. This was the only field I could see that looked like it might be the right substitute for cr2.

Does it sound right, at least?
xaind is offline  
Old 08 April 2010, 10:56   #132
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
@xaind:
why use es while we have cr2 in ucontext?
can you please try my version, too?

@all:
it's 11:53am here, it'll be a busy afternoon so i won't be around until tomorrow. we'll continue fixing then :}
________
cheap volcano vaporizer

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 08 April 2010, 12:23   #133
Foul
Registered User
 
Foul's Avatar
 
Join Date: Jun 2009
Location: Perigueux/France
Age: 49
Posts: 1,516
Send a message via ICQ to Foul Send a message via MSN to Foul
Quote:
Originally Posted by GnoStiC View Post
@foul: i need to see "bt" from gdb :}
and why didn't you mention that you don't have sound?
Code:
* configuration check trigger                                                                
CPU cycleunit: 256 (0,500)                                                                   

Program received signal SIGSEGV, Segmentation fault.
get_fileinfo (unit=<value optimized out>, packet=0x7fffe9328400 "", info=2106000, aino=0x2fc9cd0) at filesys.c:2834
2834            put_byte (info + i, *x), i++, x++;                                                                 
(gdb) bt                                                                                                           
#0  get_fileinfo (unit=<value optimized out>, packet=0x7fffe9328400 "", info=2106000, aino=0x2fc9cd0) at filesys.c:2834
#1  0x000000000081b5ca in action_examine_object (unit=0x2fc7220, packet=0x7fffe9328400 "") at filesys.c:3281           
#2  0x000000000081d951 in handle_packet (unit=0x2fc7220, pck=0x7fffe9328400 "") at filesys.c:4868                      
#3  0x000000000081e339 in filesys_handler (context=<value optimized out>) at filesys.c:5013                            
#4  0x0000000000446b42 in m68k_handle_trap (trap_num=<value optimized out>) at traps.c:162                             
#5  0x0000000000416849 in op_illg (opcode=40978) at newcpu.c:2243                                                      
#6  0x00000000004169b9 in op_illg_1 (opcode=2106009) at newcpu.c:187                                                   
#7  0x000000000041430d in m68k_run_2 () at newcpu.c:3091                                                               
#8  0x00000000004160b3 in m68k_go (may_quit=<value optimized out>) at newcpu.c:3231                                    
---Type <return> to continue, or q <return> to quit---
#9  0x000000000040991c in real_main2 (argc=1, argv=0x7fffffffe308) at main.c:928
#10 real_main (argc=1, argv=0x7fffffffe308) at main.c:956
#11 0x0000000000409fe4 in main (argc=1, argv=0x7fffffffe308) at main.c:969
(gdb) q
A debugging session is active.

        Inferior 1 [process 5384] will be killed.

Quit anyway? (y or n)
Foul is offline  
Old 08 April 2010, 14:03   #134
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
Quote:
Originally Posted by GnoStiC View Post
@xaind:
why use es while we have cr2 in ucontext?
can you please try my version, too?
There's no cr2 member in the ucontext structure nor the mcontext structure in Apple's headers.

They also don't define a "gregs" member, nor the REG_XXX constants, so your version doesn't compile.

The headers are seriously convoluted, but here are the definitions of the structures:

Code:
In sys/_structs.h

#define _STRUCT_UCONTEXT    struct ucontext

...

_STRUCT_UCONTEXT
{
    int            uc_onstack;
    __darwin_sigset_t    uc_sigmask;    /* signal mask used by this context */
    _STRUCT_SIGALTSTACK     uc_stack;    /* stack used by this context */
    _STRUCT_UCONTEXT    *uc_link;    /* pointer to resuming context */
    __darwin_size_t        uc_mcsize;    /* size of the machine context passed in */
    _STRUCT_MCONTEXT    *uc_mcontext;    /* pointer to machine specific context */
};

In i386/_structs.h:

#define    _STRUCT_MCONTEXT32    struct mcontext32
_STRUCT_MCONTEXT32
{
    _STRUCT_X86_EXCEPTION_STATE32    es;
    _STRUCT_X86_THREAD_STATE32    ss;
    _STRUCT_X86_FLOAT_STATE32    fs;
};

In mach/i386/_structs.h:

#define    _STRUCT_X86_THREAD_STATE32    struct i386_thread_state
_STRUCT_X86_THREAD_STATE32
{
    unsigned int    eax;
    unsigned int    ebx;
    unsigned int    ecx;
    unsigned int    edx;
    unsigned int    edi;
    unsigned int    esi;
    unsigned int    ebp;
    unsigned int    esp;
    unsigned int    ss;
    unsigned int    eflags;
    unsigned int    eip;
    unsigned int    cs;
    unsigned int    ds;
    unsigned int    es;
    unsigned int    fs;
    unsigned int    gs;
};

...

#define _STRUCT_X86_EXCEPTION_STATE32    struct i386_exception_state
_STRUCT_X86_EXCEPTION_STATE32
{
    unsigned int    trapno;
    unsigned int    err;
    unsigned int    faultvaddr;
};
xaind is offline  
Old 09 April 2010, 07:39   #135
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
@xaind:

i've learnt a lot from these three:
1) http://rsync.slackware.pl/splack/spl...1/configure.in
2) http://www.filewatcher.com/p/SheepSh...gsegv.cpp.html
3) http://git.savannah.gnu.org/gitweb/?...049316;hb=HEAD

also let's try asm/sigcontext
Code:
#ifdef NATMEM_OFFSET
#ifdef _WIN32 // %%% BRIAN KING WAS HERE %%%
#include <winbase.h>
#else
#include <asm/sigcontext.h>
#endif
#include <signal.h>
i still can't understand why cr2 (it's a register for god's sake) is missing in macos headers.
________
K1200R

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 09 April 2010, 09:36   #136
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
There's no asm/sigcontext.h header.

I had a look at those examples you linked, but they all appear to be old, dating from 2005 or earlier. It looks like Apple used to have a sigcontext, but there is no longer any sigcontext anywhere in the current headers (except for PPC, which doesn't help).

I checked the SDK for the previous version of Mac OS X (i.e. 10.5) and there isn't anything there either.

In the SDK for 10.4 there is a struct sigcontext defined in i386/signal.h, but even this is wrapped inside

Code:
#ifdef __APPLE_API_OBSOLETE
.. and it doesn't have a cr2 member.
xaind is offline  
Old 09 April 2010, 10:43   #137
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
@xaind:
http://lists.apple.com/archives/Darw.../msg00117.html

Quote:
There are actually a bunch of different ucontext formats. The ucontext format will generally be changed (or it's ID changed) when we release a new set of tools or a new version of the OS, or a new platform (which happens to require it). How to decode it is based on its ID, and that's subject to change.

For example, the uc_mcontext field is a structure pointer or literal inlined data, depending. The context can be 32 bit, 64 bit, or both (which was needed to support 64 bit leaf functions on PPC64 code called from PPC32 code).

There's really a lot of tricky, ugly stuff that happens in there, and you can't depend on it (you can only depend on us to update the tools we ship at the same time we ship the OS, if we've updated the OS between one release and the next).

-- Terry
________
Harley-Davidson Peashooter

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 09 April 2010, 10:44   #138
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
Regarding the problem I was having with "regflags":

Code:
Undefined symbols:
  "regflags", referenced from:
      _op_0000_0_ff in libcpuemu.a(cpuemu_0.o)
      _op_0000_0_ff in libcpuemu.a(cpuemu_0.o)
      ... skipping a few hundred of these ...
      _op_e7f9_12_ff in libcpuemu.a(cpuemu_12.o)
      _op_e7f9_12_ff in libcpuemu.a(cpuemu_12.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
I tried editing the file src/md-i386-gcc/m68kops.h and changed all the references to regflags inside asm instructions to references to _regflags.

For example this was in the original:

Code:
"movb %%al,regflags\n\t"
and I changed it to this:

Code:
"movb %%al,_regflags\n\t"
I didn't change the references to regflags that were in C code, though.

After doing that, I no longer get the undefined symbols error.
xaind is offline  
Old 09 April 2010, 11:38   #139
GnoStiC
PUAE maintainer
 
GnoStiC's Avatar
 
Join Date: Feb 2010
Location: fort lauderdale
Posts: 195
sorry, i forgot about that. just add;
Code:
struct flag_struct regflags;
after the includes to /src/md-i386-gcc/support.c

Quote:
Originally Posted by xaind View Post
Regarding the problem I was having with "regflags":
________
XT250

Last edited by GnoStiC; 20 January 2011 at 11:15.
GnoStiC is offline  
Old 09 April 2010, 14:09   #140
xaind
Registered User
 
Join Date: Apr 2006
Location: Sydney / Australia
Posts: 113
Quote:
Originally Posted by GnoStiC View Post
It sounds like we can't rely on getting any context information from Mac OS X in the signal handler. Can we work around this in any way?

Quote:
sorry, i forgot about that. just add;
Code:
struct flag_struct regflags;
after the includes to /src/md-i386-gcc/support.c
I still get the "undefined symbol" error when I do this.

I ran "nm" to list the symbol table for support.o after making this change, and the symbol shows up as "_regflags", just like it does in newcpu.o.
xaind is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
E-UAE for Mac VerizonLover support.OtherUAE 1 20 August 2012 07:18
FS-UAE For Mac webneta support.FS-UAE 10 12 May 2012 16:10
Install Workbench3.1 E-UAE Mac OS popto support.OtherUAE 6 08 August 2011 14:06
What's needed to compiling PUAE on Mac OS X nexusle support.OtherUAE 0 28 July 2010 21:03
Any UAE for G3 Mac running Ubuntu? Fingerlickin_B support.OtherUAE 7 05 February 2008 11:34

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:32.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10920 seconds with 14 queries