public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS]  Why can't tests be built for pc target?
@ 2008-03-17 19:17 Grant Edwards
  2008-03-17 19:26 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2008-03-17 19:17 UTC (permalink / raw)
  To: ecos-discuss

Does anybody know why you can't build tests for the PC target?

  $ newtree-pc_8139.sh
  + ecosconfig new pc_rltk8139 net
  U CYGBLD_ISO_STRUCTTIMEVAL_HEADER, new inferred value <cyg/posix/sys/time.h>
  U CYGBLD_ISO_FNMATCH_HEADER, new inferred value <cyg/fileio/fnmatch.h>
  + cat .tmp22883.cdl
  cdl_option CYG_HAL_STARTUP {user_value FLOPPY}
  cdl_option CYGPKG_NET_INET6 {user_value 0}
  cdl_option CYGHWR_NET_DRIVER_ETH0_BOOTP {user_value 0}
  cdl_option CYGHWR_NET_DRIVER_ETH0_MANUAL {user_value 1}
  cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_IP {user_value 192.168.8.99}
  cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS {user_value 255.255.255.0}
  cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_BROADCAST {user_value 192.168.8.255}
  cdl_option CYGHWR_NET_DRIVER_ETH0_ADDRS_GATEWAY {user_value 192.168.8.1}
  cdl_option CYGSEM_HAL_DIAG_MANGLER {user_value None}
  cdl_option CYGPKG_NET_BUILD_HW_TESTS {user_value 0}
  + ecosconfig import .tmp22883.cdl
  + rm -f .tmp22883.cdl
  + ecosconfig tree

$ make
  [...]
  make[1]: Leaving directory /home/grante/pcecos/build-ecos/hal/i386/arch/current'
  build finished

The make finishes OK.  But make tests fails anytime it tries to
link a program:

$ make tests
  [...]
  make[1]: Entering directory /home/grante/pcecos/build-ecos/io/pci/current'
  i386-elf-gcc -c  -I/home/grante/pcecos/build-ecos/install/include -I/opt/ecos/ecos/packages/io/pci/current -I/opt/ecos/ecos/packages/io/pci/current/src -I/opt/ecos/ecos/packages/io/pci/current/tests -I. -I/opt/ecos/ecos/packages/io/pci/current/tests/ -finline-limit=7000 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef  -g -O2 -ffunction-sections -fdata-sections  -fno-exceptions   -Wp,-MD,tests/pci1.tmp -o tests/pci1.o /opt/ecos/ecos/packages/io/pci/current/tests/pci1.c
  i386-elf-gcc -L/home/grante/pcecos/build-ecos/install/lib -Ttarget.ld -o /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 tests/pci1.o -g -nostdlib -Wl,--gc-sections -Wl,-static 
  /opt/ecos/gnutools/i386-elf/bin/../lib/gcc-lib/i386-elf/3.2.1/../../../../i386-elf/bin/ld: address 0xbca38 of /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 section .bss is not within region ram
  /opt/ecos/gnutools/i386-elf/bin/../lib/gcc-lib/i386-elf/3.2.1/../../../../i386-elf/bin/ld: address 0xbca38 of /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 section .bss is not within region ram
  collect2: ld returned 1 exit status
  make[1]: *** [/home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1] Error 1
  make[1]: Leaving directory /home/grante/pcecos/build-ecos/io/pci/current'
  make: *** [tests] Error 2

I deleted the pci tests target, but all of the other test apps
fail with a similar error.  

I'm using the i386 toolchain that were installed by
ecos-install.tcl when I ran in two days ago (15 March 08), and
a CVS snapshot that was current as of 15 March 08.

Why can't one build test programs for the pc target?

-- 
Grant



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS]  Why can't tests be built for pc target?
  2008-03-17 19:17 [ECOS] Why can't tests be built for pc target? Grant Edwards
