2008-06-24 07:37:16

by Marian Aldenhövel

[permalink] [raw]
Subject: Building a kernel for SiS55-based system.

Hi,

I am trying to build a linux kernel for a small form-factor PC. I have so
far failed to create a working kernel.

Output of /cat/proc/cpuinfo as given by the hardware vendor:

> processor : 0
> vendor_id : SiS SiS SiS
> cpu family : 5
> model : 0
> model name : ff/00
> stepping : 5
> cpu MHz : 200.008
> fdiv_bug : no
> hlt_bug : no
> f00f_bug : no
> coma_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid level : 1
> wp : yes
> flags : fpu tsc cx8 mmx
> bogomips : 398.95

I gather that is a SiS 55x System-on-a-chip.

I am using T2[1] as build-system. It (currently) tries to build the kernel
from 2.6.25.7 sources. When booting the kernel it built the system stops
after:

Decompressing Linux... done.
Booting the kernel.

At the bottom of the screen it says:

BUG: Int6: CR2 00000000

And nothing else.

My kernel-configfile can be downloaded from [2]

I am confident that the build-system in itself is sound. I can boot the
system it created on a variety of different systems including QEmu, but
not on the target with the CPU given above. But I have very very little
experience in building system like this from scratch.

I am quite new at this sort of thing, so please be gentle if I forgot the
most vital part of information required to help me. I will gladly provide
anything asked for.

If someone is really extremely keen on helping I can also send out one
of the machines I am trying to get this up and running on and a copy of
the development host-VM I am using.

Ciao, MM

[1] http://www.t2-project.org
[2] http://www.marian-aldenhoevel.de/tmp/kconfig_2.6.25.7-dist
--
Marian Aldenh?vel, Rosenhain 23, 53123 Bonn
http://www.marian-aldenhoevel.de
"I ran some quick calculations on it. He's about 80% on the right
track. That leaves him only 20% dead when he crashes." Bob C


2008-06-26 09:19:54

by Gilles Espinasse

[permalink] [raw]
Subject: Re: Building a kernel for SiS55-based system.

Selon Marian Aldenh?vel <[email protected]>:

> Hi,
>
> I am trying to build a linux kernel for a small form-factor PC. I have so
> far failed to create a working kernel.
>
> Output of /cat/proc/cpuinfo as given by the hardware vendor:
>
> > processor : 0
> > vendor_id : SiS SiS SiS
> > cpu family : 5
> > model : 0
> > model name : ff/00
> > stepping : 5
> > cpu MHz : 200.008
> > fdiv_bug : no
> > hlt_bug : no
> > f00f_bug : no
> > coma_bug : no
> > fpu : yes
> > fpu_exception : yes
> > cpuid level : 1
> > wp : yes
> > flags : fpu tsc cx8 mmx
> > bogomips : 398.95
>
> I gather that is a SiS 55x System-on-a-chip.
>
> I am using T2[1] as build-system. It (currently) tries to build the kernel
> from 2.6.25.7 sources. When booting the kernel it built the system stops
> after:
>
> Decompressing Linux... done.
> Booting the kernel.
>
> At the bottom of the screen it says:
>
> BUG: Int6: CR2 00000000
>
> And nothing else.
>
Int6 mean invalid opcode

I find same error messages
on opensuse beta with linux-2.6.24 and real hardware
http://forums.opensuse.org/archives/sf-archives/opensuse-beta/347272-updated-last-night-kernel-bug-now.html

on debian kernel under MS VirtualPC
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463606


What version of gcc,binutils?

Could you try with distrib images to know if it could be related to your
compilation system or use a distrib kernel config to test on your compilation
system?

Instead of CONFIG_M386=y, you may try to select M486 or M586
( maybe later with tsc and mmx as cpuinfo flags line report it is supported).


Gilles

2008-07-06 08:49:52

by Marian Aldenhövel

[permalink] [raw]
Subject: Re: Building a kernel for SiS55-based system.

Hi,

> What version of gcc,binutils?

Gcc: 4.2.3
Binutils: 2.18.50.0.3

> Could you try with distrib images to know if it could be related to your
> compilation system

