-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FPU software emulation #9
Comments
I'm in the same situation. I've a PC/104 with a 386SX with 4MB of RAM but without floating-point processor. I like to power on this machine from time to time and I saw that it 's somehow able to run FiwixOS 3.2, but some binaries crash because they try to run some FPU instructions. I was investigating if there is a way to tell GCC to not use any FPU instruction (or use an emulation on its own instead), but I didn't see any option for this. Sincerely, give FPU support to the Fiwix kernel is out of scope of my possibilities and is not in my priority list right now. Maybe in the future someone finds interesting to include a minimal FPU support. Sorry for the inconveniences. |
@mikaku thank you very much for the answer. I'll follow you and keep eye on the FiwixOS . Good luck with the amazing project. |
Thank you! |
Hello @mikaku, I think "-msoft-float" should work |
@glegris, I've just added GCC's manual says:
Perhaps GCC requires a special configuration parameter during the build to accomplish this? |
In my opinion, since FiwixOS's newlib is not compiled in soft float mode, the binaries of the code (df in your case) linked against newlib contains FP instructions. Newlib's printf uses FP for example. |
Oh yes, you're right. I understood it in the other way around. |
I've made a test with a simple program that generates Floating Point instructions: #include <stdio.h>
static double test(double d)
{
printf("d = %.5G\n", (double)d);
return (d * 100);
}
int main(int argc, char** argv)
{
int res;
res = test(19.67);
printf("res = %d\n", res);
return 0;
} It works well on an processor with a FPU:
As you can see, It uses FP instructions:
When I compile it with the parameter
I'm not sure but I think that GCC Toolchain must be built with a special configuration parameter that is not currently passed during the compilation on FiwixOS. I need to investigate more on this. After reading this I'm a bit skeptic (at least for i386). |
I see that soft-fp is not integrated in the FiwixOS's gcc package. You can build the soft-fp library yourself and compile your code against it: |
I can't compile soft-fp for gcc-4.7.4, it seems broken. I found a temporary solution based on a third party library in the meantime. The source code to compile your example is attached (I wrote a small README at the root). |
Nice, it seems to work on an i386 without FPU. I think the best way to compile the ieeelib under FiwixOS is integrate it into GCC Toolchain build, so it can use the libgcc directory directly. Then, I'll try rebuild the packages of FiwixOS using the softfloat library and see how it works. |
Some progress ... I've included the ieeelib project into the build process of the GNU Toolchain. So now, the script Then I've modified the file The next command was The problem was with the command
It looks like the original code of I've been investigating and I discovered an email in the GCC Project Mailing List where a user called Joseph S. Myers submitted a patch which hopefully will fix this. The same email also references another one that fixes a different bug. I plan to introduce both patches into the build process of the ieeelib, so eventually I'll be able to compile |
Well, I have bad news. This was a false positive: the I think that these commands still have the FPU instructions that come with the Newlib static libraries. So, in the next days I'll try to rebuild the Newlib C library using the In fact, the |
Could you give me your 86Box configuration? So I can try to fix things too. |
|
A question, not an issue, if you please. I see: "i386 processor (with floating-point processor)" in the minimum requirements. Are you planning to implement FPU software emulation, perhaps, at some point? I'd be interesting in reviving my 386sx machine with some modern, yet lightweight OS.
The text was updated successfully, but these errors were encountered: