Subject: Re: bios and elf

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Tue, 27 Apr 1999 12:34:56 +0100 (BST)

Benjamin Herrenschmidt writes:
> So basically, for the bios to work in elf, (after fixing all the compile
> and link problems, mostly due to missing includes and too many "_" in
> some names like string.S stuffs), I made the following .lds file :

Ok, thanks for the info.  There is now bios-1.01 on the FTP site, which
has some of this stuff incorporated.  However, mkaif does not recognise
ELF files yet.

I wonder actually if objcopy can be used instead...
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Tue, 27 Apr 1999 13:18:41 +0100

>I dont have GLIBC, and u32 doesn't exists:
>
>#ifdef __GLIBC__
>typedef unsigned int u32;
>#endif
>
>
>bash# CROSS_COMPILE=arm-linux- make

What C library are you using if it's not glibc?

p.

---

From: Philip Blundell <[email-masked]>
Date: Tue, 27 Apr 1999 14:02:14 +0100

>libc.so.5.4.46

Sorry, I was confused by the CROSS_COMPILE line in the commands you posted.  
I'd got the idea that you were building for an ARM host.  Oops.

p.

---

From: christophe leroy <[email-masked]>
Date: Tue, 27 Apr 1999 13:49:23 +0000

#ifdef __GLIBC__

bash# CROSS_COMPILE=arm-linux- make
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkaif
scripts/mkaif.c
scripts/mkaif.c:13: parse error before `u32'
scripts/mkaif.c:13: warning: no semicolon at end of struct or union
scripts/mkaif.c:14: warning: type defaults to `int' in declaration of
`a_text'
scripts/mkaif.c:14: warning: data definition has no type or storage class
scripts/mkaif.c:15: parse error before `a_data'
scripts/mkaif.c:15: warning: type defaults to `int' in declaration of
`a_data'
scripts/mkaif.c:15: warning: data definition has no type or storage class
scripts/mkaif.c:16: parse error before `a_bss'
scripts/mkaif.c:16: warning: type defaults to `int' in declaration of `a_bss'

scripts/mkaif.c:16: warning: data definition has no type or storage class
scripts/mkaif.c:17: parse error before `a_syms'
scripts/mkaif.c:17: warning: type defaults to `int' in declaration of
`a_syms'
scripts/mkaif.c:17: warning: data definition has no type or storage class
scripts/mkaif.c:18: parse error before `a_entry'
scripts/mkaif.c:18: warning: type defaults to `int' in declaration of
`a_entry'
scripts/mkaif.c:18: warning: data definition has no type or storage class
scripts/mkaif.c:19: parse error before `a_trsize'
scripts/mkaif.c:19: warning: type defaults to `int' in declaration of
`a_trsize'
scripts/mkaif.c:19: warning: data definition has no type or storage class
scripts/mkaif.c:20: parse error before `a_drsize'
scripts/mkaif.c:20: warning: type defaults to `int' in declaration of
`a_drsize'
scripts/mkaif.c:20: warning: data definition has no type or storage class
scripts/mkaif.c:35: parse error before `u32'
scripts/mkaif.c:35: warning: no semicolon at end of struct or union
scripts/mkaif.c:36: warning: type defaults to `int' in declaration of
`reloc_code'
scripts/mkaif.c:36: warning: data definition has no type or storage class
scripts/mkaif.c:37: parse error before `init_code'
scripts/mkaif.c:37: warning: type defaults to `int' in declaration of
`init_code'
scripts/mkaif.c:37: warning: data definition has no type or storage class
scripts/mkaif.c:38: parse error before `entry_code'

and so on....

---

From: christophe leroy <[email-masked]>
Date: Tue, 27 Apr 1999 14:27:43 +0000

libc.so.5.4.46

christophe

---

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 27 Apr 1999 16:36:53 +0100

>has some of this stuff incorporated.  However, mkaif does not recognise

Enclosed is a first test version of an elf mkaif.c. Note that for it to
work with my ESBA card, the text address must be set to xxxxxxC0 and not
xxxxxxA0. (Different Angel version ?). It should work on big-endian
machines (actually, I only tested it on a linux-pmac installation, a good
Mac is a Mac running linux ;-).

I had to do more fixes here or there, I'll compare with your version and
send you the patches. The asm crt0.S works but seems to detect the wrong
amount of memory. The C code still crashes, apparently when calling
set_msg thru the display_fn variable (I commented out all the PCI and VGA
stuffs for now until I'm sure the C code works via the serial port).
Directly calling set_msg works. Since I'm learning all those tools and
the ARM ABI at the same time as debugging, I'm a little bit slow fixing
the various issues.

-- 
           E-Mail: <mailto:[email-masked]>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>