proc fs を使ったカーネル情報の表示 その2
http://wiki.bit-hive.com/tomizoo/pg/proc%20fs%20%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%9F%E3%82%AB%E3%83%BC%E3%83%8D%E3%83%AB%E6%83%85%E5%A0%B1%E3%81%AE%E8%A1%A8%E7%A4%BA%20%E3%81%9D%E3%81%AE2
ここのMakefileでは.とくに特別なことはやっていない.
KERNELSRCDIR = /usr/src/linux
BUILD_DIR := $(shell pwd)
VERBOSE = 0
# obj-m にモジュール名を定義
obj-m := seqfilemod.o
seqfilemod-objs := proc.o
include $(KERNELSRCDIR)/.config
all:
make -C $(KERNELSRCDIR) SUBDIRS=$(BUILD_DIR) \
KBUILD_VERBOSE=$(VERBOSE) modules
• KBUILD_VERBOSE:コンパイル時のメッセージ出力を制御する。コンパイル時の実行コマンドをそのまま表示したい場合は1にすればよい。 http://wiki.bit-hive.com/tomizoo/pg/Loadable%20Kernel%20Module%E3%81%AE%E4%BD%9C%E3%82%8A%E6%96%B9
getpid - Very simple example of how to use rdtscbench
[Q] I want to initialize process control block structure (task_struct). <— [Ans] There are two options. The first - you can set the value of the variable in the init_task global. See how it is done in the linux/init_task.h https://stackoverflow.com/questions/8044652/adding-entry-to-task-struct-and-initializing-to-default-value - te