Page 1 of 1

[solved] Need help: Hang/crash on boot in Bochs but not Q...

Posted: Tue Aug 21, 2018 1:33 am
by Ender
I recently came back to my small kernel development project intending to fix a separate issue, only to find out that it won't boot in Bochs, yet works as I thought it would in QEMU.

In order to verify Bochs' result, I tried Virtualbox as well, and got the same result, proving it wasn't an issue with Bochs, and is instead an issue with my code.

I had a similar issue earlier, and my stack creation was at fault, but I've tried all kinds of ways of defining the stack and I still can't get it to work, so I am starting to think that it isn't the stack.
On boot, it prints the intended text, but without the background color that I'd set. It then flickers while doing nothing else.
Looking at Bochs, it continually does:

Code: Select all

(0) [0x000000100031] 0010:0000000000100031 (unk. ctxt): jmp .-2 (0x00100031)      ; ebfe
I've stripped out everything including my IDT code, PIC code, etc, giving a much smaller system with the same problem. I have provided it in tar.xz format here: https://nofile.io/f/defpYtSKwsF/minimal_death.tar.xz

If anyone could help me out, I'd be very pleased, thank you.

Re: Need help: Hang/crash on boot in Bochs and VBox but not

Posted: Tue Aug 21, 2018 6:52 am
by MichaelPetch
The text is blinking because BOCHs is one of the few environments where the blinking bit in the attribute (simulated) is honored. You use attribute 0x8F to clear the screen. BOCHS interprets the background color of 0x8 as being black but with blinking text. 0x8F is white on black with blinking text. If you want white on black use 0x0F.

Re: Need help: Hang/crash on boot in Bochs and VBox but not

Posted: Tue Aug 21, 2018 7:45 am
by Octacone
I remember having the same issue while writing my VGA driver.
MichaelPetch is right about the blinking bit. Bochs does a good job of emulating that.
Take a look at this Reddit post, it contains everything you need to know: https://www.reddit.com/r/osdev/comments ... king_text/

Re: Need help: Hang/crash on boot in Bochs and VBox but not

Posted: Tue Aug 21, 2018 1:45 pm
by Ender
MichaelPetch wrote:The text is blinking because BOCHs is one of the few environments where the blinking bit in the attribute (simulated) is honored. You use attribute 0x8F to clear the screen. BOCHS interprets the background color of 0x8 as being black but with blinking text. 0x8F is white on black with blinking text. If you want white on black use 0x0F.
Ah, thank you, I hadn't thought of that. Seems like I was looking for more strange issues where there is none.