LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-18-2005, 02:09 AM   #1
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Rep: Reputation: 15
Unhappy Slackware 10 bootdisk crash


Anyone able to help me with this one?

I recently installed Slackware 10 on my computer and after installation #3 I finally got it setup. After a couple of weeks of faffing around climbing the steep learning curve that is linux, I've decided to install Slackware 10 on my older Pentium 150 box aswell.

My old computer can't boot from a CD so I used one of the bootdisk images off the Slackware CD to make a bootdisk using the bare.i kernel. Booting into my bootdisk I can get to the "boot:" prompt and I hit the enter key, the ramdisk sets itself up and the kernel begins loading, the kernel finds both of my harddrives fine and also seems to find my CD drive fine (it quotes the exact make and model) but immediately after that it gives a kernel dump/oops error thingy..

hdd: BCD-24XH CD-ROM, ATAPI CD/DVD-ROM drive
Unable to handle kernel NULL pointer dereference at virtual address 00000000
printing eip:
*pde = 00000000
Oops: 0000
CPU: 0
EIP: 0010:[<00000000>] Not tainted
EFLAGS: 00010282
eax: 0000000c ebx: 00000004 ecx: 80000944 edx: 00000004
esi: 00000004 edi: c03b36f4 ebp: c03b37a4 esp: c106bf38
ds: 0018 es: 0018 ss: 0018
Process swapper (pid: 1, stackpage=c106b000)
Stack: c02034e8 c03b37a4 00b400f0 00000001 0c3b38e0 00000004 00000004 c03b37a4
0004e000 c01ffcd0 c03b37a4 0000000c c03b37a4 00000001 c03b36f4 c020d148
c03b37a4 000000ff 00000001 c03b36f4 c0105000 c020dd36 c03b36f4 00000001
Call Trace: [<c02034e8>] [<c01ffcd0>] [<c020d148>] [<c0105000>] [<c020dd36>]
[<c0105000>] [<c0105067>] [<c0107343>] [<c0105060>]

Code: Bad EIP value.
<0>Kernel panic: Attempted to kill init!

(I copied all that manually BTW - never again!) I did a bit of research and found that simiar errors can be caused by overclocked hardware so I de-clocked my P150 from 166MHz and tried again but got the same error. I also read that bad Ram can cause similar problems so I downloaded memtest and ran that through two passes with no error. I tried different bootdisks such as lowmem.i and oldcd.i but kept getting the same error. The silliest thing is that I already have Redhat 7.1 installed on there and it runs fine.

I don't really know what else to try as the above error message doesn't really tell me much, so in a final effort to give my old computer a new lease on life I have posted here. Any ideas
 
