7 ms·
Me: "Surely the Linux Kernel has build options for x86 that includes no-FPU" 20 minutes later: "Oh right they removed i386 as a target because it sucked and wa
by leeter 5y ago
Me: "Surely the Linux Kernel has build options for x86 that includes no-FPU"
20 minutes later: "Oh right they removed i386 as a target because it sucked and wasn't maintained that includes i486... so now you'd have to target a Pentium or higher"
But seriously the Linux kernel does support not having an FPU... just not on x86 as best I can tell.
- amluto 5y agoThe Linux kernel has an x87 emulator.
- leeter 5y agoIt does... and doing a quick search of the kernel source it's not actually used for anything I can't find it referenced outside of itself. There is FPU emulation for m68K that is, but x87 is not.
- cesarb 5y ago> and doing a quick search of the kernel source it's not actually used for anything I can't find it referenced outside of itself. It's being used here: https://lxr.missinglinkelectronics.com/linux+v5.16/arch/x86/kernel/traps.c#L1187 https://lxr.missinglinkelectronics.com/linux+v5.16/arch/x86/... Whenever the kernel gets a "device not available" exception, and CONFIG_MATH_EMULATION is set (which is the case when the kernel is compiled for a 486SX), and the CPU does not have a real FPU, and the "emulation" flag on CR0 is set, it calls the FPU emulator.
- leeter 5y agoGood to know I was looking in the wrong spot, I was looking for what looked like the most likely header other parts of the code would be using.
- amluto 5y agoAh, you got faked out. The kernel doesn’t really use FPU even in modern CPUs. The emulation is for userspace’s benefit, not the kernel’s
- zozbot234 5y agoI believe that the latest kernels still support CONFIG_M486 though one would have to check. Even i386 support was only removed because it led to complications in the SMP support code, so it could likely be readded for non-SMP configs (most if not all 80386 systems are single-processor). It's a matter of doing the work (making sure that it does not inconvenience support for other archs), posting it to LKML and committing to maintaining it.
- deleted 5y ago[deleted]
- cestith 5y agoThere's always NetBSD, and FreeDOS can get online just fine. Both are currently maintained. http://wiki.freedos.org/wiki/index.php/Networking_FreeDOS_-_Quick_Networking_HowTo http://wiki.freedos.org/wiki/index.php/Networking_FreeDOS_-_... There are also older Linux distribution images available. OS/2 or one of the two commercial spin-offs would have networking support. Windows 95 will run slowly on a 486 but may require the coprocessor. I don't recall about that. Windows 3.1 or 3.11 with Trumpet Winsock will get online. I have a couple of Portmaster 2e IP to serial servers. When I was in the ISP field before the 56k DSP-based integrated systems, we used to hook modems up to devices like that to provide dial-up service. I can hook up around 40 systems that have RS-232 ports to the Internet that way.
- badsectoracula 5y agoThe kernel does support the 486[0], it is just looks like some "486"s were really 386s. 486SX (which is supported) has its FPU disabled so it most likely uses the x87 emulation. [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/Kconfig.cpu https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
- leeter 5y agoI can't find support for those flags outside of two files, I'm 90% sure the kernel requires CMPXCHG8B which isn't supported on 486 iirc
- cesarb 5y ago> I can't find support for those flags outside of two files Most of or all of the uses of those M486/M486SX/etc flags are on that file itself. For instance, it sets CONFIG_X86_INVD_BUG whenever either CONFIG_M486SX or CONFIG_M486 is set. It's those other flags that are used elsewhere; as you can see, there are many of them. > I'm 90% sure the kernel requires CMPXCHG8B which isn't supported on 486 iirc I believe CMPXCHG8B is CONFIG_X86_CMPXCHG64, which as you can see on that file, is not set for M486/M486SX. As you can see searching for that, there is support for CMPXCHG8B emulation (see for instance https://lxr.missinglinkelectronics.com/linux+v5.16/arch/x86/include/asm/cmpxchg_32.h https://lxr.missinglinkelectronics.com/linux+v5.16/arch/x86/...) on CPUs which do not have that instruction (complete with an use of the "alternatives" mechanism to automatically replaces the emulation calls with the real CMPXCHG8B instruction when it's available on the current CPU).
- danbee 5y agoIf I remember rightly, the 487SX was actually a full 486DX processor that, when installed, disabled the existing 486SX CPU.
- ForOldHack 5y agoConfirmed. The 487SX was a full 486DX with FPU and caches. https://news.ycombinator.com/item?id=5471932 https://news.ycombinator.com/item?id=5471932 Nice to hear confirmation of something I saw with my own eyes.
- yjftsjthsd-h 5y agoPerhaps https://en.m.wikipedia.org/wiki/Embeddable_Linux_Kernel_Subset https://en.m.wikipedia.org/wiki/Embeddable_Linux_Kernel_Subs... ?
- mywittyname 5y ago> But seriously the Linux kernel does support not having an FPU How does this work? Do they use software emulation of floating point calculations?