LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Creating bootable image for old kernel (2.0.40) (https://www.linuxquestions.org/questions/linux-general-1/creating-bootable-image-for-old-kernel-2-0-40-a-4175596899/)

Mr486 01-06-2017 02:50 AM

Creating bootable image for old kernel (2.0.40)
 
Hi, I have posted here about a problem I have been having with building a zImage for a 2.0.40 kernel.

I create a zImage then I copy that zImage to a floppy. When I boot from a floppy with that image I successfully get "Loading...................." but before the "Uncompressing Linux" message is displayed the machine reboots!

I wondered if any experienced forum members can remmeber possible reasons why the machine does the reboot before the Uncompressing.

I am currently using a bootable floppy disk which I successfully built a 2.0.40 bootable kernel in 2015 on that same machine, so something must be different now.

The bootable disks that I create, I have tried on a different machine and they behave the same way: The working disk works and goes through the bootup process and the fresh build attempts do the Loading..... but not the Uncompressing.

Thanking you in advance for giving this some thought.

business_kid 01-06-2017 03:37 AM

Wow. 2.0 kernels is really bringing suffering on yourself. Have you seen this?
http://www.toms.net/rb

Tomsrtbt is a floppy based linux system. It formats a 1722k floppy ( or something like that) on a 1.44MB disk, and puts kernel, busybox, & all on there as a rescue disk. It saved my a** more often than I care to remember. Amazingly, it's still there, although floppy disks are not fitted these days.

Are you in a museum?

EDIT: The kernel may be 2.2x but you might find an old version on the site. I'm sure 2.2 will work for you anyway.

fatmac 01-06-2017 07:25 AM

Are you using an initrd created for that kernel, (might be the way).

Mr486 01-06-2017 09:29 AM

Hi thanks, will have a look over the weekend.

Mr486 01-12-2017 08:03 AM

Hi, I had a look at some of those things to help.... I got hold of a Ubuntu Trusty and was looking into that.

.....with regards to my zImage...... I put a HLT instruction in the file bootsect.S where it has the jump to SETUPSEG. So I have confirmed it gets as far as that without anything going wrong.

I need to look into what SETUPSEG gets up to..... (i.e. what the file setup.S does)

jefro 01-14-2017 02:42 PM

Wonder if running tests on virtual machine or maybe better still qemu would speed up tests? Since you say it did work on that exact system we have to mostly assume that the floppy is bad.

business_kid 01-15-2017 03:38 AM

Did you spend the 5 minutes making a tomsrtbt floppy? Does it boot on that?

patrick295767 01-15-2017 05:22 AM

Quote:

Originally Posted by Mr486 (Post 5651108)
Hi, I have posted here about a problem I have been having with building a zImage for a 2.0.40 kernel.

I create a zImage then I copy that zImage to a floppy. When I boot from a floppy with that image I successfully get "Loading...................." but before the "Uncompressing Linux" message is displayed the machine reboots!

I wondered if any experienced forum members can remmeber possible reasons why the machine does the reboot before the Uncompressing.

I am currently using a bootable floppy disk which I successfully built a 2.0.40 bootable kernel in 2015 on that same machine, so something must be different now.

The bootable disks that I create, I have tried on a different machine and they behave the same way: The working disk works and goes through the bootup process and the fresh build attempts do the Loading..... but not the Uncompressing.

Thanking you in advance for giving this some thought.

This quite old kernel.

You may compile a kernel yourself relatively easily. Such old kernel, I am not so sure if it is stable.
The oldest one I compiled was the 2.4.x a bit like the DSL damn small linux.

In principle, it ought to work though.

business_kid 01-16-2017 12:19 PM

Quote:

Originally Posted by patrick295767 (Post 5655231)
This quite old kernel.

You may compile a kernel yourself relatively easily. Such old kernel, I am not so sure if it is stable.
The oldest one I compiled was the 2.4.x a bit like the DSL damn small linux.

In principle, it ought to work though.

In principle, yes; In practise, he'll be lucky. SOME of the issues I can see are
1. Module-init-tools (modprobe, insmod, rmmod, depmod) have changed teetotally
2. /etc/modprobe.conf is now /etc/modprobe.d
3. Glibc has changed drastically since then. Glibc is an essential part of the compiling toolchain.
4. The linux headers have shifted around, directories have been renamed, and contents are different.
5. Gcc has gone from gcc-2.x to gcc-5.x. For a long time, kernels were to be compiled with gcc-2.7.x (2.7.2 I think. This was a
l o n g time ago)
6. The isa bus has been obsoleted and I imagine neither libs nor includes on modern versions support it. He will probably need isa bus support.

This link ftp://ftp.heanet.ie/mirrors/slackwar...slackware-3.5/

is a link to Slackware-3.5, which has kernel 2.0.34. In those days the even numbers (2.0.x, 2.2.x, 2.4.x etc) were stable and the uneven ones (2.1.x, 2.3.x etc) were unstable or testing versions. If you install that to a spare partition, usb, or dvd, then you might have the equipment to make up your kernel. The KERNEL that's there might even serve your needs. The tgz packages are tar.gz. You can unzip and untar in your new root directory. Much better to use package tools. But the a1/aaa_base.tgz has all the / directories, so you can install that wherever it can be read. I don't think a /boot directory was common back then. Put the kernel in /.

Whether you can boot slackware-3.5 on a modern pc is another question. SATA was unheard of.

Mr486 02-08-2017 03:38 AM

1 Attachment(s)
Yes tomsrtbt will be helpful in an emergency.....I still have one working boot disk so am ok for the while. I have had a go at debugging the booting of the 2.0.40 kernel and I found the error happens upon reaching the following line in linux/arch/i386/boot/compressed/head.S (attached):

lss SYMBOL_NAME(stack_start),%esp

When execution gets here the system reboots.

business_kid 02-09-2017 04:34 AM

That's Assembler code. It would have to be assembled (i.e. turned into machine code). I've programmed in assembler but not on x86 & I'm not familiar with the lss instruction. The instruction is all variables which are included from (/usr/include)/linux/linkage.h, and/or (/usr/include)/asm/segment.h. I gave you a link for slackware-3.5. How did you get on with that?

Mr486 02-26-2017 03:59 AM

Quote:

Originally Posted by business_kid (Post 5667678)
That's Assembler code. It would have to be assembled (i.e. turned into machine code). I've programmed in assembler but not on x86 & I'm not familiar with the lss instruction. The instruction is all variables which are included from (/usr/include)/linux/linkage.h, and/or (/usr/include)/asm/segment.h. I gave you a link for slackware-3.5. How did you get on with that?

I am just finding a machine to try the slackware 3.5 on. Unfortuantly I threw away my spare Pc a year or so ago. I have been looking at getting a spare partition on my current PC (the one with the SATA) or I was looking to get a 486 or base Pentium to try on.

Jjanel 02-26-2017 06:49 AM

[interesting!] fyi/fwiw idea: have a look at discussion of head.S lss here, p23-24

business_kid 02-27-2017 03:40 AM

Sorry - posted to wrong thread.

Mr486 03-06-2017 03:10 AM

Quote:

Originally Posted by business_kid (Post 5676551)
Sorry - posted to wrong thread.

Hi Business Kid.... I made some progress....I have obtained a COMPAQ 586 (with PCI and ISA slots!)
I used that Slackware 3.5 link you posted.....I installed Linux (although I got a large number of messages during setup about something not being in the index files and the setup not promising install will work) However install appeared to work...

I have compiled a working 2.0.34 kernel.... I just need to test it on my 486 now.


(For the install I made the bare.i and color.gz. I then copied Slackware 3.5 to a CD-ROm, ran setup form the bare.i/color.gz startup and pointed the SOURCE at the CD-Rom)

Mr486 03-06-2017 03:12 AM

Quote:

Originally Posted by Jjanel (Post 5676200)
[interesting!] fyi/fwiw idea: have a look at discussion of head.S lss here, p23-24

Thanks.... I will read through this document....

I think the problem might be a binary format issue. I will start a new thread with some of my endeavours......

On the 486 I tried to build an a.out kernel (by deselecting the ELF options) and got some interesting messages including message about _start not being found (When I was trying the make zImage)

business_kid 03-06-2017 06:28 AM

Not trying to convert you to slackware, but they do isos which are bootable install cds leaving you in console mode. Slackware is a good linux distro, but if I was trying, I'd convert you to other things.To build 2.0, you'll need appropriate gcc, kernel headers, & glibc which form part of the toolchain.

I remember the AMD '586. I got a 486 board, put in a 586, which ran at 133 Mhz and roughly equalled a P75, (P90 more like), and then changed a jumper. The buses ran at 80 Mhz(for 486-dx2-80), and the '586 ran at 160Mhz! No problems at all. That was a board with the famous Via Hardware Fault, although Via tried to blame it on Creative Soundblasters. I also had 2 completely non standard usb ports that broke all rules. Via's solution to that was to disable those 2 usb ports :-/.

I wish you luck on your journey into the entrails of 2.0 kernels. I don't even remember how to set up the interrupts manually. Was there an /etc/interrupts file? It would be good to remind yourself why you're going to all this bother, when an arm based tablet will probably outperform the pc you hope to end up with. Watch yourself with filesystems. Ext2, & ms-dos iirc. Ms-dos was the 16bit version - max hard disk size 512MB. That' with 1024 tracks, 16 heads, & whatever the max sectors/track was. No ext3, reiser, vfat, ntfs, xfs, jfs etc. Usb-1.0 and if you're lucky, an iffy version of usb-2.0

Mr486 03-10-2017 07:06 AM

Hopefully I can produce some coherent and useful information.

I have started this thread to document my activities....I will update over the course of the next week.

With Ubuntu Trusty I got as far as being able to build the 2.0.40 kernel with a 2.7.2.3.

Like you say I found out a lot about depependcies on certain tool chain items being in place. These are all things one can normally take for granted. Its like a many tentacled octopuss.

Quote:

Originally Posted by business_kid (Post 5679730)
Not trying to convert you to .....To build 2.0, you'll need appropriate gcc, kernel headers, & glibc which form part of the toolchain....


Mr486 03-19-2017 08:58 AM

Solution
 
I have found out where trying to make bootable floppies on my 486 was going wrong - when I copy the zImage to the floppy disk! ! ! ! !

All this time I believed it was something wrong with the zImage file itself when it fact the process of writing it to a floppy (on the 486 machine) was causing my problems!!! :doh:

I found if I take the zImage generated on the 486 and write it to a floppy with the other (the Compaq) linux machine then the floppy boot disk gets past the Loading.... and works.... :thumbsup:

So the problem was when I did the cp zImage /dev/fd0

(although that used to work)

On the Compaq linux machine the cp zImage /dev/fd0 does not cause any issues with the boot floppy. :thumbsup:

How about that! I have no idea exactly what goes wrong though.


All times are GMT -5. The time now is 07:55 PM.