@ 2008-03-17 19:26 ` Andrew Lunn
  2008-03-17 19:35   ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2008-03-17 19:26 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss

On Mon, Mar 17, 2008 at 06:59:23PM +0000, Grant Edwards wrote:
> Does anybody know why you can't build tests for the PC target?
> 
>   $ newtree-pc_8139.sh
>   + ecosconfig new pc_rltk8139 net
>   U CYGBLD_ISO_STRUCTTIMEVAL_HEADER, new inferred value <cyg/posix/sys/time.h>
>   U CYGBLD_ISO_FNMATCH_HEADER, new inferred value <cyg/fileio/fnmatch.h>
>   + cat .tmp22883.cdl
>   cdl_option CYG_HAL_STARTUP {user_value FLOPPY}

/packages/hal/i386/pc/current/include/pkgconf$ less mlt_i386_pc_floppy.ldi 
// eCos memory layout - Fri Oct 20 08:16:03 2000

// This is a generated file - do not edit

#include <cyg/infra/cyg_type.inc>

MEMORY
{
    ram : ORIGIN = 0, LENGTH = 0xa0000
}


>   i386-elf-gcc -L/home/grante/pcecos/build-ecos/install/lib -Ttarget.ld -o /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 tests/pci1.o -g -nostdlib -Wl,--gc-sections -Wl,-static 
>   /opt/ecos/gnutools/i386-elf/bin/../lib/gcc-lib/i386-elf/3.2.1/../../../../i386-elf/bin/ld: address 0xbca38 of /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 section .bss is not within region ram

You are out of memory. You have hit the Bill Gates limit. 

Use a different startup model, eg grub startup is currently setup to
allow 16Mbyes of RAM.

      Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS]  Re: Why can't tests be built for pc target?
  2008-03-17 19:26 ` Andrew Lunn
@ 2008-03-17 19:35   ` Grant Edwards
  2008-03-17 19:45     ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2008-03-17 19:35 UTC (permalink / raw)
  To: ecos-discuss

On 2008-03-17, Andrew Lunn <andrew@lunn.ch> wrote:
> On Mon, Mar 17, 2008 at 06:59:23PM +0000, Grant Edwards wrote:
>> Does anybody know why you can't build tests for the PC target?
>> 
>>   $ newtree-pc_8139.sh
>>   + ecosconfig new pc_rltk8139 net
>>   U CYGBLD_ISO_STRUCTTIMEVAL_HEADER, new inferred value <cyg/posix/sys/time.h>
>>   U CYGBLD_ISO_FNMATCH_HEADER, new inferred value <cyg/fileio/fnmatch.h>
>>   + cat .tmp22883.cdl
>>   cdl_option CYG_HAL_STARTUP {user_value FLOPPY}
>
> /packages/hal/i386/pc/current/include/pkgconf$ less mlt_i386_pc_floppy.ldi 
> // eCos memory layout - Fri Oct 20 08:16:03 2000
>
> // This is a generated file - do not edit
>
> #include <cyg/infra/cyg_type.inc>
>
> MEMORY
> {
>     ram : ORIGIN = 0, LENGTH = 0xa0000
> }
>
>
>>   i386-elf-gcc -L/home/grante/pcecos/build-ecos/install/lib -Ttarget.ld -o /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 tests/pci1.o -g -nostdlib -Wl,--gc-sections -Wl,-static 
>>   /opt/ecos/gnutools/i386-elf/bin/../lib/gcc-lib/i386-elf/3.2.1/../../../../i386-elf/bin/ld: address 0xbca38 of /home/grante/pcecos/build-ecos/install/tests/io/pci/current/tests/pci1 section .bss is not within region ram
>
> You are out of memory. You have hit the Bill Gates limit. 

Thanks.  It didn't even occur to me that there was a 640K
limit. I figured as long as it fit on a floppy it'd be OK.

> Use a different startup model, eg grub startup is currently
> setup to allow 16Mbyes of RAM.

I'll check that out.  I guess I'll have to add a hard drive to
the target.

In the meantime, I can't even get a simple "hello world" app
(which is smaller than 640K) to generate any output.  The
RedBoot floppy image generated with basically the same
configuration works fine, but hello world doesn't. :/

-- 
Grant



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS]  Re: Why can't tests be built for pc target?
  2008-03-17 19:35   ` [ECOS] " Grant Edwards
@ 2008-03-17 19:45     ` Andrew Lunn
  2008-03-17 20:49       ` Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2008-03-17 19:45 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss

> I'll check that out.  I guess I'll have to add a hard drive to
> the target.

Might be worth checking the grub documentation. It might be able to
load from the floppy.

> In the meantime, I can't even get a simple "hello world" app
> (which is smaller than 640K) to generate any output.  The
> RedBoot floppy image generated with basically the same
> configuration works fine, but hello world doesn't. :/

RedBoot will use all available consoles, ie com1, com2, and the screen
if you have it enabled. diag_printf will just the use the first. So it
could be you are looking at the wrong serial port.

