* [parisc-linux] A quick update
@ 1999-06-18 7:22 Alex deVries
1999-06-18 7:26 ` Jeffrey A Law
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Alex deVries @ 1999-06-18 7:22 UTC (permalink / raw)
To: parisc-linux
After an enormous amount of frustration (with fault only to me, I should
have thought that there was a second bootpserver on my network), the
kernel tree in CVS actually builds on HPUX. This is really just Jason's
work glued into the kernel tree.
Next:
- we need an HPUX ld linker script to resolve the vmlinux building,
what's the format for this?
- we need to figure out why the bootloader gives an error when loading
the kernel into memory
- Alex
--
Alex deVries
Vice President of Engineering
The Puffin Group
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 7:22 Alex deVries
@ 1999-06-18 7:26 ` Jeffrey A Law
1999-06-18 13:05 ` John David Anglin
1999-06-18 15:51 ` Alex deVries
2 siblings, 0 replies; 13+ messages in thread
From: Jeffrey A Law @ 1999-06-18 7:26 UTC (permalink / raw)
To: Alex deVries; +Cc: parisc-linux
In message <3769F3AD.DF068942@thepuffingroup.com>you write:
> - we need an HPUX ld linker script to resolve the vmlinux building,
> what's the format for this?
No such animal that I'm aware of.
There is some rough ordering control using the space/subspace sort keys, but
you don't get absolute control over where stuff ends up in memory.
In what ways do you need to control the layout of stuff in memory?
jeff
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 7:22 Alex deVries
1999-06-18 7:26 ` Jeffrey A Law
@ 1999-06-18 13:05 ` John David Anglin
1999-06-18 18:29 ` Jeffrey A Law
1999-06-18 15:51 ` Alex deVries
2 siblings, 1 reply; 13+ messages in thread
From: John David Anglin @ 1999-06-18 13:05 UTC (permalink / raw)
To: Alex deVries; +Cc: parisc-linux
You probably want to use the same link options as Jason used for the IPL:
-N -R address.
The address specified should match the location where the kernel is
loaded into the LIF image. The -N places the $DATA$ section after
the $CODE$ section in low memory. The +n option that was being used
in the Makefile has the $DATA$ section in the 0x40000000 quadrant.
This is wrong for the kernel.
After the kernel is built, take a look at where the sections start
in SOM executable. Each section must be copied to its corresponding
starting address in the LIF image. Space must be reserved for the bss
data if there is a section after it that contains necessary data.
Dave
>
>
> After an enormous amount of frustration (with fault only to me, I should
> have thought that there was a second bootpserver on my network), the
> kernel tree in CVS actually builds on HPUX. This is really just Jason's
> work glued into the kernel tree.
>
> Next:
>
> - we need an HPUX ld linker script to resolve the vmlinux building,
> what's the format for this?
>
> - we need to figure out why the bootloader gives an error when loading
> the kernel into memory
>
> - Alex
>
> --
> Alex deVries
> Vice President of Engineering
> The Puffin Group
>
> ---------------------------------------------------------------------------
> To unsubscribe: send e-mail to parisc-linux-request@thepuffingroup.com with
> `unsubscribe' as the subject.
>
>
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
@ 1999-06-18 14:04 Alex deVries
1999-06-18 15:04 ` John David Anglin
1999-06-18 18:34 ` [parisc-linux] A quick update Jeffrey A Law
0 siblings, 2 replies; 13+ messages in thread
From: Alex deVries @ 1999-06-18 14:04 UTC (permalink / raw)
To: parisc-linux
John David Anglin wrote:
> You probably want to use the same link options as Jason used for the IPL:
> -N -R address.
Ah, okay.
> After the kernel is built, take a look at where the sections start
> in SOM executable. Each section must be copied to its corresponding
> starting address in the LIF image. Space must be reserved for the bss
> data if there is a section after it that contains necessary data.
Should I be using objcopy to cut these sections out of my SOM executable
and into the LIF image?
Two other problems I have:
1. The kernel doesn't build yet, it fails to link and dies with:
ld -e stext arch/parisc/kernel/head.o arch/parisc/kernel/init_task.o
init/main.o init/version.o \
arch/parisc/kernel/kernel.o arch/parisc/mm/mm.o kernel/kernel.o
mm/mm.o fs/fs.o ipc/ipc.o \
fs/filesystems.a \
net/network.a \
drivers/block/block.a drivers/char/char.a drivers/net/net.a \
/usr/src/linux/arch/parisc/lib/lib.a /usr/src/linux/lib/lib.a
/usr/src/linux/arch/parisc/lib/lib.a \
-o vmlinux
ld: Unsatisfied symbols:
swapper_pg_dir (data)
_stext (data)
I haven't yet figured out how to solve this.
2. The bootloader within the kernel tries to load the vmlinux into
memory, but dies by returning -6 at the P0_BOOTDEV_iodc_io() call within
bootdev_sread() in rom _interface.c. I should be able to figure out
what's going on here...
- A
--
Alex deVries
Vice President of Engineering
The Puffin Group
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 14:04 [parisc-linux] A quick update Alex deVries
@ 1999-06-18 15:04 ` John David Anglin
1999-06-18 19:16 ` Alex deVries
1999-06-18 18:34 ` [parisc-linux] A quick update Jeffrey A Law
1 sibling, 1 reply; 13+ messages in thread
From: John David Anglin @ 1999-06-18 15:04 UTC (permalink / raw)
To: Alex deVries; +Cc: parisc-linux
>
>
> John David Anglin wrote:
> > You probably want to use the same link options as Jason used for the IPL:
> > -N -R address.
>
> Ah, okay.
>
> > After the kernel is built, take a look at where the sections start
> > in SOM executable. Each section must be copied to its corresponding
> > starting address in the LIF image. Space must be reserved for the bss
> > data if there is a section after it that contains necessary data.
>
> Should I be using objcopy to cut these sections out of my SOM executable
> and into the LIF image?
I don't think so. While I haven't checked all the options of objcopy,
its basic function is to copy object modules from one file to another.
If it understood the LIF format, it might work but I don't think it
does. If I understand the situation, the LIF image gets loaded directly
into memory. Thus, the code that builds the LIF image must simulate
a loader, putting each section into it appropriate location in the image.
You must assure when the kernel and ipl are linked that the relocation
address of each section agrees with where it is placed in the LIF image
so that all symbols are appropriately relocated. IPL doesn't do
anything fancy. It looks like it just loads the kernel after itself
into memory.
After linking, the executable files for the kernel and ipl each have
a header that describe what kind object file they are. The header also has
info about the sections in the executable. Ideally, the program that
builds the LIF image would look at the headers in the ipl and kernel
and build the LIF image. However, you can probably get away with
using a simple program to copy the ipl and kernel files.
You must watch out for the size of the header on each file (file
offset). The linker script for the ELF format kernel set the origin
for .text to 0x8000. The corresponding option for the HP linker
would be "-N -R 8000". When I do this, the file offset to the
start of the $TEXT$ section (the first section in the file) is
0x28000. Thus, you want to copy starting from 0x28000 in vmlinux
to 0x8000 in the LIF image.
The $BSS$ section is not in the executables since it loads as all
zeros. However, since it is the last section in the executables
you simply have to ensure that there is enough space between the
kernel and ipl. You need enough space for the ipl bss data and
its dynamically allocated stack.
> Two other problems I have:
>
> 1. The kernel doesn't build yet, it fails to link and dies with:
>
>
> ld -e stext arch/parisc/kernel/head.o arch/parisc/kernel/init_task.o
> init/main.o init/version.o \
> arch/parisc/kernel/kernel.o arch/parisc/mm/mm.o kernel/kernel.o
> mm/mm.o fs/fs.o ipc/ipc.o \
> fs/filesystems.a \
> net/network.a \
> drivers/block/block.a drivers/char/char.a drivers/net/net.a \
> /usr/src/linux/arch/parisc/lib/lib.a /usr/src/linux/lib/lib.a
> /usr/src/linux/arch/parisc/lib/lib.a \
> -o vmlinux
> ld: Unsatisfied symbols:
> swapper_pg_dir (data)
> _stext (data)
You want to export swapper_pg_dir in head.S. I think in init/main.c,
you should change the declaration for _stext to "extern void _stext ();"
and "&_stext" to "_stext". The linker thinks _stext is a reference
to data rather than text. The other option would be to put the address
label _stext into a an exported word in the data section of head.S.
Main.c could then determine the start of text from this location.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 7:22 Alex deVries
1999-06-18 7:26 ` Jeffrey A Law
1999-06-18 13:05 ` John David Anglin
@ 1999-06-18 15:51 ` Alex deVries
2 siblings, 0 replies; 13+ messages in thread
From: Alex deVries @ 1999-06-18 15:51 UTC (permalink / raw)
To: parisc-linux
Alex deVries wrote:
> Next:
>
> - we need an HPUX ld linker script to resolve the vmlinux building,
> what's the format for this?
Thomas Bogendorfer solved this for us.
>
> - we need to figure out why the bootloader gives an error when loading
> the kernel into memory
It looks like an IPL problem...
- Alex
--
Alex deVries
Vice President of Engineering
The Puffin Group
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
@ 1999-06-18 16:58 Cary Coutant
1999-06-18 17:49 ` John David Anglin
0 siblings, 1 reply; 13+ messages in thread
From: Cary Coutant @ 1999-06-18 16:58 UTC (permalink / raw)
To: John David Anglin, Alex deVries; +Cc: parisc-linux
>The -N places the $DATA$ section after
>the $CODE$ section in low memory. The +n option that was being used
>in the Makefile has the $DATA$ section in the 0x40000000 quadrant.
>This is wrong for the kernel.
The opposite of -N is -n, not +n. The +n option tells the linker to
search archive libraries iteratively, which I believe is needed for the
Linux kernel.
The -N option tells the linker to build a "non-shareable" executable, so
it puts text and data together in one segment. The -n option is the
default, where shareable text is placed in the first quadrant and data is
placed in the second quadrant.
Cary Coutant
Hewlett-Packard Co.
Application Delivery Lab
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 16:58 Cary Coutant
@ 1999-06-18 17:49 ` John David Anglin
0 siblings, 0 replies; 13+ messages in thread
From: John David Anglin @ 1999-06-18 17:49 UTC (permalink / raw)
To: Cary Coutant; +Cc: adevries, parisc-linux
>
> >The -N places the $DATA$ section after
> >the $CODE$ section in low memory. The +n option that was being used
> >in the Makefile has the $DATA$ section in the 0x40000000 quadrant.
> >This is wrong for the kernel.
>
> The opposite of -N is -n, not +n. The +n option tells the linker to
> search archive libraries iteratively, which I believe is needed for the
> Linux kernel.
Thanks for the information on the +n option. My old system doesn't
document +n. However, with the simple configuration that is being
tested, it doesn't seem necessary to link the kernel with +n. Possibly,
+n will be required when more modules are configured in the kernel.
> The -N option tells the linker to build a "non-shareable" executable, so
> it puts text and data together in one segment. The -n option is the
> default, where shareable text is placed in the first quadrant and data is
> placed in the second quadrant.
Based on the code in the IPL that is being used, it looks like -N
is the correct choice. The IPL doesn't try to load kernel data
into the second quadrant as far as I can tell.
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 13:05 ` John David Anglin
@ 1999-06-18 18:29 ` Jeffrey A Law
0 siblings, 0 replies; 13+ messages in thread
From: Jeffrey A Law @ 1999-06-18 18:29 UTC (permalink / raw)
To: John David Anglin; +Cc: Alex deVries, parisc-linux
In message <199906181305.JAA06811@hiauly1.hia.nrc.ca>you write:
> After the kernel is built, take a look at where the sections start
> in SOM executable. Each section must be copied to its corresponding
> starting address in the LIF image. Space must be reserved for the bss
> data if there is a section after it that contains necessary data.
Right. Use the exec header to find a.out-like boundaries for text, data & bss.
Do not try to build up a memory image using the space/subspace stuff. You'll
be bitterly disappointed to find out that the info on the space/subspaces is
not wholly accurate in an executable image.
jeff
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 14:04 [parisc-linux] A quick update Alex deVries
1999-06-18 15:04 ` John David Anglin
@ 1999-06-18 18:34 ` Jeffrey A Law
1 sibling, 0 replies; 13+ messages in thread
From: Jeffrey A Law @ 1999-06-18 18:34 UTC (permalink / raw)
To: Alex deVries; +Cc: parisc-linux
In message <376A51F5.D38ECFFC@thepuffingroup.com>you write:
> Should I be using objcopy to cut these sections out of my SOM executable
> and into the LIF image?
No, I doubt objcopy knows about LIF (I've certainly never bothered to
describe LIF to objcopy/bfd).
Utah's releases had code to do this kind of thing. Or you might be able to use
the lif tools on hpux (ls /usr/bin/lif*).
jeff
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] A quick update
1999-06-18 15:04 ` John David Anglin
@ 1999-06-18 19:16 ` Alex deVries
1999-06-21 17:56 ` [parisc-linux] Problems with createheader.sh script John David Anglin
0 siblings, 1 reply; 13+ messages in thread
From: Alex deVries @ 1999-06-18 19:16 UTC (permalink / raw)
To: John David Anglin; +Cc: parisc-linux
John David Anglin wrote:
>
>
> After linking, the executable files for the kernel and ipl each have
> a header that describe what kind object file they are. The header also has
> info about the sections in the executable. Ideally, the program that
> builds the LIF image would look at the headers in the ipl and kernel
> and build the LIF image. However, you can probably get away with
> using a simple program to copy the ipl and kernel files.
That all exists in the tools in linux/arch/parisc/hp/boot/boot_tools.
>
> You must watch out for the size of the header on each file (file
> offset). The linker script for the ELF format kernel set the origin
> for .text to 0x8000. The corresponding option for the HP linker
> would be "-N -R 8000". When I do this, the file offset to the
> start of the $TEXT$ section (the first section in the file) is
> 0x28000. Thus, you want to copy starting from 0x28000 in vmlinux
> to 0x8000 in the LIF image.
Oh, okay. The linker stuff has all been sorted out (and is in CVS now).
So, here's how you can boot this bootloader:
- on HPUX, install gnu gcc and binutils
- check out the latest kernel tree
- do a 'make config ; make dep ; make vmlinux; make Image'
- boot linux/arch/parisc/hp/boot/Image
It should boot and end with:
Loading kernel...done.
Transferring control to the kernel. (At entry point 0x00008000)
and then hang completely.
The next step is to develop a small mini kernel that we can use to test
the launching. It should just print "Hello world" to the screen using
IODC. There's lots of example code in the bootloader, so this should be
pretty simple.
- Alex "white water rafting this weekend, far away from PA RISC
equipment" deVries
--
Alex deVries
Vice President of Engineering
The Puffin Group
^ permalink raw reply [flat|nested] 13+ messages in thread
* [parisc-linux] Problems with createheader.sh script
1999-06-18 19:16 ` Alex deVries
@ 1999-06-21 17:56 ` John David Anglin
1999-06-21 18:35 ` John David Anglin
0 siblings, 1 reply; 13+ messages in thread
From: John David Anglin @ 1999-06-21 17:56 UTC (permalink / raw)
To: Alex deVries; +Cc: parisc-linux
When creating a LIF image, i get the following errors:
./boot_tools/createheader.sh boot_code/ipl ../../../../vmlinux
./boot_tools/createheader.sh: !: not found
./boot_tools/createheader.sh: !: not found
(standard_in) 1: illegal character: J
(standard_in) 1: parse error
(standard_in) 1: parse error
(standard_in) 1: parse error
(standard_in) 1: illegal character: J
IPL address: 4096 kernel address: 49152
IPL size: 45056 Jun kernel size:
IPL entry: 4096 kernel entry: 32768
Header created.
I think the problem is lies with the cut command. The character
position of file sizes in the 'ls -l' command varies. The hpux
9.01 ls position differs from that of GNU ls. I think it would
be better to use awk to grab the file size info.
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [parisc-linux] Problems with createheader.sh script
1999-06-21 17:56 ` [parisc-linux] Problems with createheader.sh script John David Anglin
@ 1999-06-21 18:35 ` John David Anglin
0 siblings, 0 replies; 13+ messages in thread
From: John David Anglin @ 1999-06-21 18:35 UTC (permalink / raw)
To: John David Anglin; +Cc: adevries, parisc-linux
>
> When creating a LIF image, i get the following errors:
>
> ./boot_tools/createheader.sh boot_code/ipl ../../../../vmlinux
> ./boot_tools/createheader.sh: !: not found
> ./boot_tools/createheader.sh: !: not found
> (standard_in) 1: illegal character: J
> (standard_in) 1: parse error
> (standard_in) 1: parse error
> (standard_in) 1: parse error
> (standard_in) 1: illegal character: J
> IPL address: 4096 kernel address: 49152
> IPL size: 45056 Jun kernel size:
> IPL entry: 4096 kernel entry: 32768
> Header created.
Here is a patch which fixes the above problems. Note--there are still
issues related to the kernel parameters which need to be resolved.
I also recommend stripping the kernel after the map is generated to
reduce the size of the Image.
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
*** createheader.sh.orig Fri Jun 18 09:09:53 1999
--- createheader.sh Mon Jun 21 14:26:19 1999
***************
*** 12,38 ****
if [ $# != 2 ]; then
echo "Usage: createheader.sh ipl vmlinux"
fi
! if ! [ -e ${ipl} ]; then
echo "Cannot open ${ipl}"
exit 1
fi
! if ! [ -e ${vmlinux} ]; then
echo "Cannot open ${vmlinux}"
exit 1
fi
i_addr=4096
! if [ $arch = Linux ] ; then
! i_size=`ls -l ${ipl} |cut -c 36-42`
! k_size_initial=`ls -l ${vmlinux} |cut -c 36-42`
! elif [ $arch = HP-UX ]; then
! i_size=`ls -l ${ipl} |cut -c 36-45`
! k_size_initial=`ls -l ${vmlinux} |cut -c 36-45`
! fi
i_entry=4096
k_addr=49152
--- 12,34 ----
if [ $# != 2 ]; then
echo "Usage: createheader.sh ipl vmlinux"
+ exit 1
fi
! if [ ! -r ${ipl} ]; then
echo "Cannot open ${ipl}"
exit 1
fi
! if [ ! -r ${vmlinux} ]; then
echo "Cannot open ${vmlinux}"
exit 1
fi
i_addr=4096
! i_size=`ls -l ${ipl} |awk '{print $5}'`
! k_size_initial=`ls -l ${vmlinux} |awk '{print $5}'`
i_entry=4096
k_addr=49152
***************
*** 41,47 ****
k_entry=32768
echo "IPL address: ${i_addr}\tkernel address: ${k_addr} "
! echo "IPL size: ${i_size}\tkernel size: ${k_size} "
echo "IPL entry: ${i_entry} \tkernel entry: ${k_entry}"
./boot_tools/mklifhdr hdr ${i_addr} ${i_size} ${i_entry} \
${k_addr} ${k_size} ${k_entry}
--- 37,43 ----
k_entry=32768
echo "IPL address: ${i_addr}\tkernel address: ${k_addr} "
! echo "IPL size: ${i_size}\t\tkernel size: ${k_size} "
echo "IPL entry: ${i_entry} \tkernel entry: ${k_entry}"
./boot_tools/mklifhdr hdr ${i_addr} ${i_size} ${i_entry} \
${k_addr} ${k_size} ${k_entry}
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~1999-06-21 18:35 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-18 14:04 [parisc-linux] A quick update Alex deVries
1999-06-18 15:04 ` John David Anglin
1999-06-18 19:16 ` Alex deVries
1999-06-21 17:56 ` [parisc-linux] Problems with createheader.sh script John David Anglin
1999-06-21 18:35 ` John David Anglin
1999-06-18 18:34 ` [parisc-linux] A quick update Jeffrey A Law
-- strict thread matches above, loose matches on Subject: below --
1999-06-18 16:58 Cary Coutant
1999-06-18 17:49 ` John David Anglin
1999-06-18 7:22 Alex deVries
1999-06-18 7:26 ` Jeffrey A Law
1999-06-18 13:05 ` John David Anglin
1999-06-18 18:29 ` Jeffrey A Law
1999-06-18 15:51 ` Alex deVries
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.