Skip to contentSkip to conversation

Building a kernel for SiS55-based system.

DISCUSSION Marian Aldenhövel 3 participants 7 messages Jun 24, 2008 – Jul 11, 2008

lore
Share & tools
lore
#0 lore raw

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:

Quoted 9 lines

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

Quoted 8 lines

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

Signature · 4 lines
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
#1 lore raw

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

Quoted 31 lines

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:

Quoted 9 lines

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

Quoted 8 lines

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:

Quoted 9 lines

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

#2 lore raw

Hi,

Quoted 1 line

What version of gcc,binutils?

Gcc: 4.2.3
Binutils: 2.18.50.0.3

Quoted 2 lines

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

Signature · 4 lines
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
#3 lore raw

----- 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.

Quoted 9 lines
Quoted 1 line

What version of gcc,binutils?

Gcc: 4.2.3
Binutils: 2.18.50.0.3

Quoted 2 lines

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

Quoted 3 lines

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

x86/8.04/isolinux.cfg renamed from x86/8.04/isolinux.cfg.orig +23 -23
@@ -1,39 +1,39 @@
 
-DISPLAY boot.txt
+DISPLAY /ubuntu/x86/8.04/boot.txt
 
-F1 f1.txt
-F2 f2.txt
-F3 f3.txt
-F4 f4.txt
-F5 f5.txt
-F6 f6.txt
-F7 f7.txt
-F8 f8.txt
-F9 f9.txt
-F0 f10.txt
+F1 /ubuntu/x86/8.04/f1.txt
+F2 /ubuntu/x86/8.04/f2.txt
+F3 /ubuntu/x86/8.04/f3.txt
+F4 /ubuntu/x86/8.04/f4.txt
+F5 /ubuntu/x86/8.04/f5.txt
+F6 /ubuntu/x86/8.04/f6.txt
+F7 /ubuntu/x86/8.04/f7.txt
+F8 /ubuntu/x86/8.04/f8.txt
+F9 /ubuntu/x86/8.04/f9.txt
+F0 /ubuntu/x86/8.04/f10.txt
 
 DEFAULT install
 
 LABEL install
-	kernel linux
-	append vga=normal initrd=initrd.gz -- 
+	kernel /ubuntu/x86/8.04/linux
+	append vga=normal initrd=/ubuntu/x86/8.04/initrd.gz -- 
 LABEL linux
-	kernel linux
-	append vga=normal initrd=initrd.gz -- 
+	kernel /ubuntu/x86/8.04/linux
+	append vga=normal initrd=/ubuntu/x86/8.04/initrd.gz -- 
 LABEL cli
-	kernel linux
-	append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=initrd.gz -- 
+	kernel /ubuntu/x86/8.04/linux
+	append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=/ubuntu/x86/8.04/initrd.gz -- 
 
 LABEL expert
-	kernel linux
-	append priority=low vga=normal initrd=initrd.gz -- 
+	kernel /ubuntu/x86/8.04/linux
+	append priority=low vga=normal initrd=/ubuntu/x86/8.04/initrd.gz -- 
 LABEL cli-expert
-	kernel linux
-	append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=initrd.gz -- 
+	kernel /ubuntu/x86/8.04/linux
+	append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=/ubuntu/x86/8.04/initrd.gz -- 
 
 LABEL rescue
-	kernel linux
-	append vga=normal initrd=initrd.gz rescue/enable=true -- 
+	kernel /ubuntu/x86/8.04/linux
+	append vga=normal initrd=/ubuntu/x86/8.04/initrd.gz rescue/enable=true -- 
 
 PROMPT 1
 TIMEOUT 0
#4 lore raw

Re: Building a kernel for SiS55-based system. No, wait! It's a Vortex86SX.

Hi,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

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/

Quoted 4 lines

"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

Signature · 4 lines
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
#5 lore raw

Re: Building a kernel for SiS55-based system. No, wait! It's a Vortex86SX.

Quoted 12 lines

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!

Quoted 5 lines

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

#6 lore raw

Re: Building a kernel for SiS55-based system. No, wait! It's a Vortex86SX.

In reply to Marian Aldenhövel
Quoted 7 lines

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