(toppers-users 391) Vine Linux 2.5 上でのシミュレーション方法を教えて下さい

勝山 武晴 katsu.ne.njrc.co.jp @ ne.njrc.co.jp
2002年 5月 21日 (火) 14:33:25 JST


Vine Linux 2.5 で、Linux 上のシミュレーションをやってみたいのですが、
やり方がよく分かりません。
どうぞ、教えて下さい。

o jsp カーネル:	TOPPERS/JSPカーネル Release 1.3 

o 環境:		Vine Linux 2.5
      gcc :	29.95.3-2vl20 
      binutils: 2.11.90.0.8-8vl5
      make :	3.79.1-5vl1
      perl : 	5.6.1-0vl8

o やってみたこと。
   jsp/doc/user.txt, linux.txt に従って、sample プログラムを Linux 上の
   シミュレーション用に構築した(つもり)。

   % cd hogehoge/jsp
   % mkdir SIM-LINUX
   % cd SIM-LINUX
   % ../configure -C linux -P /usr
      (ログは下記の通り。)
      ここでの、-P オプションで指定する GNU 開発環境は、Vine Linux に
      もともとインストールされているものを意図してます。

質問 1. GNU 開発環境の指定はこれでよいのでしょうか?

   つづいて
   % make depend 

	makedep: can't execute /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/\
	  cpp -I. -I../include -I../config/linux -I../config/linux/
	make: *** [depend] エラー 1
      と表示し、エラー終了しました。
      (ログは下記の通り。)

質問 2. make depend を 正常終了させるには、どうしたらよいのでしょうか?


   構わず、make を実行
   % make
	Program failed in its process by following reason.
	  Internel error: Memory read with unmapped address
      と表示し、エラー終了しました。
      (ログは下記の通り。)

質問 3. make を 正常終了させるには、どうしたらよいのでしょうか?
      (エラー終了しても問題ないでしょうか?)

    試しに、Makefile の中の CPP を 
    CPP = $(shell $(CC) -print-prog-name=cpp)
    から
    CPP = /usr/bin/cpp
    にしてみたところ、make depend は、正常終了しました。
    が、make では、変わりありませんでした。

   次に、jsp はできているので、構わず、gdb を起動してみました。

   % /usr/bin/gdb jsp
    (gdb) handle SIGUSR1 nostop noprint
    (gdb) run
     とすると、
	task1 is running (001).   |
	task1 is running (002).   |
		:
      というような表示が繰り返しされます。(数字のところは番号が増えていく)

     この状態で、リターンキーなど、Control-C 以外のキーを押すと、
	Program received signal SIGSEGV, Segmentation fault.
     となってしまいます。
      (ログは下記の通り。)

     Control-C を押せば、正常にブレークします。

      Program received signal SIGINT, Interrupt.
      0x0804a449 in task (exinf=0x1) at sample1.c:127
      127			for (i = 0; i < task_loop; i++);
      (gdb) 

   
質問 4. Segmentation fault は、make が正常に終っていないのが原因でしょうか?

質問 5. 擬似シリアルドライバにキー入力を渡すにはどうしたら良いのでしょうか?

      (gdb の使い方は、良く分かっていません。
      ここで、聞くべきではないとは思いますが、gdb の使い方を分かりやすく
      解説してくれているところがありましたら、そのポインターを教えて下さい)
      


--- ../configure の実行結果 ---
      configure: Generating Makefile from ../sample/Makefile.linux.
      configure: Generating sample1.c from ../sample/sample1.c.
      configure: Generating sample1.h from ../sample/sample1.h.
      configure: Generating sample1.cfg from ../sample/sample1.cfg.
      configure: Generating ../cfg/Makefile.linux from ../cfg/Makefile.template.
      configure: Generating configuration tools.
      make: `all' に対して行うべき事はありません。
--- ../configure の実行結果 ここまで---

--- make depend の実行結果 ---

/usr/lib/gcc-lib/i386-redhat-linux/2.95.3/cpp -I. -I../include -I../config/linux -I../config/linux/    sample1.cfg | ../cfg/cfg -s -c \
			-cpu linux -system  -obj
In file included from ../systask/serial.cfg:11,
                 from sample1.cfg:27:
../config/linux/sys_config.h:74: #error not supported.
--- mITRON4.0 Kernel Configurator (ver 9.0) for [TOPPERS/JSP rel 1.3] ---
gcc -S      -I. -I../include -I../config/linux -I../config/linux/ -g -Wall -I../kernel ../config/linux/makeoffset.c
../utils/genoffset makeoffset.s > offset.h
rm -f Makefile.depend
../utils/makedep -P /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/cpp \
-T "kernel_cfg.c kernel_id.h kernel_chk.c" \
	-O "-I. -I../include -I../config/linux -I../config/linux/" sample1.cfg \	>> Makefile.depend
In file included from ../systask/serial.cfg:11,
                 from ./sample1.cfg:27:
../config/linux/sys_config.h:74: #error not supported.
makedep: can't execute /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/cpp -I. -I../include -I../config/linux -I../config/linux/
make: *** [depend] エラー 1

--- make depend の実行結果 ここまで ---
      
     
--- make の実行結果 ---
      前半略
	:
kernel ../kernel/interrupt.c
gcc -c      -I. -I../include -I../config/linux -I../config/linux/ -g -Wall -I../kernel ../kernel/exception.c
rm -f libkernel.a
ar -rcs libkernel.a  startup.o cpu_config.o sys_config.o task.o wait.o time_event.o syslog.o task_manage.o task_sync.o task_except.o semaphore.o eventflag.o dataqueue.o mailbox.o mempfix.o time_manage.o cyclic.o sys_manage.o interrupt.o exception.o
gcc -c      -I. -I../include -I../config/linux -I../config/linux/ -g -Wall -I../kernel ../kernel/banner.c
gcc -S      -I. -I../include -I../config/linux -I../config/linux/ -g -Wall -I../kernel kernel_chk.c
../utils/gencheck kernel_chk.s > jsp.chk
gcc      -I. -I../include -I../config/linux -I../config/linux/ -g -Wall   -o jsp start.o banner.o kernel_cfg.o  timer.o linux_serial.o linux_sigio.o logtask.o vasyslog.o jsp_perror.o strerror.o  sample1.o    libkernel.a   -lgcc
../cfg/chk jsp -cs jsp.chk \
			-cpu linux -system  -obj
--- TOPPERS/JSP Configuration Checker (ver 2.0) ---
  Target architecture : elf32-i386
Program failed in its process by following reason.
  Internel error: Memory read with unmapped address
make: *** [jsp] エラー 1

--- make の実行結果 ここまで ---

--- gdb の実行結果  ---
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) handle SIGUSR1 nostop noprint
Signal        Stop	Print	Pass to program	Description
SIGUSR1       No	No	Yes		User defined signal 1
(gdb) run
Starting program: /home/katsu/Toppers/jsp/SIM-LINUX/jsp 

JSP Kernel Release 1.3 (patchlevel = 0) for Linux (May 21 2002, 11:38:21)
Copyright (C) 2000-2002 by Embedded and Real-Time Systems Laboratory
                            Toyohashi Univ. of Technology, JAPAN

Serial driver service starts on port 1.
System logging task is started on port 1.
Sample task starts (exinf = 0).
task1 is running (001).   |
task1 is running (002).   |
task1 is running (003).   |
task1 is running (004).   |

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) 

--- gdb の実行結果  ここまで ---

-- 
--------------------------------------------------------------
    長野日本無線エンジニアリング株式会社
        勝山 武晴
	Email: katsu @ ne.njrc.co.jp
--------------------------------------------------------------