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

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
User avatar
Ender
Posts: 24
Joined: Thu Jul 19, 2018 9:40 pm

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

Post 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.
Last edited by Ender on Fri Aug 31, 2018 5:52 pm, edited 1 time in total.
MichaelPetch
Member
Member
Posts: 799
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

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

Post 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.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

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

Post 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/
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
Ender
Posts: 24
Joined: Thu Jul 19, 2018 9:40 pm

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

Post 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.
Post Reply