Skip to contentSkip to conversation

Still having a problem building elks kernel

DISCUSSION Dieter R Kedrowitsch 3 participants 10 messages Mar 5, 2010 – Mar 10, 2010

lore
Share & tools
lore
#0 lore raw

With the help of a few folks on here I've gotten pretty far with building the elks kernel, but it looks like I have one more problem before the image will build. It seems there is a syntax error in the makefile ld86.

Has anyone else run into this?

make[2]: Leaving directory `/usr/src/elks/arch/i86/drivers/block'
(cd ../.. ; ld86 -0 -i \
arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a
fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \
-t -M -o arch/i86/boot/system > System.tmp ; \
sort -k4 System.tmp > System.map ; rm -f System.tmp )
usage: ld86 [-03NMdimrstz[-]] [-llib_extension] [-o outfile] [-Ccrtfile]
[-Llibdir] [-Olibfile] [-Ttextaddr] [-Ddataaddr] [-Hheapsize]
infile...
tools/build boot/bootsect boot/setup boot/system > boot/Image
Root device is (3, -128)
Non-Minix header of 'boot'
make[1]: *** [Image] Error 1

#1 lore raw
Quoted 5 lines · Dieter R Kedrowitsch

With the help of a few folks on here I've gotten pretty far with building the elks kernel, but it looks like I have one more problem before the image will build.  It seems there is a syntax error in the makefile ld86. Has anyone else run into this?

Quoted 15 lines

make[2]: Leaving directory `/usr/src/elks/arch/i86/drivers/block' (cd ../.. ; ld86 -0 -i   \
      arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
      init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a  arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \
      -t -M -o arch/i86/boot/system > System.tmp ; \
      sort -k4 System.tmp > System.map ; rm -f System.tmp )
usage: ld86 [-03NMdimrstz[-]] [-llib_extension] [-o outfile] [-Ccrtfile] [-Llibdir] [-Olibfile] [-Ttextaddr] [-Ddataaddr] [-Hheapsize] infile... tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Non-Minix header of 'boot'
make[1]: *** [Image] Error 1

Sorry, I meant to get back to you sooner. I run into the exact same thing with Debian, but not Arch Linux.
Here's the last little bit from Make on Arch which seems to work (I don't have the means to actually test it though)

as86 -0 -o boot/crt0.o boot/crt0.s

(cd ../.. ; ld86 -0 -i   \
                -t -M -o arch/i86/boot/system \
                arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
                init/main.o kernel/kernel.a fs/fs.a lib/lib.a

net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \
> System.tmp ; \
sort -k4 System.tmp > System.map ; rm -f System.tmp )
tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Boot sector 512 bytes.
Setup is 1596 bytes.
System is 117788 B (58784 B code, 7728 B data and 51276 B bss) System is 66544
make[2]: Leaving directory `/home/harley/Source/elks-project/elks/arch/i86'

Obviously the ld86 is failing in Debian/Ubuntu, but like I said, I haven't looked into why yet other then the fact that it looks like "-t -M -o arch/i86/boot/system \" isn't in the Debian/Ubuntu's ld86's command for some reason...
--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 47 lines · Harley Laue
Quoted 5 lines · Dieter R Kedrowitsch

With the help of a few folks on here I've gotten pretty far with building the elks kernel, but it looks like I have one more problem before the image will build.  It seems there is a syntax error in the makefile ld86. Has anyone else run into this?

Quoted 15 lines

make[2]: Leaving directory `/usr/src/elks/arch/i86/drivers/block' (cd ../.. ; ld86 -0 -i   \
      arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
      init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a  arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \
      -t -M -o arch/i86/boot/system > System.tmp ; \
      sort -k4 System.tmp > System.map ; rm -f System.tmp )
usage: ld86 [-03NMdimrstz[-]] [-llib_extension] [-o outfile] [-Ccrtfile] [-Llibdir] [-Olibfile] [-Ttextaddr] [-Ddataaddr] [-Hheapsize] infile... tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Non-Minix header of 'boot'
make[1]: *** [Image] Error 1

Sorry, I meant to get back to you sooner. I run into the exact same thing with Debian, but not Arch Linux.
Here's the last little bit from Make on Arch which seems to work (I don't have the means to actually test it though)

