From: Adam L. <ag...@li...> - 2000-02-20 12:10:29
|
On Sun, Feb 20, 2000 at 12:54:53PM +0100, Kasper Verdich Lund wrote: > > Well I'm stuck again ;( >=20 > Okay - let's see... BTW: Im Nebulae on us.chatjunkies.org, #linux > What's your strategy? Do you intend to let the called process return? > When I did the IRQ handling stuff I made a mistake that produced strange > results. I ran the IRQ handling process with _process_run() which > changes the address space (by changing CR3), but on return I didn't > change back.=20 Process 1 wants to jump to process 2: It saves state so prolog can restore state=20 It sets up the pid in %eax It sets a value in %ebx int $0x47 kernel jumps to the PCT entry in process 2 process 2 does what it wants at somepoint process 1 prolog is called and everything continues > > All the movl $xx,%ecx are debugging > > t2 crashes with ECX=3D59 everytime (and I've put delay loops in to chec= k it isn't > > a timing thing). Doh! The ECX came from prolog when it popal's. In sys_pct I push (in order): pushl 0x10000950 pusha pushf Now prolog pops the flags and registers ok, but the ret seems to jump to 0xc35831eb > I'm really worried about the SS =3D 0x00100023 - could you send me the > code? I want to investigate :-) SS is 16bit. Thus that 1 can't be there. It must be from the debug code that prints the value > =20 > > It must be that pushal crashing I think (because if it ever finished EC= X would > > change). But how does EIP go so wonkey? >=20 > It's easy to mess up EIP - if you fail to maintain the stack properly a > single 'ret' instruction will certainly do something like that. But popal seems to restore all the registers to the correct values in prolo= g, which makes me think the stack is OK > BTW: Let's make a debug system call (interrupt 3 would do fine) and let > that dump some basic CPU information. That would be useful instead of > the movl $xx,%ecx stuff :-) It wouldn't have helped, but it sounds a good idea. Maybe we it could set t= he single-step flag (that would have been usful), if the kernel dumps state on every instruction. Also maybe the kernel could write it to a serial port... AGL --=20 Smoking is one of the leading causes of statistics. |