As I have to boot off CF card, the system does not have a hard disk and does
not like to boot off my USB-CD-Drive, my choices in prebuilt-Distributions
are a bit limited.

I found Pyramid-Linux, using a 2.6.19 kernel. That one hangs at the
"Ok, now booting the kernel" prompt without further messages.

The standard Damn Small Linux kernel fails with "no math coprocessor or no
math emulation present", but that apparently is using a 2.4 kernel. DSL-n,
with a 2.6.x kernel hangs at the same time as pyramid-linux.

Any other suggestions?

Ciao, MM
--
Marian Aldenh?vel, Rosenhain 23, 53123 Bonn
http://www.marian-aldenhoevel.de
"I ran some quick calculations on it. He's about 80% on the right
track. That leaves him only 20% dead when he crashes." Bob C



2008-07-06 10:53:08

by Gilles Espinasse

[permalink] [raw]
Subject: Re: Building a kernel for SiS55-based system.


----- Original Message -----
From: "Marian Aldenh?vel" <[email protected]>
To: "Gilles Espinasse" <[email protected]>
Cc: <[email protected]>
Sent: Sunday, July 06, 2008 10:49 AM
Subject: Re: Building a kernel for SiS55-based system.


>> What version of gcc,binutils?
>
> Gcc: 4.2.3
> Binutils: 2.18.50.0.3
>
>> Could you try with distrib images to know if it could be related to your
>> compilation system
>
> As I have to boot off CF card, the system does not have a hard disk and
does
> not like to boot off my USB-CD-Drive, my choices in prebuilt-Distributions
> are a bit limited.
>
- usb or classic floppy?
If you have that, you could try the test images I have made for IPCop
http://g.esp.free.fr/download/ipcop-1.9.2-boot.img
http://g.esp.free.fr/download/ipcop-1.9.2-root-1.img
http://g.esp.free.fr/download/ipcop-1.9.2-root-2.img

6ed40c877c9d47103a498193d65e4fea ipcop-1.9.2-boot.img
ea7f81b3cdcfdae3eb42227e5bb9423e ipcop-1.9.2-root-1.img
c2b442569c863841571f01eeac1f0882 ipcop-1.9.2-root-2.img
that's should boot any 486 (even with mmu emulation) or better with 16 MB
memory.
You need three floppies without error.
Corresponding kernel (2.6.24) .config is available at
http://ipcop.svn.sourceforge.net/viewvc/ipcop/ipcop/trunk/config/kernel/

- or booting from usb key?
- pxe-boot
pxe is the easiest way for testing but require some infrastructure.
You need a tftp server, a dhcp server and a card that support pxe.

If your bios does not support pxe with a built-in card, try with an e100
card.
All e100 nic cards I have support pxe boot and have a nice prompt at boot
after bios start.
You may prefere to update the nic pxe stack, all my e100 cards has been
updated with proboot.exe v10.3 (boot agent v4.19). I haven't tried more
recent versions.

Any modified isolinux.cfg could be modified to support pxe boot, you just
have to adjust the path from tftproot.
For example with Ubuntu, put the files in place with
mount -o loop ubuntu-8.04-mini.iso iso-test
mkdir -p /var/tfpt/ubuntu/x86/8.04 # /var/tfpt is my tftproot, yours may
vary
cd iso-test
cp * /var/tfpt/ubuntu/x86/8.04

Attached is the patch that modify the path in original Ubuntu isolinux.cfg
to match installed files

Add to the dhcp server in dhcp.conf (this is for ISC dhcp)
host fooname
{
hardware ethernet aa:bb:cc:dd:ee:ff; (set the real MAC address)
fixed-address 192.168.<ip to the machine>;
next-server 192.168.<ip to tftp server>;
filename "pxelinux.0";
option host-name "fooname";
}

Then set the link for nic MAC address to isolinux.cfg
cd /var/tftp/pxelinux.cfg
ln -sf ../ubuntu/x86/8.04/isolinux.cfg 01-aa-bb-cc-dd-ee-ff (lowercase for
a..f letters, always 01 prefix)

And the machine should be ready to boot from network.

Gilles


Attachments:
ubuntu-8.04-x86pxe-isolinux.cfg.patch (2.00 kB)