as86 -0  -o boot/crt0.o boot/crt0.s
(cd ../.. ; ld86 -0 -i   \
               -t -M -o arch/i86/boot/system \
               arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
               init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a  arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \
               > System.tmp ; \
               sort -k4 System.tmp > System.map ; rm -f System.tmp ) tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Boot sector 512 bytes.
Setup is 1596 bytes.
System is 117788 B (58784 B code, 7728 B data and 51276 B bss) System is 66544
make[2]: Leaving directory `/home/harley/Source/elks-project/elks/arch/i86'

Quoted 4 lines

Obviously the ld86 is failing in Debian/Ubuntu, but like I said, I haven't looked into why yet other then the fact that it looks like "-t -M -o arch/i86/boot/system \" isn't in the Debian/Ubuntu's ld86's command for some reason...

Well, I was partially wrong. It looks like it does have the same ld86 command, but the Debian/Ubuntu one is returning an empty boot/Image file whereas on Arch it's returning a 68K file. But that's without looking too far into it....
--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Harley Laue

I just created a new VM and installed Arch Linux last night. I'll try installing the bcc x86 packages this evening and cross my fingers that this distro does the trick. I wonder what the difference is?

Quoted 24 lines · Harley Laue

Sorry, I meant to get back to you sooner. I run into the exact same thing with Debian, but not Arch Linux.
Here's the last little bit from Make on Arch which seems to work (I don't have the means to actually test it though)

as86 -0  -o boot/crt0.o boot/crt0.s
(cd ../.. ; ld86 -0 -i   \
               -t -M -o arch/i86/boot/system \
               arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
               init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a  arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \
               > System.tmp ; \
               sort -k4 System.tmp > System.map ; rm -f System.tmp ) tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Boot sector 512 bytes.
Setup is 1596 bytes.
System is 117788 B (58784 B code, 7728 B data and 51276 B bss) System is 66544
make[2]: Leaving directory `/home/harley/Source/elks-project/elks/arch/i86'

Quoted 4 lines

Obviously the ld86 is failing in Debian/Ubuntu, but like I said, I haven't looked into why yet other then the fact that it looks like "-t -M -o arch/i86/boot/system \" isn't in the Debian/Ubuntu's ld86's command for some reason...

--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

For what it is worth, it builds OK under Gentoo Linux. The only problem is that the output is somewhat broken :-(

ELKS Boot........:
Console:
BIOS(0000000000000000000000000000015x0000000000000000000000000000025)
PC/ XT class machine, 80188
CPU
0000000000000000000000000000640K base RAM.
ELKS kernel (-0000000000000000000000000014560 text + 0000000000000000000000000007044 data + -0000000000000000000 000000016516 bss)
Kernel text at 0000000000000000000000000001002:0000, data at 0000000000000000000000000001c74:0000 0000000000000000000000000000471 K of memory for user processes. Serial driver version 0.02 ttyS0000000000000000000000000000000 at 0x00000000000000000000000000003f8 (irq = 0000000000000000000000000000004)
is a 16450
ttyS0000000000000000000000000000001 at 0x00000000000000000000000000002f8 (irq = 0000000000000000000000000000003)
is a 16450
rd driver Copyright (C) 1997 Alistair Riddoch
hd Driver Copyright (C) 1994 Yggdrasil Computing, Inc. Extended and modified for Linux 8086 by Alan Cox.
doshd: found 0000000000000000000000000000000 floppy drive
s
ELKS version 0.1.3-pre1
Release not defined
VFS: Insert root floppy and press ENTER

If anybody has seen this bug or can send me an 80(1)86 build floppy image using BIOS calls I would very much appreciate it.

Hans
www.ht-lab.com

----- Original Message ----- From: "Dieter Kedrowitsch" <[email protected]>
To: <[email protected]>
Sent: Monday, March 08, 2010 4:17 PM
Subject: Re: Still having a problem building elks kernel

I just created a new VM and installed Arch Linux last night. I'll try installing the bcc x86 packages this evening and cross my fingers that this distro does the trick. I wonder what the difference is?

Quoted 24 lines · Harley Laue

Sorry, I meant to get back to you sooner. I run into the exact same thing with Debian, but not Arch Linux.
Here's the last little bit from Make on Arch which seems to work (I don't have the means to actually test it though)

