WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.  (Read 23180 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #15 on: July 02, 2021, 02:15:18 AM »
Did the presario fail with the normal 12 cd?
The only barriers that can stop you are the ones you create yourself.

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 289
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #16 on: July 03, 2021, 02:18:11 AM »
I played around with uname_hack and glibc to see if it made a difference - you could try to boot 12.x after replacing the existing rootfs.gz with the file here:

http://tinycorelinux.net/12.x/x86/release/src/toolchain/test_i486/

I think this is important so I did my own test. I do have a AMD K6-2 PC (if the sticker's correct) but it's not set up (by the way "166MHz" in the subject line seems to be a typo, Wikipedia says the slowest K6-2 made ran at 266MHz). Instead I tested on a standard 120MHz Intel Pentium 1 PC which normally runs Damn Small Linux (I'm posting from it now). It's a more concrete benchmark for i586 support anyway.

Booting from HDD (IDE, ext2 formatted) with Grub 0.97 (0.91 doesn't work for TC as I found out, I booted 0.97 from a floppy).

First I booted TC 10.1 (core.gz) - Boots + runs OK

Then I tried regular TC 12.0 (root.gz only) - Fails init dies immediately after starting, with illegal op code (or similar error) b7fb7081 in ld-2.32.so

Finally I tried Juanito's test_i486 root.gz for TC 12.0 - Boots + runs OK

So that uname hack seems to solve the problem.

Perhaps Juanito is already well aware of it, but there is a suggestion in the glibc FAQ that covers this:

Quote
How can I compile on my fast ix86 machine a working libc for an older and slower ix86? After installing libc, programs abort with "Illegal Instruction".

glibc and gcc might generate some instructions on your machine that aren't available on an older machine. You've got to tell glibc that you're configuring for e.g. i586 with adding i586 as your machine, for example:

* ../configure --prefix=/usr i586-pc-linux-gnu

And you need to tell gcc to only generate i586 code, just add -march=i586 (just -m586 doesn't work) to your CFLAGS.

Note that i486 is the oldest supported architecture since nptl needs atomic instructions and those were introduced with i486.

Maybe I'll try one of my 486 PCs some time, but setting that up will be more difficult.

Offline gadget42

  • Hero Member
  • *****
  • Posts: 817
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #17 on: July 03, 2021, 11:14:00 AM »
Did the presario fail with the normal 12 cd?

Compaq Presario Model 7596, Celeron 566Mhz, 192MB ram, raw mobo test-benched w/ cd-rom
https://www.cnet.com/products/compaq-presario-7596-mt-celeron-566-mhz-128-mb-30-gb/

TC12 LiveCD boots fine(other than the colors are somewhat "off"...the background is a "brownish-tan" instead of the normal blue)

Modified TC12 LiveCD also boots fine(and has the same color issue, must be something to do with the motherboard graphics)

Thanks!
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline nick65go

  • Hero Member
  • *****
  • Posts: 839
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #18 on: July 03, 2021, 01:36:43 PM »
I do not have a physical 486 CPU, but I wonder why is not a modern QEMU capable of properly simulate a 486 (only) CPU ?
Qemu parameter -m for machine type can do it. I do not know what additional CPU instructions set are specifically for a 586 CPU or AMD K6 etc. But these additional CPU capabilities should already be known in full flags, because 586, 686 have been history CPU for (tens of) years. So qemu can simulate in full a 486, 586, 686 CPU, as needed. (I think).

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #19 on: July 04, 2021, 02:03:24 AM »
This was tested many years ago, qemu was too permissive. Tell it to emulate a 486 and it still allowed newer instructions IIRC.
The only barriers that can stop you are the ones you create yourself.

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 289
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #20 on: July 04, 2021, 04:51:40 AM »
This was tested many years ago, qemu was too permissive. Tell it to emulate a 486 and it still allowed newer instructions IIRC.

I guess that's not so surprising because people wouldn't usually check/complain that software is running properly in the emulator when it shouldn't.

Another approach is to analyse the instructions in the binary using something like this. But I think running on the real hardware would actually still be easier and more accurate.

It's just a case of copying vmlinuz and root.gz to the HDD of a 486 PC, then boot eg. The All In One Boot Floppy and boot from the HDD using Grub. The only time-consuming bit can be getting the files onto the HDD given that they won't fit onto a floppy, though it's not a big hurdle.

Offline nick65go

  • Hero Member
  • *****
  • Posts: 839
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #21 on: July 04, 2021, 04:52:38 AM »
@curaga: When you say few years ago, I think is about 2 -3 years ago, so it was about qemu 3.x, maybe.
The latest versions of qemu 3.x, 4.x, 5.x  were issued on: https://download.qemu.org 
qemu-6.0.0.tar.xz    2021-04-29
qemu-5.2.0.tar.xz    2020-12-08
qemu-4.2.1.tar.xz    2020-06-25
qemu-3.1.0.tar.xz    2018-12-11 (=> 2.5 years ago)

I did not think that such an important bug (to allow extra CPU instruction not specific to 486) was not reported in the mean time. Anyway, it was just an idea, to properly know what is the minimum CPU type requested for each TC version. It was not officially announced that 586 is the minimum CPU.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14841
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #22 on: July 04, 2021, 05:08:16 AM »
i486 is still the minimum cpu for tinycore - for some reason "-march=i486" was ignored by glibc in 12.x, but there seems to be a fix.

Offline gadget42

  • Hero Member
  • *****
  • Posts: 817
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #23 on: July 04, 2021, 09:43:03 AM »
I played around with uname_hack and glibc to see if it made a difference - you could try to boot 12.x after replacing the existing rootfs.gz with the file here:

http://tinycorelinux.net/12.x/x86/release/src/toolchain/test_i486/

I think this is important so I did my own test. I do have a AMD K6-2 PC (if the sticker's correct) but it's not set up (by the way "166MHz" in the subject line seems to be a typo, Wikipedia says the slowest K6-2 made ran at 266MHz). Instead I tested on a standard 120MHz Intel Pentium 1 PC which normally runs Damn Small Linux (I'm posting from it now). It's a more concrete benchmark for i586 support anyway.

Booting from HDD (IDE, ext2 formatted) with Grub 0.97 (0.91 doesn't work for TC as I found out, I booted 0.97 from a floppy).

First I booted TC 10.1 (core.gz) - Boots + runs OK

Then I tried regular TC 12.0 (root.gz only) - Fails init dies immediately after starting, with illegal op code (or similar error) b7fb7081 in ld-2.32.so

Finally I tried Juanito's test_i486 root.gz for TC 12.0 - Boots + runs OK

So that uname hack seems to solve the problem.

Perhaps Juanito is already well aware of it, but there is a suggestion in the glibc FAQ that covers this:

Quote
How can I compile on my fast ix86 machine a working libc for an older and slower ix86? After installing libc, programs abort with "Illegal Instruction".

glibc and gcc might generate some instructions on your machine that aren't available on an older machine. You've got to tell glibc that you're configuring for e.g. i586 with adding i586 as your machine, for example:

* ../configure --prefix=/usr i586-pc-linux-gnu

And you need to tell gcc to only generate i586 code, just add -march=i586 (just -m586 doesn't work) to your CFLAGS.

Note that i486 is the oldest supported architecture since nptl needs atomic instructions and those were introduced with i486.

Maybe I'll try one of my 486 PCs some time, but setting that up will be more difficult.

attached photo of bios screen regarding 166Mhz(all i know and can go by is what the computer says).

[attachment deleted by admin]
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14841
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #24 on: July 04, 2021, 09:55:28 AM »
In fact:
Code: [Select]
$ qemu-system-i386 -cpu 486 -m 1G -cdrom /mnt/sdb1/tmp/Core-12.0.iso -boot d..will not boot, whereas the modified rootfs.gz will boot.

..though I too recall that qemu was too permissive
« Last Edit: July 04, 2021, 10:15:35 AM by Juanito »

Offline gadget42

  • Hero Member
  • *****
  • Posts: 817
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #25 on: July 05, 2021, 03:27:52 PM »
Please note that glibc has been recompiled using uname_hack to force it to compile for i486.

rootfs.gz and the *Core* iso's have been replaced with ones containing the new glibc - as there is no corresponding change to CorePure, the version number has not been changed.

There is no need to update unless you have an i486 or similar.

downloaded, good md5sum, good cd burn(boots fine in other machines), still fails on the amd k6-2 166mhz machine. using debug i get:

traps: wbar[1181] trap invalid opcode ip:b7ac0484 sp:bf97ad58 error:0 in libgcc_s.so.1[b7ac0000+16000]
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 289
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #26 on: July 05, 2021, 07:45:38 PM »
For what it's worth, the current TC12 core.gz (md5: a20452c6d09feabfdda7a20304479956) does boot on my Pentium 1:

menu.lst:
Code: [Select]
title Tiny Core 12 i486 - Core
kernel (hd0,1)/boot/tc12_486/vmlinuz
initrd (hd0,1)/boot/tc12_486/core.gz

I'll try on a 486 at some point.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14841
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #27 on: July 06, 2021, 03:58:52 AM »
traps: wbar[1181] trap invalid opcode ip:b7ac0484 sp:bf97ad58 error:0 in libgcc_s.so.1[b7ac0000+16000]

<sigh> I was wondering if that might happen - (re)confirmation at least that "qemu -cpu i484" cannot be used as a test.

I'll take a look at a fix.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14841
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #28 on: July 06, 2021, 05:50:24 AM »
I recompiled libgcc_s.so.1 and libstdc++.so.6.0.28

If somebody with an i486 or similar could test from here: http://tinycorelinux.net/12.x/x86/release/src/toolchain/test_i486/

..it would be much appreciated.


Offline gadget42

  • Hero Member
  • *****
  • Posts: 817
Re: AMD K6-2 166Mhz, 512MB ram, desktop - TC11.1 runs fine TC12 fails.
« Reply #29 on: July 06, 2021, 04:10:04 PM »
I recompiled libgcc_s.so.1 and libstdc++.so.6.0.28

If somebody with an i486 or similar could test from here: http://tinycorelinux.net/12.x/x86/release/src/toolchain/test_i486/

..it would be much appreciated.

tested and microcore boots to the commandline successfully on the amd k6-2 166mhz.
will there be another update of TinyCore12.x to facilitate the complete iso w/gui?
(i always have trouble trying to put together an iso by myself...lol)

Thanks!
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580