From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10055 invoked by alias); 17 Oct 2007 07:41:30 -0000 Received: (qmail 10039 invoked by uid 22791); 17 Oct 2007 07:41:27 -0000 X-Spam-Check-By: sourceware.org Received: from pop132.ocn.ne.jp (HELO pop132.ocn.ne.jp) (60.37.31.215) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 17 Oct 2007 07:41:24 +0000 Received: from ariga (p1143-ipbf2202marunouchi.tokyo.ocn.ne.jp [122.17.131.143]) by pop132.ocn.ne.jp (OCN) with SMTP id l9H7fKuG019723; Wed, 17 Oct 2007 16:41:20 +0900 (JST) Message-ID: <001301c81091$1d11b060$1c0110ac@ariga> From: "ariga masahiro" To: "Gary Thomas" Cc: References: <000501c7f691$4847e2f0$1c0110ac@ariga> <20070914082224.GA16840@lunn.ch> <000501c80eef$edf10f30$1c0110ac@ariga> <47134CDD.1080604@mlbassoc.com> <004301c80fa1$3dcb15d0$1c0110ac@ariga> <47149BA6.1080500@mlbassoc.com> Date: Wed, 17 Oct 2007 07:41:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] What functions should I call in ethernet drv ? X-SW-Source: 2007-10/txt/msg00093.txt.bz2 Hello Gary and others, Sorry I missed 10/16/2007 20:08 mail, I will prepare tar file and send you soon. Before that, Some points became cleared and also arose other question and I rely on your suggestion. I think the trouble is not my amendment or coding,rather how I 'use' eCos application. Let me explain. I debugged on the next premise. [premise] There are no assingments to function pointers(e.g.ng_ether_attach_p,ng_ether_input_p) in coding, so their inside values(=function addresses) are settled at the time of loading binary into RAM. They are initially defined in \packages\net\bsd_tcpip\current\include\sys\param.h like next #define ng_ether_attach_p cyg_ng_ether_attach_p . On the above premise I decided to check on sampled Hitachi SE77x9 Template that I used as protocol to develop my target template. Source is CVS current version ,so it must work correctly. I just only amended memory layout as same as my target template. I built 'RAM' Start Mode and linked to nc_test_slave test. I loaded elf file on RAM using ICE,and dumped memory addresses. Result was just as same as my template. --from memory map COMMON 0x000000008c0c0208 0x18 /ecos-c/cygwin/home/LINK/ecoscvs_se-net-SE7709-2/untitled_install/lib/libtarget.a(net_bsd_tcpip_if_ethersubr.o) 0x0 (size before relaxing) 0x000000008c0c0208 _cyg_ng_ether_input_p 0x000000008c0c020c _cyg_ng_ether_detach_p 0x000000008c0c0210 _sysctl__net_link_ether_children 0x000000008c0c0214 _cyg_ng_ether_attach_p 0x000000008c0c0218 _cyg_ng_ether_output_p 0x000000008c0c021c _cyg_ng_ether_input_orphan_p COMMON 0x000000008c0c0220 0xe8 /ecos-c/cygwin/home/LINK/ecoscvs_se-net-SE7709-2/untitled_install/lib/libtarget.a(net_bsd_tcpip_if_loop.o) and memory dump after loading. URAM 8C0C0214 cyg_ng_ether_attach_p 00 00 00 00 00 00 00 00 ........ URAM 8C0C021C cyg_ng_ether_input_orphan_p 00 00 00 00 00 00 00 00 ........ URAM 8C0C0224 cyg_loif+4 00 00 00 00 00 00 00 00 ........ URAM 8C0C022C cyg_loif+c 00 00 00 00 00 00 00 00 ........ URAM 8C0C0234 cyg_loif+14 00 00 00 00 00 00 00 00 ........ URAM 8C0C023C cyg_loif+1c 00 00 00 00 00 00 00 00 ........ URAM 8C0C0244 cyg_loif+24 00 00 00 00 00 00 00 00 ........ URAM 8C0C024C cyg_loif+2c 00 00 00 00 00 00 00 00 ........ URAM 8C0C0254 cyg_loif+34 00 00 00 00 00 00 00 00 ........ URAM 8C0C025C cyg_loif+3c 00 00 00 00 00 00 00 00 ........ URAM 8C0C0264 cyg_loif+44 00 00 00 00 00 00 00 00 ........ URAM 8C0C026C cyg_loif+4c 00 00 00 00 00 00 00 00 ........ URAM 8C0C0274 cyg_loif+54 00 00 00 00 00 00 00 00 ........ URAM 8C0C027C cyg_loif+5c 00 00 00 00 00 00 00 00 ........ I put on my target's memory layout files. \packages\hal\sh\inserter\current\include\pkgconf\mlt_sh_sh77x9_inserter_ram.ldi --- begin #include MEMORY { ram : ORIGIN = 0x8c000000, LENGTH = 0x4000000 } SECTIONS { SECTIONS_BEGIN SECTION_vectors (ram, 0x8c010000, LMA_EQ_VMA) SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA) SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA) SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA) SECTION_bss (ram, ALIGN (0x10), LMA_EQ_VMA) CYG_LABEL_DEFN(__heap1) = ALIGN (0x8); SECTIONS_END } --- end \packages\hal\sh\inserter\current\include\pkgconf\mlt_sh_sh77x9_inserter_ram.h --- begin #ifndef __ASSEMBLER__ #include #include #endif #define CYGMEM_REGION_ram (0x8c000000) #define CYGMEM_REGION_ram_SIZE (0x4000000) #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) #ifndef __ASSEMBLER__ extern char CYG_LABEL_NAME (__heap1) []; #endif #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1)) #define CYGMEM_SECTION_heap1_SIZE (0x90000000 - (size_t) CYG_LABEL_NAME (__heap1)) #ifndef __ASSEMBLER__ extern char CYG_LABEL_NAME (__pci_window) []; #endif --- end and application makefile --- begin export PREFIX := /ecos-c/cygwin/home/LINK/ecoscvs_l_net_20071015/unnamed2_install export COMMAND_PREFIX := sh-elf- export CC := $(COMMAND_PREFIX)gcc export OBJCOPY := $(COMMAND_PREFIX)objcopy export HOST := CYGWIN export AR := $(COMMAND_PREFIX)ar XCC = sh-elf-gcc ## Build flags. CFLAGS = -g -Wall -I$(PREFIX)/include -ffunction-sections -fdata-sections LDFLAGS = -nostartfiles -L$(PREFIX)/lib -Wl,--gc-sections -Wl,--Map -Wl,nc_test_slave.map LIBS = -Ttarget.ld -nostdlib LD = $(XCC) ## Build rules. all: nc_test_slave nc_test_slave.o: nc_test_slave.c $(XCC) -c -o $*.o $(CFLAGS) $< nc_test_slave: nc_test_slave.o $(LD) $(LDFLAGS) -o $@ $@.o $(LIBS) clean: -rm -f nc_test_slave.exe nc_test_slave.o nc_test_slave.map --- end >From above result I suppose I must do 'something' to make LAN91C111 driver work, or my environments lack somthing ? If you could elicit any conclusion from above accounts please enligten me. I look foward to any suggestion. Thank you in advance. Sincerely, Masahiro Ariga -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss