Is This A Bug In Bochs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
XStream

Is This A Bug In Bochs

Post by XStream »

Hey,

I have some code that simply searches through a FAT12 directory structure and when it finds the item it returns the first cluster for loading, the problem is that when the function returns bochs throws an error:

LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)

I have no idea what this is, and when I look at the EIP it equals 0x00000003, But when I pop the return address off the stack to see what value it holds, it contains 0x7c8b which is exactly where the code is supposed to go, but it doesn't it just hangs and fills the bochs output file with literally hundreds of these errors, all identical.

Anyone got any ideas?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Is This A Bug In Bochs

Post by Pype.Clicker »

could you have an interrupt in the way that would trash your registers/stack ?
XStream

Re:Is This A Bug In Bochs

Post by XStream »

Not exactly sure what you mean by "an interrupt in the way" but I have some more info.

I have now noticed that consistantly there are 4 errors preceeding this one that goes on and on, it is this:

int13_harddisk: function 00, DL out of range DF

Now not to long after this directory search function, I do access the disk, but not the harddisk, I access the floppy. Now if while in the Directory searching function I push and pop dx to save its contents I get this error instead of the one above: (DL=E0 When I call the search directory function)

int13_cdrom: function 00, unmapped device for DL=E0

But, if after the directory search routine returns I clear dx, everything runs fine, but in the sector reading function, before I call int 0x13 I already xor dx because I do division and I know from past experience that dx affects the way division is done so it must be cleared first.

So why would clearing it, before it would be cleared anyway make a difference.

This is weird!!! And to top it off, I can call the sector reading function without problems before I ever call the directory searching function.

Thanks for your help.
XStream

Re:Is This A Bug In Bochs

Post by XStream »

:-[ :-[ :-[ :-[ :-[ :-[ :-[ :-[ :-[

Ok, I just wasted almost 2 hours on a stupid mistake.

Everyone laugh together now!!

When entering the read sectors function I reset the disk, but forgot to assign the boot drive number to DL before trying the reset, hence bochs QUITE RIGHTLY attempted to reset other drives.

Thanks.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Is This A Bug In Bochs

Post by Candy »

XStream wrote: Ok, I just wasted almost 2 hours on a stupid mistake.
Mistakes are only stupid if you've made them before and took as long this time as last time.
Everyone laugh together now!!
We're learning, rather. If anyone here knew what this was he'd answer. If he didn't, he should learn. Seeing the huge list of responses, I think just about anybody seeing this is learning something new.
Post Reply