Skip to content

Need to initialize the FPU before you use it. #50

@fysnet

Description

@fysnet

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:

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions