From: Gwenole B. <gb...@di...> - 2004-01-20 22:05:47
|
Hi, > I have not looked at the SS code but maybe the concepts are similar to > B2. Yes signals are crufty and slow on Darwin. What is more of a > problem is that how the register state is saved is different from > version to version. But I think they placed enough padding to accomodate future changes. Hence, a context is generally more than 1 KB. > I do not know what you mean exactly "exception filters" in this > context. It looks to me like you want to to be able to run some code > whenever you encounter a bad memory access (for vosf), illegal > instruction (probably for emulation purposes), and some sort of > communication (the SIGUSR2, BTW what is that for). SIGUSR2 are used to trigger interrupts. i.e. there is a tick thread that periodically raises a SIGUSR2. > This is relatively straight forward. The first two would be handled by > the exception handler, the third by a mach message. The message is > usually done with MIG but since it looks like you are using C++ and I > assume the code is organized similarly to B2 it would probably be > easier to shoehorn it directly in like I did with the B2 code. Actually, the sigsegv handler code is the same as for B2. I have just hacked around to use Mach exceptions to handle screen faults (early so that we don't need the whole context) + other faults like writes to ROM. However, SheepShaver hangs early after a few seconds. I think this is because we have not taught our Mach exception handler to execute with an alternate stack (set by sigaltstack() or another means we can define) as we should. Is that possible to do? Thanks, Gwenole. |