I need to build a working minimal Linux environment that will run on ACTUAL 386 class hardware. I know that I have to use kernel <3.8, which is not a problem. The issue is with glibc, as it seems recent versions (for now I tried Glibc-2.23) don't work (or even compile) using only 386 code. I managed to compile for i486, but it does not work on actual hardware. I've tested on a number of different 486 systems and the problem is always the same - the kernel boots, mounts the root fs, and then executed init, which fails with an error in sysdeps/i386/cacheinfo.c, in function handle_intel and the error is that the assertion maxcpuid>=2 fails, at which point the system hangs. The same happens on i586 class machines (Intel Pentium, Pentium MMX). Everything works fine with i686 class hardware (Pentium PRO and up). All packages (including glibc) have been compiled with -march=i486 -mcpu=i486 flags with gcc-5.3.0 Using "ready made" old PC distros like dslinux or puppylinux is unfortunately out of the question, as these are very outdated and limited. Any ideas?

  • thx for the edit, looks much clearer now – theesem Aug 21 '16 at 14:52
  • I have definitely never attempted compiling for an actual 386. Yet, if I would attempt it I would try to use the configure switch --host=i386-pc-linux-gnu instead of trying -march/-mcpu directly. This is just a guess though. – grochmal Aug 21 '16 at 18:01
  • I have actually done both. I have replaced my uname with a script that always returned i486-pc-linux-gnu as well as modified the CFLAGS to force -march and -mcpu. As explained trying to compile for i386-pc-linux-gnu fails. The kernel itself compiles without trouble with same gcc-5.3.0 and works on actual hardware up to the point where execution is trasfered to init – theesem Aug 21 '16 at 19:51
  • I need to argue that I am very surprised that glibc is not backward compatible. The GNU guys are mad about backward compatibility and support for different flavours of *nix. Going through all the code of glibc is not manageable, what I would try is to go through configure.ac, there is a lot of C code defines in there (although I did not see maxcpuid in there). All in all this may be the right question for savannah-hackers maillist. – grochmal Aug 21 '16 at 20:02
  • The departure from pure 386 support was announced quite a while ago, but a promise of 486 compatibility was given. Anyway, I have retested to obtain more precise info about the error, and it is in the file 'sysdeps/i386/cacheinfo.c', in function 'handle_intel' and the error is that the assertion 'maxcpuid>=2' fails. – theesem Aug 21 '16 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.