ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: programming tools for TS-Linux

To:
Subject: Re: [ts-7000] Re: programming tools for TS-Linux
From: Seano <>
Date: Thu, 17 May 2007 08:36:24 -0500
Eddie, thanks for the response. Here is a short summary of what I have tried to do:

From the instructions in file ftp://oz.embeddedarm.com/rt/rtaiguide.pdf

I start on the top of the fourth page, 'Building the Adeos real-time kernel

I've downloaded the files from the FTP and successfully patched the kernel. I've got the cross compiler gcc 3.3.2 glibc 2.3.2 for Cygwin. (I can use this to make a simple hello world program that I can transfer over and it works fine.

So in the bottom of step four is the Modutils install. I got the file, untar it, and run the ./configure as shown. That appears to work fine, output below:

$ ./configure --build=i386-linux --host=arm-linux --prefix=/opt/crosstool/arm-
nknown-linux-gnu/gcc-3.3.2-glibc-2.3.2/arm-unknown-linux-gnu
checking build system type... i386-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking for arm-linux-gcc... no
checking for gcc... gcc
checking for C compiler default output... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for arm-linux-ranlib... no
checking for ranlib... ranlib
checking whether ln -s works... yes
checking for wordexp... no
checking for glob... yes
checking for query_module in -lc... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.common
config.status: creating depmod/Makefile
config.status: creating genksyms/Makefile
config.status: creating insmod/Makefile
config.status: creating obj/Makefile
config.status: creating util/Makefile
config.status: creating man/Makefile

Then, you are told to run the 'make' - this is where the problem occurs:

$ make
make[1]: Entering directory `/modutils-2.4.27/util'
gcc -O2 -Wall -I./../include -D_GNU_SOURCE -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME
=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DCO
NFIG_USE_SYSCALL=1 -DCONFIG_ROOT_CHECK_OFF=0  -DELF_MACHINE_H='"elf_arm.h"' -DAR
CH_arm  -c -o sys_nim.o sys_nim.c
sys_nim.c:30:24: asm/unistd.h: No such file or directory
sys_nim.c:48: error: parse error before "sys_init_module"
make[1]: *** [sys_nim.o] Error 1
make[1]: Leaving directory `/modutils-2.4.27/util'
make: *** [all] Error 2

So, obviously I am missing some set of files I was supposed to bring in somehow, or maybe a wrong include path?

On 5/16/07, Eddie Dawydiuk <> wrote:

Hello,

> the Cygwin box can't find 'asm/unistd.h' when I run the
> 'make' command for modutils when I follow the instructions.
>
> there must be some fundamental things about developing for this that they
> assume you know and therefore they don't mention them in the documentation.

When cross-compiling a kernel under Cygwin please ensure you use the
following toolchain.

ftp://ftp.embeddedarm.com/ts-arm-linux-cd/cross-toolchains/crosstool-cygwin-gcc-3.3.2-glibc-2.3.2.tar.bz2

It would be helpful if you sent info showing the commands you've entered
and the output of the commands including the errors you are seeing.

--
Best Regards,
__________________________________________________________
Eddie Dawydiuk, Technologic Systems | voice: (480) 837-5200
16610 East Laser Drive Suite 10 | fax: (480) 837-5300
Fountain Hills, AZ 85268 | web: www.embeddedARM.com



> On 5/16/07, David Hawkins <dwh%40ovro.caltech.edu> wrote:
>>
>>
>> > I'm using the crosscompiler provided by TS. I have tried this on my PC
>> > using Cygwin and I have also tried it on an Ubuntu box.
>> >
>> > Same results, the 'hello world' is fine but the other file is the issue.
>>
>>
>> So, user-space 'hello world' works, but the kernel module appears
>> to be wrong ... let me reboot into Linux for a second ...
>>
>> Here's the output of building the kernel module included inline
>> below ...
>>
>> driver]$ export ARCH=arm
>> driver]$ export
>> PATH=/opt/crosstool/gcc-3.3.4-glibc-2.3.2/arm-unknown-linux-gnu/bin/:$PATH
>> driver]$ export CROSS_COMPILE=arm-unknown-linux-gnu-
>> driver]$ make
>> arm-unknown-linux-gnu-gcc -DDEBUG -D__KERNEL__ -DMODULE -O2 -Wall
>> -I../include
>> -I/home/dwh/ts7300/linux24-modules/lib/modules/2.4.26-ts11/build/include
>> -c fake_module.c
>> driver]$ file fake_module.o
>> fake_module.o: ELF 32-bit LSB relocatable, ARM, version 1 (ARM), not
>> stripped
>>
>> So the file type of a kernel module is not the same as that of a
>> user-space app. This is expected, as the kernel does not use
>> shared libraries.
>>
>> To build the kernel module, I unzipped the ts11 kernel, then
>> built it as per the TS instructions, and then installed the
>> modules into linux24-modules (as you can see in the Makefile).
>> You may get a depmod.old error when you install the modules,
>> however, things work ok for building modules.
>>
>> Cheers
>> Dave
>>
>> # Makefile
>> #
>> # Set ARCH, CROSS_COMPILE, and PATH before calling this
>> CC=$(CROSS_COMPILE)gcc
>> MODCFLAGS = -DDEBUG -D__KERNEL__ -DMODULE -O2 -Wall
>> #MODCFLAGS = -D__KERNEL__ -DMODULE -O2 -Wall
>> SHELL=sh
>> KERNEL_VERSION=2.4.26-ts11
>> TS7300_MODULES=/home/dwh/ts7300/linux24-modules
>> INCLUDES=-I../include
>> -I$(TS7300_MODULES)/lib/modules/$(KERNEL_VERSION)/build/include
>>
>> all: fake_module.o
>>
>> fake_module.o: fake_module.c
>> $(CC) $(MODCFLAGS) $(INCLUDES) -c fake_module.c
>>
>> clean:
>> -rm -f *.o *~
>>
>> /*----------------------------------------------------------
>> * Filename: fake_module.c
>> * Author: D.W. Hawkins
>> * Date: July-2002
>> * Platform: Linux
>> * Purpose: Device driver development
>>
>> *----------------------------------------------------------
>> *
>> * This is a template driver for use while developing driver code.
>> *
>> * This template implements module load and unload and parameter
>> * interrogation.
>> *
>> * See fake_driver.c for a more complete driver template.
>> *
>>
>> *----------------------------------------------------------
>> */
>>
>> /*----------------------------------------------------------
>> * Includes
>>
>> *----------------------------------------------------------
>> */
>>
>> #include <linux/module.h>
>> #include <linux/kernel.h>
>> #include <linux/init.h>
>>
>> #include <linux/fs.h> /* file and device operations */
>> #include <linux/sched.h> /* ISR structure definitions */
>> #include <linux/interrupt.h> /* IRQ handling - ISRs */
>> #include <linux/slab.h> /* used to resolve kmalloc/kfree */
>> #include <linux/pci.h> /* PCI related macros and functions */
>>
>> #include <asm/uaccess.h> /* get/put_user, copy_to/from_user */
>> #include <asm/io.h> /* ioremap, iounmap, memcpy_to/fromio */
>>
>> /*----------------------------------------------------------
>> * Global parameters
>>
>> *----------------------------------------------------------
>> */
>>
>> static char debug = 1;
>>
>> /*----------------------------------------------------------
>> * Information extractable via `modinfo' command
>>
>> *----------------------------------------------------------
>> *
>> * Use /sbin/modinfo -p fake_module.o (i.e., on the driver file)
>> * to see the parameters.
>> *
>> */
>>
>> MODULE_DESCRIPTION("Fake device driver module");
>> MODULE_AUTHOR("David Hawkins");
>> MODULE_LICENSE("GPL");
>>
>> MODULE_PARM(debug, "1b");
>> MODULE_PARM_DESC(debug, "Enable/disable debugging messages");
>>
>> /*----------------------------------------------------------
>> * Debug message macro
>>
>> *----------------------------------------------------------
>> *
>> * This macro is used to generate debug information in the module. A module
>> * compiled with the symbol DEBUG defined can turn message generation on or
>> * off using an IOCTL call. A module compiled without DEBUG defined will
>> * not generate messages. (See the schar example in Ch. 21 [Mat99]).
>> *
>> */
>>
>> #ifdef DEBUG
>> #define MSG(string, args...) if (debug) printk("fake: " string, ##args)
>> #else
>> #define MSG(string, args...)
>> #endif
>>
>> /*----------------------------------------------------------
>> * Module load/unload declaration and definition
>>
>> *----------------------------------------------------------
>> */
>> int fake_init()
>> {
>> MSG("Module 'fake' loaded.\n");
>> return 0;
>> }
>>
>> void fake_exit()
>> {
>> MSG("Module 'fake' unloaded\n");
>> }
>>
>> module_init(fake_init);
>> module_exit(fake_exit);
>>
>>
>


__._,_.___


SPONSORED LINKS
Single board computer Hardware Computer running slow
Linux os

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU