From: Greg A. <yak...@ma...> - 2001-12-13 23:58:19
|
Oh, almost forgot. I assume the timer interrupt (pit) isn't set to anything exceptionally small (say every three timer ticks or so), right? Thought it was worth mentioning since bochs emulates such a slow processor, and these kinds of things could cause problems. GREG Greg Alexander wrote: > > Could this be an iret problem? There seem to be many problems with this > function, so having a simple testcase that hits your current problem > would be a great help. Please put a bug report here and on sourceforge. > > It would be helpful if you could include: > 1.) Test code to cause the problem > 2.) a description of what bochs seems to be doing wrong (it's okay to > get the triage wrong, just give us an idea where to look.) > 3.) a description of what bochs should do. > 4.) (optional) a patch to fix the problem. :) > > As for not displaying the first instruction after an interrupt, I seem > to remember there being some problems with this in the debugger. I > thought it had been fixed in CVS. I don't think this is your problem, > as you note that the push seems to be executed. > > Thanks, > > GREG > > Phil Frost wrote: > > > > I posted this a few days ago and recieved no reply. As I said I can get > > together a test image and a nice bug report, but I'm not going to waste > > my time if no one is willing to fix this or it's a known bug. > > > > > I have been working on a thread engine and I have run up against some > > > strange problems. I have this hooked to irq 0: > > > > > > _timer_handler: > > > push eax > > > mov al, 0x60 > > > out 0x20, al > > > pop eax > > > iretd > > > > > > I noticed that my code was hanging around in an unmask irq function, so > > > I put a breakpoint there. Here's the code: > > > > > > unmask_irq: > > > test al, 0xF0 ; test irq number validity > > > mov cl, al ; prepare rotating mask count > > > stc ; set error flag in case > > > mov ah, 0xFE ; mask to 'and' with, only 1 bit cleared > > > jnz short .exit ; if irq number is above range, exit > > > rol ah, cl ; rotate mask to fit selected irq > > > test al, 0x08 ; was it a slave or master pic's irq? > > > jnz .slave_pic ; seems it slave, go do it > > > ; > > > ; Master PIC irq unmask > > > ;---------------------- > > > in al, 0x21 ; get current master pic irq mask > > > and al, ah ; clear the irq mask for selected irq > > > out 0x21, al ; send new irq mask to master pic > > > clc ; clear any error flag > > > retn ; > > > > > > The breakpoing is right at unmask_irq, here's what I get: > > > > > > <bochs:1> break 0x102670 > > > <bochs:2> c > > > 00000003620i[BIOS ] rombios.c,v 1.25 2001/12/05 20:38:32 vruppert Exp $ > > > (0) Breakpoint 1, 0x102670 in ?? () > > > Next at t=400164 > > > (0) 0008:00102670 (unknown context): a8f0: test AL, #f0 > > > <bochs:3> s > > > Next at t=400165 > > > (0) 0008:00102672 (unknown context): 88c1: mov |MOD3|REG0|RM1| CL, AL > > > <bochs:4> s > > > Next at t=400166 > > > (0) 0008:00102674 (unknown context): f9: stc > > > <bochs:5> s > > > Next at t=400167 > > > (0) 0008:00102675 (unknown context): b4fe: mov AH, #fe > > > <bochs:6> s > > > Next at t=400168 > > > (0) 0008:00102677 (unknown context): 750e: jnz +#0e > > > <bochs:7> s > > > Next at t=400169 > > > (0) 0008:00102679 (unknown context): d2c4: rol |MOD3|REG0|RM4| AH, CL > > > <bochs:8> s > > > Next at t=400170 > > > (0) 0008:0010267b (unknown context): a808: test AL, #08 > > > <bochs:9> s > > > Next at t=400171 > > > (0) 0008:0010267d (unknown context): 750e: jnz +#0e > > > <bochs:10> s > > > Next at t=400172 > > > (0) 0008:0010267f (unknown context): e421: in AL, #21 > > > <bochs:11> s > > > Next at t=400173 > > > (0) 0008:00102681 (unknown context): 20e0: and |MOD3|REG4|RM0| AL, AH > > > <bochs:12> s > > > Next at t=400174 > > > (0) 0008:00102683 (unknown context): e621: out #21, AL > > > <bochs:13> s > > > Next at t=400175 > > > (0) 0008:00102685 (unknown context): f8: clc > > > <bochs:14> s > > > *** interupt happens here *** > > > Next at t=400176 > > > (0) 0008:001035b3 (unknown context): b060: mov AL, #60 > > > <bochs:15> s > > > Next at t=400177 > > > (0) 0008:001035b5 (unknown context): e620: out #20, AL > > > <bochs:16> s > > > Next at t=400178 > > > (0) 0008:001035b7 (unknown context): 58: pop EAX > > > <bochs:17> s > > > Next at t=400179 > > > (0) 0008:001035b8 (unknown context): cf: iret > > > <bochs:18> s > > > Next at t=400180 > > > (0) 0008:00102685 (unknown context): f8: clc > > > <bochs:19> s > > > Next at t=400181 > > > (0) 0008:001035b3 (unknown context): b060: mov AL, #60 > > > <bochs:20> s > > > Next at t=400182 > > > (0) 0008:001035b5 (unknown context): e620: out #20, AL > > > <bochs:21> s > > > Next at t=400183 > > > (0) 0008:001035b7 (unknown context): 58: pop EAX > > > <bochs:22> s > > > Next at t=400184 > > > (0) 0008:001035b8 (unknown context): cf: iret > > > <bochs:23> > > > ...goes on like this forever... > > > > > > It's all good up until step 14. Then I never see the "push eax", > > > although it does seem to be executed. at step 18, if I look at the > > > stack, the return EIP for the iretd is 0x00102685. It does indeed go > > > back to that EIP, which is the clc again. "s" one more time and again > > > the push eax is not displayed, but executed. Each time the interupt > > > executes it follows the same pattern. > > > > > > Now, I have tested my code in vmware and 2 real computers and it works. > > > Somehow, bochs is at fault. Is there anything known about this bug? If > > > not, I could try to make a much simpler program that reproduces the bug. > > > > > > Phil Frost > > > > _______________________________________________ > > bochs-developers mailing list > > boc...@li... > > https://lists.sourceforge.net/lists/listinfo/bochs-developers > > _______________________________________________ > bochs-developers mailing list > boc...@li... > https://lists.sourceforge.net/lists/listinfo/bochs-developers |