[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Getting Started with microblaze-uclinux-gcc



Hello,
I have been scouring the internet for information on
microblaze-uclinux-gcc and kernel modules. I haven't come up with much
and any guidance would greatly be appreciated.

I have found two books and I was wondering if anyone with experience
with them recommend I buy them.
http://www.amazon.com/Building-Embedded-Linux-Systems-Yaghmour/dp/059600222X
http://www.amazon.com/Linux-Device-Drivers-Jonathan-Corbet/dp/0596005903/ref=pd_bxgy_b_img_b/104-2097690-1463950

A major problem that I am running into is where to locate the header
files available to me.
From what it seems, the compiler uses this directory:
PetaLinux\tools\linux-i386\microblaze-uclinux-tools\microblaze-uclinux\include

I would like to incorporate the header files that the EDK provides to
me to allow access to hardware such as xgpio.h and xtmrctr.h.
From my understanding, I cannot utilize these functions in user mode
and must use a module to access kernel mode.

I have tried compiling a simple kernel module as follows:

#include <linux/module.h>

int init_module()
{
       printk("Hello...\n");
       return 0;
}

void cleanup_module()
{
       printk("World...\n");
}

But it simply will not make:
[bleep@localhost KernelMod]# make
microblaze-uclinux-gcc   -msoft-float -mxl-pattern-compare
-mno-xl-soft-mul -mxl-barrel-shift -mno-xl-soft-div -Wl,-elf2flt -o
KernelMod KernelMod.o
KernelMod.elf2flt: In function `_start':
KernelMod.elf2flt(.text+0x44): undefined reference to `main'
KernelMod.elf2flt: In function `init_module':
/home/bleep/PetaLinux/software/user-apps/KernelMod/KernelMod.c(.text+0xe8):
undefined reference to `printk'
KernelMod.elf2flt: In function `cleanup_module':
/home/bleep/PetaLinux/software/user-appsKernelMod/KernelMod.c(.text+0x114):
undefined reference to `printk'
/home/bleep/PetaLinux/software/user-apps/KernelMod/KernelMod.c:11:
undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [KernelMod] Error 1

I hope this isn't a big problem and that I'm just oblivious to something.
Thanks,
Jose
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/