Page 1 of 1

Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 6:22 pm
by neon
Hey everyone,

I ran into this problem in the past but dont know how I solved it nor what the actual problem is. I have this test code that I suspect should simply output the character 'a' using the bios interrupt 0x10 function 0xe running in real mode:

Code: Select all

xor ebx, ebx
mov ah, 0xe
mov al, 'a'
int	10h	
cli
hlt
The problem is, nothing at all happens. No character is displayed. No crashes/warnings from bochs. It gets to the cli+hlt combo at the end as well. While might not be relevant, hardware interrupts are enabled. I also know other interrupts work fine (I tested int 0x10 function 0 to set video modes--worked fine.) I also know this interrupt should work fine (Have been able to use it in this project just fine before.) I can also see the cursor visually on screen so I would suspect the bios to display the character where the cursor is. I also know this does not happen just in bochs, but Virtual PC to.

Does anyone know what can cause this? Thanks for any possible answers :)

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 6:33 pm
by StephanvanSchaik
Hi,

Code: Select all

xor ebx, ebx
mov ah, 0xe
mov al, 'a'
int   10h   
cli
hlt
Your nullify ebx, thereby you nullify bl, which holds the foreground color.


Regards,
Stephan van Schaik.

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 6:36 pm
by neon
StephanVanSchaik wrote:Your nullify ebx, thereby you nullify bl, which holds the foreground color.
It does not matter what value I put in bl, it still seems to do nothing :(

If I take a snapshot of the bochs window, there is no character in the output file (snapshot.txt) either so I am thinking its a little more then a color problem...

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 6:44 pm
by StephanvanSchaik
Can it be that you perhaps switched the page?

Did you try altering the 0xB800? If that doesn't work then it's not the interrupt.


Regards,
Stephan van Schaik.

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 6:52 pm
by JohnnyTheDon
You sure bl doesn't matter? Because it should be 0x7 for normal gray-on-black. When bl is zero it SHOULD display nothing (black on black). Does it at least move the cursor?

Code: Select all

    mov bh, 0
    mov bl, 07h
    mov ah, 0Eh
    mov al, 'a'
    int   10h   
    cli
    hlt
According to Ralph Brown's Interrupt List that should be right.

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 6:58 pm
by neon
JohnnyTheDon, I used your code but the same result happened. The cursor does not move at all...

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 7:06 pm
by Firestryke31
Is there any memory writing going on before you're trying to print the character? The only other thing I can think of is the BIOS isn't being called due to a corrupted IVT.

Also, in Bochs bl does nothing, at least not in my version. Socks uses xor bx, bx but I haven't had a chance to test on RHW, so I don't know if that's standard behavior.

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 7:13 pm
by neon
Firestryke31 wrote:Is there any memory writing going on before you're trying to print the character? The only other thing I can think of is the BIOS isn't being called due to a corrupted IVT.
Technically yes (the new boot code program) however not in the program the problem is happening in. However, technically the problem also occurs in the boot code so it is a possibility. I assumed it was fine do to the bochs debugger, single stepping, it seems to be fine. Ill take a look though...

Re: Whats going on? (Bios interrupt problem)

Posted: Thu Feb 26, 2009 7:15 pm
by neon
*sigh* ...That was it :oops: Its working now.

Thank you very much for helping out! :D