as86 -0 -o boot/crt0.o boot/crt0.s
(cd ../.. ; ld86 -0 -i \
-t -M -o arch/i86/boot/system \
arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
init/main.o kernel/kernel.a fs/fs.a lib/lib.a
net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \

Quoted 1 line

System.tmp ; \

sort -k4 System.tmp > System.map ; rm -f System.tmp ) tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Boot sector 512 bytes.
Setup is 1596 bytes.
System is 117788 B (58784 B code, 7728 B data and 51276 B bss) System is 66544
make[2]: Leaving directory `/home/harley/Source/elks-project/elks/arch/i86'

Quoted 4 lines

Obviously the ld86 is failing in Debian/Ubuntu, but like I said, I haven't looked into why yet other then the fact that it looks like "-t -M -o arch/i86/boot/system \" isn't in the Debian/Ubuntu's ld86's command for some reason...

--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Re: Still having a problem building elks kernel (nospam: message 15 of 20)

Looks like I'm having the same problem here. I tested the build I made in Ubuntu 9.10 i386, on a VMware Workstation 7 virtual host and my output looks VERY similar. See attached screenshot...

I'll test this tonight on my 10MHz XT clone and see if it behaves better on an actual PC.

Ideas, comments?

Quoted 37 lines · Hans

For what it is worth, it builds OK under Gentoo Linux. The only problem is that the output is somewhat broken :-(

ELKS Boot........:
Console:
BIOS(0000000000000000000000000000015x0000000000000000000000000000025) PC/                                               XT class machine, 80188 CPU
0000000000000000000000000000640K base RAM.
ELKS kernel (-0000000000000000000000000014560 text + 0000000000000000000000000007044 data + -0000000000000000000 000000016516 bss)
Kernel text at 0000000000000000000000000001002:0000, data at 0000000000000000000000000001c74:0000 0000000000000000000000000000471 K of memory for user processes. Serial driver version 0.02 ttyS0000000000000000000000000000000 at 0x00000000000000000000000000003f8 (irq = 0000000000000000000000000000004)
is a 16450
ttyS0000000000000000000000000000001 at 0x00000000000000000000000000002f8 (irq = 0000000000000000000000000000003)
is a 16450
rd driver Copyright (C) 1997 Alistair Riddoch
hd Driver Copyright (C) 1994 Yggdrasil Computing, Inc. Extended and modified for Linux 8086 by Alan Cox.
doshd: found 0000000000000000000000000000000 floppy drive
s
ELKS version 0.1.3-pre1
Release not defined
VFS: Insert root floppy and press ENTER

If anybody has seen this bug or can send me an 80(1)86 build floppy image using BIOS calls I would very much appreciate it.

Hans
www.ht-lab.com

#6 lore raw

Re: Still having a problem building elks kernel (nospam: message 15 of 20)

From what I remembered you only seem to get this bug if you select BIOS for the console which is what I require since I have no video support,

Good luck,

Hans
www.ht-lab.com

----- Original Message ----- From: "Dieter Kedrowitsch" <[email protected]>
To: "Hans" <[email protected]>
Cc: <[email protected]>
Sent: Tuesday, March 09, 2010 5:54 PM
Subject: Re: Still having a problem building elks kernel (nospam: message 15 of 20)

Looks like I'm having the same problem here. I tested the build I made in Ubuntu 9.10 i386, on a VMware Workstation 7 virtual host and my output looks VERY similar. See attached screenshot...

I'll test this tonight on my 10MHz XT clone and see if it behaves better on an actual PC.

Ideas, comments?

Quoted 37 lines · Hans

For what it is worth, it builds OK under Gentoo Linux. The only problem is that the output is somewhat broken :-(

ELKS Boot........:
Console:
BIOS(0000000000000000000000000000015x0000000000000000000000000000025) PC/ XT class machine, 80188
CPU
0000000000000000000000000000640K base RAM.
ELKS kernel (-0000000000000000000000000014560 text + 0000000000000000000000000007044 data + -0000000000000000000 000000016516 bss)
Kernel text at 0000000000000000000000000001002:0000, data at 0000000000000000000000000001c74:0000 0000000000000000000000000000471 K of memory for user processes. Serial driver version 0.02 ttyS0000000000000000000000000000000 at 0x00000000000000000000000000003f8 (irq = 0000000000000000000000000000004)
is a 16450
ttyS0000000000000000000000000000001 at 0x00000000000000000000000000002f8 (irq = 0000000000000000000000000000003)
is a 16450
rd driver Copyright (C) 1997 Alistair Riddoch
hd Driver Copyright (C) 1994 Yggdrasil Computing, Inc. Extended and modified for Linux 8086 by Alan Cox.
doshd: found 0000000000000000000000000000000 floppy drive
s
ELKS version 0.1.3-pre1
Release not defined
VFS: Insert root floppy and press ENTER

If anybody has seen this bug or can send me an 80(1)86 build floppy image using BIOS calls I would very much appreciate it.

Hans
www.ht-lab.com

#7 lore raw
In reply to Dieter Kedrowitsch
Quoted 3 lines

I just created a new VM and installed Arch Linux last night. I'll try installing the bcc x86 packages this evening and cross my fingers that this distro does the trick. I wonder what the difference is?

Oh, I think I know what the issue may be. I just tested building Elks in a 32 bit Ubuntu chroot (much quicker then a VM.) It seems something that there are assumptions that the environment is 32 bit. I'd guess it's probably ./arch/i86/tools/build.c that's making assumptions someplace it shouldn't about the size of int, char, long, etc. For now I guess setup a 32 bit system (VM or chroot should both work fine), or if you're feeling ambitious, you can try tackling the issue in that's probably in the file I mentioned.

#8 lore raw

Ah-ha! That would make sense! I believe I have the 32 bit ISO for the latest Ubuntu, I'll give that a shot!

Quoted 7 lines · Harley Laue

Oh, I think I know what the issue may be. I just tested building Elks in a 32 bit Ubuntu chroot (much quicker then a VM.) It seems something that there are assumptions that the environment is 32 bit. I'd guess it's probably ./arch/i86/tools/build.c that's making assumptions someplace it shouldn't about the size of int, char, long, etc. For now I guess setup a 32 bit system (VM or chroot should both work fine), or if you're feeling ambitious, you can try tackling the issue in that's probably in the file I mentioned.

#9 lore raw

Re: Still having a problem building elks kernel (nospam: message 16 of 20)

In reply to Harley Laue

Ok!

By using Ubuntu 9.10 i386 and applying the following changes to a fresh download of the elks-0.1.3.tar.gz before doing make config, make dep, make Image:

edit /arch/i86/boot/setup.S line 588 remove () from around CONFIG_CPU_80386 edit /arch/i86/drivers/char/Keymaps/mkcfg change "sort +1f" to "sort -f"

I was able to get 95% there. It still errors out during linking of the image.

as86 -0 -o boot/crt0.o boot/crt0.s

(cd ../.. ; ld86 -0 -i   \
		arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
		init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a
fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a
arch/i86/mm/mm.a  arch/i86/drivers/char/chr_drv.a
arch/i86/drivers/block/blk_drv.a \
		-t -M -o arch/i86/boot/system > System.tmp ; \
		sort -k4 System.tmp > System.map ; rm -f System.tmp )
usage: ld86 [-03NMdimrstz[-]] [-llib_extension] [-o outfile] [-Ccrtfile]
       [-Llibdir] [-Olibfile] [-Ttextaddr] [-Ddataaddr] [-Hheapsize] infile...

tools/build boot/bootsect boot/setup boot/system > boot/Image Root device is (3, -128)
Boot sector 512 bytes.
Setup is 1764 bytes.
Unable to open 'system'
make[1]: *** [Image] Error 1

However, by manually linking using the sample from Harley...

cd ../.. ; ld86 -0 -i \
-t -M -o arch/i86/boot/system \
arch/i86/boot/crt0.o arch/i86/boot/crt1.o \
init/main.o kernel/kernel.a fs/fs.a lib/lib.a net/net.a fs/minix/minixfs.a arch/i86/kernel/akernel.a arch/i86/lib/lib86.a arch/i86/mm/mm.a arch/i86/drivers/char/chr_drv.a arch/i86/drivers/block/blk_drv.a \

Quoted 1 line

System.tmp ; \

sort -k4 System.tmp > System.map ; rm -f System.tmp

...then allowing make Image to finish, I was successful!

So, why does make Image try to link differently then Harley's example?
Does Arch vs Ubuntu really have anything to do with it?