0

makeファイルを作成しました

    obj-m += hello.o

all:
    make -C /home/developer/Desktop/xukr-20120201-omap3/linux-2.6.37-tn M=/home/developer/Desktop/module_test  modules

clean:
    make -C /home/developer/Desktop/xukr-20120201-omap3/linux-2.6.37-tn M=/home/developer/Desktop/module_test clean

次に、簡単なhelloプログラムを見つけました

#define __KERNEL__         /* We're part of the kernel */
#define MODULE             /* Not a permanent part, though. */

/* Standard headers for LKMs */
#include <linux/modversions.h> 
#include <linux/module.h>  

#include <linux/tty.h>      /* console_print() interface */

/* Initialize the LKM */
int init_module()
{
  console_print("Hello, world - this is the kernel speaking\n");
  /* More normal is printk(), but there's less that can go wrong with 
     console_print(), so let's start simple.
  */

  /* If we return a non zero value, it means that 
   * init_module failed and the LKM can't be loaded 
   */
  return 0;
}


/* Cleanup - undo whatever init_module did */
void cleanup_module()
{
  console_print("Short is the life of an LKM\n");
}

そして私はこれでコマンドラインでコンパイルしようとしました

make ARCH=arm CROSS_COMPILE=angstrom-linux-gnueabi-

そして、私はこのエラーを受け取ります

/bin/sh: angstrom-linux-gnueabi-gcc: not found

これの何が問題になっていますか?私はこれで本当に新しいです。

前もって感謝します、

4

1 に答える 1

0

remakeを使用して、をデバッグおよび理解できますMakefileGNU makeremake -x -dのように動作しながら、多くのデバッグ出力が得られるので、それを呼び出します。

私がコメントしたように、あなたの内部の$(MAKE)代わりに使用することを忘れないでください。makeMakefile

エラーについて:システムに適切なクロスコンパイラ(およびクロスリンカー)ツールチェーンをインストールする必要があります(または、環境変数をangstrom-linux-gnueabi-gcc: not found適切に設定して、検出されるようにします)。PATH

これはすべてあなたの問題を解決することはありませんが、あなたがそれを理解するのに役立ちます

于 2012-03-02T08:52:23.690 に答える