2008-07-11 15:44:15

by Marian Aldenhövel

[permalink] [raw]
Subject: Re: Building a kernel for SiS55-based system. No, wait! It's a Vortex86SX.

Hi,

>>> Could you try with distrib images to know if it could be related to your
>>> compilation system

Thank you for your advice re network boot and trying stock kernels. I did
set that up and learned a lot.

For one I learned that the CPU I am fighting with is in fact called
Vortex86SX. My first information (see subject) was either wrong or is a
less well-known alias for the same chip. Sorry for that.

Once armed with that information I was able to find more bits and pieces:

http://www.phys.ethz.ch/~abe/MicroClientJr/

> "Kompatibel zu 486SX statt Pentium MMX: Kleinerer Befehlssatz, keine FPU,
> schm?lere Bus-Breite. Debian GNU/Linux 4.0 Etch l?uft darauf (X.org aus Etch
> nicht), grml und Ubuntu nicht. Debian GNU/Linux Lenny/Sid Userland l?ft
> ebenfalls darauf, aber der 2.6.24er Kernel aus Sid nicht."

"Compatible with 486SX instead of Pentium MMX: Smaller Instruction set, no
FPU, narrower Bus. Debian GNU/Linux 4.0 Etch are running (X.org from Etch
does not), grml and Ubuntu are not. Debian GNU/Linux Lenny/Sid Userland
works but the 2.6.24 Kernel from Sid does not."

The builder of the chip even has detailed information on how to build
Linux 2.6.18 for it:

ftp://[email protected]/vortex86sx/Vortex86SX_Linux_HowTo.pdf

Patches included:

http://www.dmp.com.tw/tech/Vortex86SX/patch-2.6.18-DMP.gz

The bottom line is that current kernels don't work, the last one I know that
works is 2.6.18.. That is used in Debian Etch and I was able to confirm
operation by booting that one.

I have since downgraded my build-system to use 2.6.18.3 and that runs
fine on my hardware. So now I can set it all up any way I like directly
from upstream sources. Hooray!

Thank you very much.

Maybe someone smarter than me can figure out what the actual problem is,
when it was introduced since 2.6.18 and then presumeably fix it. Until
then I think I can live OK with the kernel I have now.

Ciao, MM
--
Marian Aldenh?vel, Rosenhain 23, 53123 Bonn
http://www.marian-aldenhoevel.de
"I ran some quick calculations on it. He's about 80% on the right
track. That leaves him only 20% dead when he crashes." Bob C

2008-07-11 15:48:41

by Alan

[permalink] [raw]
Subject: Re: Building a kernel for SiS55-based system. No, wait! It's a Vortex86SX.

> Patches included:
>
> http://www.dmp.com.tw/tech/Vortex86SX/patch-2.6.18-DMP.gz
>
> The bottom line is that current kernels don't work, the last one I know that
> works is 2.6.18.. That is used in Debian Etch and I was able to confirm
> operation by booting that one.
>
> I have since downgraded my build-system to use 2.6.18.3 and that runs
> fine on my hardware. So now I can set it all up any way I like directly
> from upstream sources. Hooray!
>
> Thank you very much.
>
> Maybe someone smarter than me can figure out what the actual problem is,
> when it was introduced since 2.6.18 and then presumeably fix it. Until
> then I think I can live OK with the kernel I have now.

So 2.6.18 works and 2.6.19 fails ? What is the failure that is observed.
My first thought would be FPU emulation as nobody uses it any more.

Alan

2008-07-11 15:52:47

by Alan

[permalink] [raw]
Subject: Re: Building a kernel for SiS55-based system. No, wait! It's a Vortex86SX.

> Patches included:
>
> http://www.dmp.com.tw/tech/Vortex86SX/patch-2.6.18-DMP.gz
>
> The bottom line is that current kernels don't work, the last one I know that
> works is 2.6.18.. That is used in Debian Etch and I was able to confirm
> operation by booting that one.

The IT821x thing is gross ;) but could be done properly upstream. Can you
send me an lspci -vvxxx and a "dmidecode" from the box and I'll sort that
bit out.

The r6040 driver is upstream in later kernels so that bit seems fine

Alan