Need to initialize the FPU before you use it.
Hi,
When trying to test Bochs, I tried to boot your ISO. Shortly after the "Ghost OS" boot screen, Bochs showed a good handful of FPU exceptions. Come to find out, when Bochs tried to execute the following code:
The fmulp st(1),st(0) instruction triggered the exception because both st(1) and st(0) were zero. With the fild and fld instructions just before, this should not be the case.
Come to find out, you never use the fninit instruction before you use the FPU. Simply executing the fninit instruction, somewhere in your boot code before you get to this position fixes the issue and Bochs see's no more FPU exceptions.
Bochs now loads Ghost OS all the way to the initializing... stage and then complains of a hlt with IF = 0. QEMU loads and runs to the desktop, so Bochs is doing something different, not assuming, or is assuming, or what not, but currently Bochs won't boot past the initializing... stage.
My purpose is to test Bochs, but I thought you might want to know anyway.
Thanks.
Update: The reason why Bochs doesn't continue after the initializing... stage is that GhostOS is trying to set a non-existent video mode. Have a look at https://github.com/bochs-emu/Bochs/issues/549 for more info.
Again, I have been testing Bochs with many Guests and yours is one of them. I just thought you might want to know about these two issues.
Thank you.
@fysnet Thanks for reporting this here. I looked at the issue you linked but I think actually it's not that simple. The OS doesn't just set the mode that is configured in the resolution.cfg file, but instead loads the list of available modes and tries to approximate the best matching mode based on this configuration. Otherwise it chooses another mode. So if I'm not mistaken, Bochs must have reported this mode and the OS is just trying to set it. I will have to verify this though.