Old 03-18-2005, 06:59 AM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Try to compile a custom small kernel (don't enable modules!!) and make a bootdisk with it.
 
Old 03-18-2005, 03:13 PM   #3
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
So you reckon one of the modules I need isn't getting a chance to load or something? I like the idea of a custom kernel, should speed things up a bit hopefully. If one of the modules I need isn't loading properly though, couldn't I just compile that module into the kernel instead of completely eliminating all modules?

Thanks for the help

[edit] Sorry, I see what you mean, a little kernel compiled specifically for the purpose of booting rather than as part of the OS. I shall give it a go later on.

Last edited by Francis; 03-18-2005 at 03:15 PM.
 
Old 03-19-2005, 05:08 AM   #4
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
If you can boot, install and have network with it, then the world is yours . Enjoy.
 
Old 03-26-2005, 12:38 AM   #5
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
Well I've compiled custom kernel but am having trouble making a bootdisk out of it. One of the slackware readmes suggested making a normal bootdisk, then replacing the kernel with the custom one by doing this..

Code:
mount /dev/fd0 /mnt (this mounts it)
   cat zImage > /mnt/vmlinuz (put the new kernel in place)
   rdev -R /mnt/vmlinuz 0    (mount read-write)
   rdev /mnt/vmlinuz /dev/fd0u1440   (use that drive, or /dev/fd0h1200)
   rdev -r /mnt/vmlinuz 49152  (enable the ramdisk)
   lilo -r /mnt  (reinstall lilo)
   umount /mnt   (that's it! you're done! :^)
I made a bootdisk using the bare.i kernel..

Code:
cat bare.i > /dev/fd0
and that went just fine, but I just can't seem to replace the kernel, I keep getting stupid errors, if I..

cat bzImage > /mnt/floppy/vmlinuz

..I get an error telling me that /mnt/floppy/vmlinuz doesn't exist but I can cd into my floppy and see vmlinuz. If I try removing the original version of vmlinuz from the floppy while in X, then try dragging and dropping my new version onto the floppy, I get an error message telling me that it won't fit. If I use cat to send my version of vmlinuz to the floppy drive (rather than to vmliuz on the floppy) I get a whole load of garbage on the screen and am unable to mount or demount my floppy.

Actually It's been a real mission getting floppies to mount.

[edit] OK here are some quotes from the shell..

Code:
root@SlackBox:/mnt# mount floppy
mount: you must specify the filesystem type
root@SlackBox:/mnt# mount -t ext2 /dev/fd0 /mnt/floppy
mount: wrong fs type, bad option, bad superblock on /dev/fd0,
       or too many mounted file systems
root@SlackBox:/mnt# mount /dev/fd0 /mnt/floppy
mount: you must specify the filesystem type
As you can see the floppy just refuses to mount, but..

Code:
root@SlackBox:/mnt# fdformat /dev/fd0
Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
Formatting ... done
Verifying ... done
..it will format OK, and..

Code:
root@SlackBox:/mnt# mkfs /dev/fd0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
184 inodes, 1440 blocks
72 blocks (5.00%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
184 inodes per group

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
..I can make a filesystem on it, everything is going OK until..

Code:
root@SlackBox:/mnt# mount floppy
mount: wrong fs type, bad option, bad superblock on /dev/fd0,
       or too many mounted file systems
root@SlackBox:/mnt#
..the f@cking thing won't mount!

Am I doing something wrong?

Last edited by Francis; 03-26-2005 at 01:09 AM.
 
Old 03-26-2005, 01:25 AM   #6
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
Grrrr..

It gets even worse, I removed the floppy from the drive, then put it back in and tried mounting it and mysteriously it worked. I tried writing the bare.i boot image to it but it told me there wasn't enough room..

Code:
root@SlackBox:/mnt/cdrom/bootdisks# cat bare.i > /mnt/floppy/bare.i
cat: write error: No space left on device
root@SlackBox:/mnt/cdrom/bootdisks# cd /mnt/floppy
root@SlackBox:/mnt/floppy# ls
bare.i  lost+found/
root@SlackBox:/mnt/floppy#
..but as you can see bare.i is on the floppy. The bare.i file that I copied is only 1.4MB so it should fit on the floppy ok since it's the only thing on the floppy, and the copy of bare.i on the floppy is also 1.4MB so it looks like it wrote the whole thing properly?
 
Old 03-26-2005, 02:33 AM   #7
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
First, the bootdisk images for Slackware use a vfat/msdos filesystem, not a linux filesystem. They also use the Syslinux bootloader, so there is really no need for doing the rdev stuff. What you're main problem is is that your custom kernel is simply too big to fit on the floppy. Here's what I suggest that you do.

First, just as a wild guess, I'd say the reason the default Slackware kernels aren't working lies somewhere within your IDE controller. I ran into a similair issue awhile back with an onboard controller. I don't recall what chipset it was off hand though. Anyway, the first thing I try is unhooking everything from the Secondary IDE controller and then trying to boot with the lowmem.i kernel. I that works, then you at least have a starting point to work with.

Second, if the above don't work, you said you already had Redhat up and running on the PC. If that's still the case, then you should use it to gather some info about your hardware. Then use that info when building your custom kernel, so as to reduce the size of the kernel to only what you need.

Third, grab the config file from the lowmem.i image and use that as a starting point for your custom kernel. One way to get the file is as follows:
Code:
mkdir /mnt/loop
mount -o loop lowmem.i /mnt/loop
cp /mnt/loop/config .
umount /mnt/loop
That copies the file named "config" into your current directory. Don't forget to rename it ".config", notice the "." when you copy it into the kernel source tree.

Forth, now configure your kernel. Again, I'd concentrate my efforts in the IDE support, maybe disabling it entirely at first until I figured out what exactly is causing the oops. And work from there. There is approximately 1.3mb of room on the lowmem.i bootdisk for a kernel, if you remove the default one, so you need to keep it under that. You can check the size of course with ls, after building the kernel.
Code:
ls -lh arch/i386/boot/bzImage
Now copy the kernel, config, & System.map to root's home:
Code:
mkdir /root/custom
gzip -c System.map > /root/custom/system~1.gz
cp .config /root/custom/config
cp arch/i386/boot/bzImage /root/custom/vmlinuz
Now, there are couple ways to get the new kernel on the disk. The fastest and easiest way is to simply replace it before you ever write the disk. We can do this by modifing the image, as follows:
Code:
cd /root
cp lowmem.i custom.i
mount -o loop custom.i /mnt/loop
cp custom/* /mnt/loop
umount /mnt/loop
Now make the bootdisk:
Code:
cat custom.i > /dev/fd0
You could also write the lowmem.i image to the disk, mount it and just replace the vmlinuz file on it with your custom kernel. There is no "real" need to replace the config and system~1.gz files on the disk, until you have a kernel that works, but it's good practice too and you'll need them once you install a kernel after installing SLackware. Good luck.
 
Old 03-27-2005, 03:49 AM   #8
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
Quote:
First, the bootdisk images for Slackware use a vfat/msdos filesystem, not a linux filesystem.
Ah, that explains a lot!

The IDE controller does sound like a plausible root of the problem, I currently have both the CD drive and a HD on the secondary controller so I'll try disconnecting them and see if it fixes the problem. Failing that I'll try the custom bootdisk - haven't played with loopback devices yet

Thanks for the help DaHammer, it's really appreciated
 
Old 04-02-2005, 05:03 AM   #9
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
Okey dokey,

I opened up the box and found that I have one HD on the primary IDE channel and on the secondary channel I have a second HD and the CD drive, disconnecting everything from the secondary IDE channel allowed the bootdisk to get to the rootdisk stage, the furthest I've gotten so far. I experimented a little further and found that the bootdisk crashed whenever I had anything attached to the secondary IDE channel, whether it was one or two drives, master/slave, slave/master, etc - if anything was plugged into the secondary IDE channel it would crash. Despite this, the fact that my current install can use all drives with no problem would suggest that the problem is merely with the bootdisk kernel and a custom kernel should be able to get this thing running? I had a go at that custom kernel, but couldn't get it on to floppy. It was a while ago but there was a problem copying stuff either from or to the loopback device, can't remember which, I'll give it another go and copy the error message, not tonight though, sooo tired!
 
Old 04-02-2005, 02:18 PM   #10
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Cool, can you identify the IDE controller? Just wandering if it's the same as the one that I experienced the exact same problem on. If so, I have notes around here somewhere as to what I had to disable in the kernel to get both channels of the controller to work. From your Redhat install, you can identify it from the output of "lspci". From the Slackware boot/root disks, you can look through the output of "dmesg | more" to find it. I'll see if I can find my notes.
 
Old 04-02-2005, 08:13 PM   #11
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
SIS5513: IDE controller on PCI bus 00 dev 09
SIS5513: not 100% native mode: will probe irqs later
SIS5513: simplex device: DMA disabled
ide0: SIS5513 Bus-Master DMA disabled (BIOS)
SIS5513: simplex device: DMA disabled
ide1: SIS5513 Bus-Master DMA disabled (BIOS)
hda: QUANTUM BIGFOOT_CY4320A, ATA DISK drive
hdc: QUANTUM BIGFOOT1280A, ATA DISK drive
hdd: BCD-24XH CD-ROM, ATAPI CDROM drive
ide0: at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15

What are your thoughts?
 
Old 04-02-2005, 08:56 PM   #12
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Yep, that's it, the Sis 5513. Here's the lspci output from my old Premio box with the same issue:
Code:
00:01.1 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev 09)
Unfortunately, I still haven't found my notes. I did find the hardware info though. From looking at it, it appears that I loaded the sis5513 driver as a module vs having it compiled in as it is the Slackware bare.i kernel. The lowmem.i kernel doesn't contain it all. But best I recall, that wasn't the problem. I'll keep looking.
 
Old 04-06-2005, 01:10 AM   #13
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
Yippee

I know what's wrong, a google search of "SIS5513" revealed that it is a very buggy piece of hardware and that many others are having the same trouble as us, there's a kernel patch available to deal with it. So - all I have to do is...

# patch my kernel source
# make a custom kernel for a bootdisk
# make a bootdisk with my custom kernel
# install Slackware
# compile and install a second custom kernel for Slackware to use
# cross my fingers

have I got this right? I patch my kernel source, then I can configure and compile kernels that incorporate the patch?

Success is in view

might end up needing some help making the custom kerneled bootdisk though since I didn't manage to get it working last time, I'll post here if I have trouble (or if everything goes to plan). Thanks for the help everyone, especially DaHammer
 
Old 04-06-2005, 01:59 PM   #14
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
You got a link to the patch? I ran into the issue a couple years back while setting up an old Premio Pentium 100 system for use as a router/firewall. You'd think that any patch would have made it's way into the kernel source by now, but since the issue is still there I guess not. Anyway, yeah, you'd basically just need to patch the kernel source, configure the kernel, and compile it. Then just replace the kernel on the bootdisk with the one you compiled. And when you install the kernel during the Slackware installation, instruct the installer to use the one on your disk instead of the others.
 
Old 04-15-2005, 04:16 AM   #15
Francis
Member
 
Registered: Nov 2004
Location: New Zealand
Distribution: Slackware 10.0
Posts: 37

Original Poster
Rep: Reputation: 15
OK, well after finding out that there is a patch available, I went out to find the patch and download it, but all I was able to find were mailing lists with masses of code. Apparently the code which I am about to paste at the bottom of this post is meant to fix the problem, but I'm not sure what I should actually do with this code to fix my kernel. Sorry to take so long to reply, I took a wee break from linux fixing and just used it instead for a while

Heres the code...

[edit] Woooooaaaahhh!!! I had saved the code to a text file on my desktop, I just double clicked the icon so I could copy the code and "Kompare" opened up with what looks to be a patch installer/maintainer program of some sort, man that was unexpected. This looks to be the solution to my question. Here's the code anyway...

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sis.patch.20020402_1"

diff -urN -X dontdiff linux-2.4.19-pre5/MAINTAINERS linux-2.4.19-pre5-sis/MAINTAINERS
--- linux-2.4.19-pre5/MAINTAINERS Tue Apr 2 22:48:26 2002
+++ linux-2.4.19-pre5-sis/MAINTAINERS Tue Apr 2 22:59:32 2002
@@ -1395,6 +1395,13 @@
M: mingo@redhat.com
S: Maintained

+SIS 5513 IDE CONTROLLER DRIVER
+P: Lionel Bouton
+M: Lionel.Bouton@inet6.fr
+W: http://inet6.dyn.dhs.org/sponsoring/sis5513/index.html
+W: http://gyver.homeip.net/sis5513/index.html
+S: Maintained
+
SIS 900/7016 FAST ETHERNET DRIVER
P: Ollie Lho
M: ollie@sis.com.tw
diff -urN -X dontdiff linux-2.4.19-pre5/drivers/ide/sis5513.c linux-2.4.19-pre5-sis/drivers/ide/sis5513.c
--- linux-2.4.19-pre5/drivers/ide/sis5513.c Tue Apr 2 22:48:34 2002
+++ linux-2.4.19-pre5-sis/drivers/ide/sis5513.c Tue Apr 2 22:57:08 2002
@@ -1,12 +1,19 @@
/*
- * linux/drivers/ide/sis5513.c Version 0.13 February 14, 2002
+ * linux/drivers/ide/sis5513.c Version 0.13 March 6, 2002
*
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer
* May be copied or modified under the terms of the GNU General Public License
*
- * Thanks to SIS Taiwan for direct support and hardware.
- * Thanks to Daniela Engert for ATA100 support advice.
+ *
+ * Thanks :
+ *
+ * SiS Taiwan : for direct support and hardware.
+ * Daniela Engert : for initial ATA100 advices and numerous others.
+ * John Fremlin, Manfred Spraul :
+ * for checking code correctness, providing patches.
+ *
+ *
* Original tests and design on the SiS620/5513 chipset.
* ATA100 tests and design on the SiS735/5513 chipset.
* ATA16/33 design from specs
@@ -14,11 +21,11 @@

/*
* TODO:
- * - Are there pre-ATA_16 SiS chips ? -> tune init code for them
- * or remove ATA_00 defines
* - Get ridden of SisHostChipInfo[] completness dependancy.
* - Get ATA-133 datasheets, implement ATA-133 init code.
- * - Check latency timer init correctness.
+ * - Study drivers/ide/ide-timing.h.
+ * - Are there pre-ATA_16 SiS5513 chips ? -> tune init code for them
+ * or remove ATA_00 define
* - More checks in the config registers (force values instead of
* relying on the BIOS setting them correctly).
* - Further optimisations ?
@@ -45,62 +52,45 @@

#include "ide_modes.h"

-#define DEBUG
-/* if BROKEN_LEVEL is defined it limits the DMA mode
+/* When DEBUG is defined it outputs initial PCI config register
+ values and changes made to them by the driver */
+// #define DEBUG
+/* When BROKEN_LEVEL is defined it limits the DMA mode
at boot time to its value */
// #define BROKEN_LEVEL XFER_SW_DMA_0
#define DISPLAY_SIS_TIMINGS

/* Miscellaneaous flags */
#define SIS5513_LATENCY 0x01
-/* ATA transfer mode capabilities */
+
+/* registers layout and init values are chipset family dependant */
+/* 1/ define families */
#define ATA_00 0x00
#define ATA_16 0x01
#define ATA_33 0x02
#define ATA_66 0x03
-#define ATA_100 0x04
-#define ATA_133 0x05
-
-static unsigned char dma_capability = 0x00;
+#define ATA_100a 0x04 // SiS730 is ATA100 with ATA66 layout
+#define ATA_100 0x05
+#define ATA_133 0x06
+/* 2/ variable holding the controller chipset family value */
+static unsigned char chipset_family;


/*
* Debug code: following IDE config registers' changes
*/
#ifdef DEBUG
-/* Copy of IDE Config registers 0x00 -> 0x58
+/* Copy of IDE Config registers 0x00 -> 0x57
Fewer might be used depending on the actual chipset */
-static unsigned char ide_regs_copy[] = {
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0
-};
+static unsigned char ide_regs_copy[0x58];

static byte sis5513_max_config_register(void) {
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_00:
case ATA_16: return 0x4f;
case ATA_33: return 0x52;
case ATA_66:
+ case ATA_100a:
case ATA_100:
case ATA_133:
default: return 0x57;
@@ -145,7 +135,7 @@
printk(" %0#x:%0#x", reg, ide_regs_copy[reg]);
}

-/* Print valuable registers (for ATA100) */
+/* Print valuable registers */
static void sis5513_print_registers(struct pci_dev* dev, char* marker) {
int i;
byte max = sis5513_max_config_register();
@@ -176,14 +166,14 @@
static const struct {
const char *name;
unsigned short host_id;
- unsigned char dma_capability;
+ unsigned char chipset_family;
unsigned char flags;
} SiSHostChipInfo[] = {
{ "SiS750", PCI_DEVICE_ID_SI_750, ATA_100, SIS5513_LATENCY },
{ "SiS745", PCI_DEVICE_ID_SI_745, ATA_100, SIS5513_LATENCY },
{ "SiS740", PCI_DEVICE_ID_SI_740, ATA_100, SIS5513_LATENCY },
{ "SiS735", PCI_DEVICE_ID_SI_735, ATA_100, SIS5513_LATENCY },
- { "SiS730", PCI_DEVICE_ID_SI_730, ATA_100, SIS5513_LATENCY },
+ { "SiS730", PCI_DEVICE_ID_SI_730, ATA_100a, SIS5513_LATENCY },
{ "SiS650", PCI_DEVICE_ID_SI_650, ATA_100, SIS5513_LATENCY },
{ "SiS645", PCI_DEVICE_ID_SI_645, ATA_100, SIS5513_LATENCY },
{ "SiS635", PCI_DEVICE_ID_SI_635, ATA_100, SIS5513_LATENCY },
@@ -202,14 +192,15 @@

/* Cycle time bits and values vary accross chip dma capabilities
These three arrays hold the register layout and the values to set.
- Indexed by dma_capability and (dma_mode - XFER_UDMA_0) */
-static byte cycle_time_offset[] = {0,0,5,4,0,0};
-static byte cycle_time_range[] = {0,0,2,3,4,4};
+ Indexed by chipset_family and (dma_mode - XFER_UDMA_0) */
+static byte cycle_time_offset[] = {0,0,5,4,4,0,0};
+static byte cycle_time_range[] = {0,0,2,3,3,4,4};
static byte cycle_time_value[][XFER_UDMA_5 - XFER_UDMA_0 + 1] = {
{0,0,0,0,0,0}, /* no udma */
{0,0,0,0,0,0}, /* no udma */
{3,2,1,0,0,0},
{7,5,3,2,1,0},
+ {7,5,3,2,1,0},
{11,7,5,4,2,1},
{0,0,0,0,0,0} /* not yet known, ask SiS */
};
@@ -283,23 +274,25 @@
pci_read_config_byte(bmide_dev, 0x45+2*pos, &reg11);

/* UDMA */
- if (dma_capability >= ATA_33) {
+ if (chipset_family >= ATA_33) {
p += sprintf(p, " UDMA %s \t \t \t UDMA %s\n",
(reg01 & 0x80) ? "Enabled" : "Disabled",
(reg11 & 0x80) ? "Enabled" : "Disabled");

p += sprintf(p, " UDMA Cycle Time ");
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_33: p += sprintf(p, cycle_time[(reg01 & 0x60) >> 5]); break;
- case ATA_66: p += sprintf(p, cycle_time[(reg01 & 0x70) >> 4]); break;
+ case ATA_66:
+ case ATA_100a: p += sprintf(p, cycle_time[(reg01 & 0x70) >> 4]); break;
case ATA_100: p += sprintf(p, cycle_time[reg01 & 0x0F]); break;
case ATA_133:
default: p += sprintf(p, "133+ ?"); break;
}
p += sprintf(p, " \t UDMA Cycle Time ");
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_33: p += sprintf(p, cycle_time[(reg11 & 0x60) >> 5]); break;
- case ATA_66: p += sprintf(p, cycle_time[(reg11 & 0x70) >> 4]); break;
+ case ATA_66:
+ case ATA_100a: p += sprintf(p, cycle_time[(reg11 & 0x70) >> 4]); break;
case ATA_100: p += sprintf(p, cycle_time[reg11 & 0x0F]); break;
case ATA_133:
default: p += sprintf(p, "133+ ?"); break;
@@ -309,21 +302,23 @@

/* Data Active */
p += sprintf(p, " Data Active Time ");
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_00:
case ATA_16: /* confirmed */
case ATA_33:
- case ATA_66: p += sprintf(p, active_time[reg01 & 0x07]); break;
+ case ATA_66:
+ case ATA_100a: p += sprintf(p, active_time[reg01 & 0x07]); break;
case ATA_100: p += sprintf(p, active_time[(reg00 & 0x70) >> 4]); break;
case ATA_133:
default: p += sprintf(p, "133+ ?"); break;
}
p += sprintf(p, " \t Data Active Time ");
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_00:
case ATA_16:
case ATA_33:
- case ATA_66: p += sprintf(p, active_time[reg11 & 0x07]); break;
+ case ATA_66:
+ case ATA_100a: p += sprintf(p, active_time[reg11 & 0x07]); break;
case ATA_100: p += sprintf(p, active_time[(reg10 & 0x70) >> 4]); break;
case ATA_133:
default: p += sprintf(p, "133+ ?"); break;
@@ -356,11 +351,12 @@
u16 reg2, reg3;

p += sprintf(p, "\nSiS 5513 ");
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_00: p += sprintf(p, "Unknown???"); break;
case ATA_16: p += sprintf(p, "DMA 16"); break;
case ATA_33: p += sprintf(p, "Ultra 33"); break;
case ATA_66: p += sprintf(p, "Ultra 66"); break;
+ case ATA_100a:
case ATA_100: p += sprintf(p, "Ultra 100"); break;
case ATA_133:
default: p+= sprintf(p, "Ultra 133+"); break;
@@ -371,7 +367,7 @@
/* Status */
pci_read_config_byte(bmide_dev, 0x4a, &reg);
p += sprintf(p, "Channel Status: ");
- if (dma_capability < ATA_66) {
+ if (chipset_family < ATA_66) {
p += sprintf(p, "%s \t \t \t \t %s\n",
(reg & 0x04) ? "On" : "Off",
(reg & 0x02) ? "On" : "Off");
@@ -388,7 +384,7 @@
(reg & 0x04) ? "Native" : "Compatible");

/* 80-pin cable ? */
- if (dma_capability > ATA_33) {
+ if (chipset_family > ATA_33) {
pci_read_config_byte(bmide_dev, 0x48, &reg);
p += sprintf(p, "Cable Type: %s \t \t \t %s\n",
(reg & 0x10) ? cable_type[1] : cable_type[0],
@@ -489,8 +485,8 @@
default: return;
}

- /* register layout changed with ATA100 chips */
- if (dma_capability < ATA_100) {
+ /* register layout changed with newer ATA100 chips */
+ if (chipset_family < ATA_100) {
pci_read_config_byte(dev, drive_pci, &test1);
pci_read_config_byte(dev, drive_pci+1, &test2);

@@ -570,7 +566,7 @@

pci_read_config_byte(dev, drive_pci+1, &reg);
/* Disable UDMA bit for non UDMA modes on UDMA chips */
- if ((speed < XFER_UDMA_0) && (dma_capability > ATA_16)) {
+ if ((speed < XFER_UDMA_0) && (chipset_family > ATA_16)) {
reg &= 0x7F;
pci_write_config_byte(dev, drive_pci+1, reg);
}
@@ -584,12 +580,14 @@
case XFER_UDMA_2:
case XFER_UDMA_1:
case XFER_UDMA_0:
+ /* Force the UDMA bit on if we want to use UDMA */
+ reg |= 0x80;
/* clean reg cycle time bits */
- reg &= ~((0xFF >> (8 - cycle_time_range[dma_capability]))
- << cycle_time_offset[dma_capability]);
+ reg &= ~((0xFF >> (8 - cycle_time_range[chipset_family]))
+ << cycle_time_offset[chipset_family]);
/* set reg cycle time bits */
- reg |= cycle_time_value[dma_capability-ATA_00][speed-XFER_UDMA_0]
- << cycle_time_offset[dma_capability];
+ reg |= cycle_time_value[chipset_family-ATA_00][speed-XFER_UDMA_0]
+ << cycle_time_offset[chipset_family];
pci_write_config_byte(dev, drive_pci+1, reg);
break;
case XFER_MW_DMA_2:
@@ -638,17 +636,17 @@
drive->dn, ultra);
#endif

- if ((id->dma_ultra & 0x0020) && ultra && udma_66 && (dma_capability >= ATA_100))
+ if ((id->dma_ultra & 0x0020) && ultra && udma_66 && (chipset_family >= ATA_100a))
speed = XFER_UDMA_5;
- else if ((id->dma_ultra & 0x0010) && ultra && udma_66 && (dma_capability >= ATA_66))
+ else if ((id->dma_ultra & 0x0010) && ultra && udma_66 && (chipset_family >= ATA_66))
speed = XFER_UDMA_4;
- else if ((id->dma_ultra & 0x0008) && ultra && udma_66 && (dma_capability >= ATA_66))
+ else if ((id->dma_ultra & 0x0008) && ultra && udma_66 && (chipset_family >= ATA_66))
speed = XFER_UDMA_3;
- else if ((id->dma_ultra & 0x0004) && ultra && (dma_capability >= ATA_33))
+ else if ((id->dma_ultra & 0x0004) && ultra && (chipset_family >= ATA_33))
speed = XFER_UDMA_2;
- else if ((id->dma_ultra & 0x0002) && ultra && (dma_capability >= ATA_33))
+ else if ((id->dma_ultra & 0x0002) && ultra && (chipset_family >= ATA_33))
speed = XFER_UDMA_1;
- else if ((id->dma_ultra & 0x0001) && ultra && (dma_capability >= ATA_33))
+ else if ((id->dma_ultra & 0x0001) && ultra && (chipset_family >= ATA_33))
speed = XFER_UDMA_0;
else if (id->dma_mword & 0x0004)
speed = XFER_MW_DMA_2;
@@ -681,6 +679,8 @@
struct hd_driveid *id = drive->id;
ide_dma_action_t dma_func = ide_dma_off_quietly;

+ (void) config_chipset_for_pio(drive, 5);
+
if (id && (id->capability & 1) && HWIF(drive)->autodma) {
/* Consult the list of known "bad" drives */
if (ide_dmaproc(ide_dma_bad_drive, drive)) {
@@ -745,10 +745,6 @@
struct pci_dev *host;
int i = 0;

-#ifdef DEBUG
- sis5513_print_registers(dev, "pci_init_sis5513 start");
-#endif
-
/* Find the chip */
for (i = 0; i < ARRAY_SIZE(SiSHostChipInfo) && !host_dev; i++) {
host = pci_find_device (PCI_VENDOR_ID_SI,
@@ -758,12 +754,16 @@
continue;

host_dev = host;
- dma_capability = SiSHostChipInfo[i].dma_capability;
+ chipset_family = SiSHostChipInfo[i].chipset_family;
printk(SiSHostChipInfo[i].name);
printk("\n");

+#ifdef DEBUG
+ sis5513_print_registers(dev, "pci_init_sis5513 start");
+#endif
+
if (SiSHostChipInfo[i].flags & SIS5513_LATENCY) {
- byte latency = (dma_capability == ATA_100)? 0x80 : 0x10; /* Lacking specs */
+ byte latency = (chipset_family == ATA_100)? 0x80 : 0x10; /* Lacking specs */
pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency);
}
}
@@ -773,7 +773,7 @@
2/ tell old chips to allow per drive IDE timings */
if (host_dev) {
byte reg;
- switch(dma_capability) {
+ switch(chipset_family) {
case ATA_133:
case ATA_100:
/* Set compatibility bit */
@@ -782,6 +782,7 @@
pci_write_config_byte(dev, 0x49, reg|0x01);
}
break;
+ case ATA_100a:
case ATA_66:
/* On ATA_66 chips the bit was elsewhere */
pci_read_config_byte(dev, 0x52, &reg);
@@ -827,7 +828,7 @@
byte mask = hwif->channel ? 0x20 : 0x10;
pci_read_config_byte(hwif->pci_dev, 0x48, &reg48h);

- if (dma_capability >= ATA_66) {
+ if (chipset_family >= ATA_66) {
ata66 = (reg48h & mask) ? 0 : 1;
}
return ata66;
@@ -846,7 +847,7 @@

if (host_dev) {
#ifdef CONFIG_BLK_DEV_IDEDMA
- if (dma_capability > ATA_16) {
+ if (chipset_family > ATA_16) {
hwif->autodma = noautodma ? 0 : 1;
hwif->dmaproc = &sis5513_dmaproc;
} else {

--GvXjxJ+pjyke8COw--
-
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
installing rh or slackware from bootdisk israel Linux - Software 3 09-17-2003 08:58 PM
Slackware Bootdisk Fishermon Slackware 3 02-12-2003 11:05 PM
Slackware bootdisk Ahh! tarballedtux Slackware 3 10-05-2002 02:29 AM
Slackware 8.0 Bootdisk magis Linux - Newbie 2 03-29-2002 12:43 PM
Slackware bootdisk/LILO problem bleach Linux - Software 6 12-03-2001 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration