Page 2 of 6
Re: MOV AX, 0x0000 doesn't work.
Posted: Sun Feb 14, 2010 11:10 am
by Gigasoft
Why don't you use the Bochs debugger and step through everything starting at 0:0x500?
Re: MOV AX, 0x0000 doesn't work.
Posted: Sun Feb 14, 2010 12:10 pm
by RGOS
Hello,
Yeah I'm gonna try it soon, Ive just installed Bochs with debugger.
I'll let you know what, if anything, I found.
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Sun Feb 14, 2010 2:51 pm
by RGOS
Hello,
I've found nothing so far, only that some Enable A20 routines were skipped due to a typo
.
I'll look tommorow if I can find something more.
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Sun Feb 14, 2010 3:24 pm
by DednDave
you might look for an unbalanced stack
i have no experience with bochs, so i can't really follow the code very well
but it sounds like a RET instruction is not getting a valid return IP value off the stack
if it pops a value of -1, the next instruction would cause segment wrap
Re: MOV AX, 0x0000 doesn't work.
Posted: Mon Feb 15, 2010 7:27 am
by jal
RGOS wrote:PS. Sorry for my English, I'm Dutch.
[offtopic]What's that supposed to mean? Unless suffering from a serious lack of education, no Dutch person should say that as an excuse. Moreover, your English seems fine, so it's false modesty.[/offtopic]
JAL
Re: MOV AX, 0x0000 doesn't work.
Posted: Mon Feb 15, 2010 10:15 am
by RGOS
Hello,
@jal: I'm still going to school, in fact I'm just back home (I'm 14 now).
But, yes, you hav a point, every Dutch person has to speak English.
But I'm going to do something now, I'm going to check for an unbalanced stack later.
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Tue Feb 16, 2010 2:31 am
by jal
RGOS wrote:I'm still going to school, in fact I'm just back home (I'm 14 now).
Ok, given your young age, apologies for ranting. It may have been better if you'd have stated your age instead of your nationality, knowing you're just 14 will make most people much more lenient in answering questions usually triggering an RTFM (although even when you're 14, reading the manual is always a good thing :)).
JAL
Re: MOV AX, 0x0000 doesn't work.
Posted: Wed Feb 17, 2010 3:05 pm
by RGOS
Hello,
I've tried to figure uot why I get the error, but I don't find anything.
I also don't know how to watch the value of (E)IP in bochs, how (if) can you watch the value of (E)IP, or set a watch- or breakpoint on (E)IP?
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Wed Feb 17, 2010 4:06 pm
by Gigasoft
To set a breakpoint, enter vb segment:offset. For example, vb 0:0x500. The command "cont" continues execution. Type "s" to step forward one instruction, and "n" to step over a call or int. To pause the program at the current instruction while it's running, press Ctrl+C. Every time the program is paused, Bochs shows the value of CS and EIP and disassembles the next instruction.
Re: MOV AX, 0x0000 doesn't work.
Posted: Wed Feb 17, 2010 4:11 pm
by RGOS
Hello,
Thank you for that info, but is there maybe a way of setting a "breakpoint" over IP, so that if the value of IP changes to -1 that the breakpoint activates?
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Wed Feb 17, 2010 4:45 pm
by Combuster
RGOS wrote:so that if the value of IP changes to -1 that the breakpoint activates?
While you can try to catch the case IP=0xFFFF, it will not tell you
how it got there.
Also, I never saw you fix this problem:
I wrote:the crash occurs well outside where your code is supposed to be. Most interesting, there's nothing after your code, you just let it roam free into whatever is there in RAM.
Did you put in some code to stop the processor yet?
Re: MOV AX, 0x0000 doesn't work.
Posted: Wed Feb 17, 2010 7:27 pm
by Gigasoft
The code doesn't seem to roam. It ends with:
call ebp
cli
hlt
Anyway, the only way to find out where the code goes wrong is to step through it with the "n" command.
Re: MOV AX, 0x0000 doesn't work.
Posted: Thu Feb 18, 2010 12:02 pm
by RGOS
Hello,
I don't find anything, but i'm gonna try to set the CS-register to 0 in the called code, would this help I don't know, but I can allways give it a try
.
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Thu Feb 18, 2010 12:33 pm
by RGOS
Hello,
Okay that didn't work, but I've copy-pasted the "FindFile" code in the main KERNEL.ASM code, and still I get the error.
I relly don't know what to do. Do any of you have an idea? I really can't find a typo or any other miniscule thing
.
Thanks.
Re: MOV AX, 0x0000 doesn't work.
Posted: Thu Feb 18, 2010 2:47 pm
by geppyfx
simplify your code, remove functionality, use 'jmp $' as a part of debugging process, display something on the screen (as simple as 'mov word [ds:videomem], 0404h' ;a red diamond I think)