Play with CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT and
CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL.

      Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS]  Re: Why can't tests be built for pc target?
  2008-03-17 19:45     ` Andrew Lunn
@ 2008-03-17 20:49       ` Grant Edwards
  2008-03-18  7:54         ` Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2008-03-17 20:49 UTC (permalink / raw)
  To: ecos-discuss

On 2008-03-17, Andrew Lunn <andrew@lunn.ch> wrote:

>> I'll check that out.  I guess I'll have to add a hard drive to
>> the target.
>
> Might be worth checking the grub documentation. It might be
> able to load from the floppy.

It can, but if I'm going to have to generate a disk image,
generating a hard-drive one is just as easy as generating a
floppy one, and then I don't have the 1.44MB limit either.  I'm
running stuff on a virtual machine using Qemu and being able to
point it at the bootable floppy images generated by the eCos
"make" was awfully handy.  I'll write a shell-script to
generate a bootable hard-drive image with grub and the
application on it.

>> In the meantime, I can't even get a simple "hello world" app
>> (which is smaller than 640K) to generate any output.  The
>> RedBoot floppy image generated with basically the same
>> configuration works fine, but hello world doesn't. :/
>
> RedBoot will use all available consoles, ie com1, com2, and
> the screen if you have it enabled. diag_printf will just the
> use the first. So it could be you are looking at the wrong
> serial port.

Yup, that was it.  I was just looking at the "vga screen". When
I "hooked up" the first serial port, then I saw the output from
[diag_]printf().  I thought that I was running with Qemu
connecting the first serial port to the vga-screen and
keyboard, but that was a misunderstanding on my part.

I think Qemu is going to be a pretty slick way to test stuff...

-- 
Grant



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS]  Re: Why can't tests be built for pc target?
  2008-03-17 20:49       ` Grant Edwards
@ 2008-03-18  7:54         ` Grant Edwards
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2008-03-18  7:54 UTC (permalink / raw)
  To: ecos-discuss

On 2008-03-17, Grant Edwards <grante@visi.com> wrote:

>> Might be worth checking the grub documentation. It might be
>> able to load from the floppy.
>
> It can, but if I'm going to have to generate a disk image,
> generating a hard-drive one is just as easy as generating a
> floppy one, and then I don't have the 1.44MB limit either.
> I'm running stuff on a virtual machine using Qemu and being
> able to point it at the bootable floppy images generated by
> the eCos "make" was awfully handy.  I'll write a shell-script
> to generate a bootable hard-drive image with grub and the
> application on it.

It looks like making a bootable CD image is the simplest
solution since it can be done entirely with user-space
utilities that don't require any special privledges.

In case anybody else is interested, here's my Makefile

------------------------------Makefile------------------------------
ECOS=../build-ecos/install

hello.elf: hello.c $(ECOS)/lib/target.ld $(ECOS)/lib/libtarget.a
	i386-elf-gcc -g -I$(ECOS)/include hello.c -L$(ECOS)/lib \
                     -Ttarget.ld -nostdlib -o hello.elf

grub.iso: hello.elf iso/boot/grub/menu.lst
	cp hello.elf iso
	strip iso/hello.elf
	mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
                -boot-load-size 4 -boot-info-table -o grub.iso iso

qemu: grub.iso
	(sleep 1; \
	aterm -title "eCos Serial 0" -name "eCos Serial 0" \
             -e telnet localhost 9876)&
	qemu -boot cdrom -cdrom grub.iso -net nic,model=rtl8139 \
             -nographic -serial telnet:localhost:9876,server
--------------------------------------------------------------------

The "grub.iso" target builds an el-torito bootable ISO9660
image.  The "iso" directory needs to start out looking like
this:

  $ tree iso
  iso
  `-- boot
      `-- grub
          |-- menu.lst
          `-- stage2_eltorito
  
  2 directories, 2 files
  
stage2_eltorito comes from wherever grub puts it's library
files (assuming you've already got grub installed somewhere).

My menu.lst file looks like this:

------------------------------menu.lst------------------------------
serial --unit=0 --speed=115200
terminal --timeout=2 serial console

default 0
timeout 1

title  /hello.elf
kernel /hello.elf
--------------------------------------------------------------------

The second build rule for the "qemu" target starts qemu with no
graphics card support (just to eliminate a useless window that
clutters up the destkop).  The lack of a graphics card in the
virtual target machine is why we configured grub to do serial
console in menu.lst above.  Qemu's -serial option as shown
connects the first virtual 16550 serial port to a telnet server
on port 9876 -- to which the first build rule in the "qemu"
target connects after waiting for 1 second.

The net result is that you can edit hello.c and then just do
"make qemu" to build the program, generate the bootable ISO
image, and run it inside Qemu.

-- 
Grant



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-17 20:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-17 19:17 [ECOS] Why can't tests be built for pc target? Grant Edwards
2008-03-17 19:26 ` Andrew Lunn
2008-03-17 19:35   ` [ECOS] " Grant Edwards
2008-03-17 19:45     ` Andrew Lunn
2008-03-17 20:49       ` Grant Edwards
2008-03-18  7:54         ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).