Salve a tutti, sto cercando di creare i driver per la scheda PRMISE sx6000 con fedora core 1.b..

Ho trovato questo semplice tutorial per la creazione dei draiver http://members.rogers.com/sith.warrior/build.htm
ma ci sono alcune cose che non mi sono chiare.....

Inazitutto cosa significa:
...and be sure that it is set for an INDEP build by modifying the Makefile..
se questo e il mio make file dove devo settare "INDEP" ?

#the following are for RedHat

UTSVERSION = `uname -r`

UTSSMP = `uname -a|grep -i smp`



#-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=386 -DMODULE -DMODVERSIONS



PUB_CFLAGS= -D__KERNEL__ -DMODULE -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -pipe



##### ARCH= $(shell echo -march=`arch`) #####



SOURCES = pti_st.c pti_st.h pti_stdev.h i2odef.h

BUILD_FILE= pti_st.c

OBJECT = pti_st.o



TMPDIR=$(dir $(KERNEL_SOURCE_DIR))

ifneq ("x$(TMPDIR)", "x$(KERNEL_SOURCE_DIR)")

KERNEL_SRC_DIR=$(shell echo $(KERNEL_SOURCE_DIR)/)

else

KERNEL_SRC_DIR=$(KERNEL_SOURCE_DIR)

endif



ifeq ("x$(KERNEL_SOURCE_DIR)","x")

KERNEL_SRC_DIR=$(shell echo /lib/modules/$(UTSVERSION)/build/)

tmp_str=$(shell if[ ! -f $(KERNEL_SRC_DIR) ]; then \

echo "the directory $(KERNEL_SRC_DIR) do not existed!"; \

fi)

endif



INCLUDE_DIR= $(shell echo "-I$(KERNEL_SRC_DIR)include -I$(KERNEL_SRC_DIR)drivers/scsi")

VERSIONFILE= $(shell echo "$(KERNEL_SRC_DIR)include/linux/version.h")

SMP_STR=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_SMP)

#### UP_SMP=`echo $(SMP_STR) | awk -F= '{print $$2}'`#### This usage is error!

UP_SMP=$(shell echo $(SMP_STR) | awk -F= '{print $$2}')

ifeq ($(strip $(UP_SMP)),y)

UP_SMP_FLAG=-D__SMP__

else

UP_SMP_FLAG=

endif

######### decide the cpu type ##########

CONFIG_M386=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_M386 | awk -F= '{print $$2}')

CONFIG_M486=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_M486 | awk -F= '{print $$2}')

CONFIG_M586=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_M586 | awk -F= '{print $$2}')

CONFIG_M586TSC=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_M586TSC | awk -F= '{print $$2}')

CONFIG_M586MMX=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_M586MMX | awk -F= '{print $$2}')

CONFIG_M686=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_M686 | awk -F= '{print $$2}')

CONFIG_MPENTIUMIII=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_MPENTIUMIII | awk -F= '{print $$2}')

CONFIG_MPENTIUM4=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_MPENTIUM4 | awk -F= '{print $$2}')

CONFIG_MK6=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_MK6 | awk -F= '{print $$2}')

CONFIG_MK7=$(shell cat $(KERNEL_SRC_DIR)/.config | grep CONFIG_MK7 | awk -F= '{print $$2}')

ifeq ($(strip $(CONFIG_M386)),y)

ARCH=i386

else

ifeq ($(strip $(CONFIG_M486)),y)

ARCH=i486

else

ifeq ($(strip $(CONFIG_M586)),y)

ARCH=i586

else

ifeq ($(strip $(CONFIG_M586TSC)),y)

ARCH=i586

else

ifeq ($(strip $(CONFIG_M586MMX)),y)

ARCH=i586

else

ifeq ($(strip $(CONFIG_M686)),y)

ARCH=i686

else

ifeq ($(strip $(CONFIG_MPENTIUMIII)),y)

ARCH=i686

else

ifeq ($(strip $(CONFIG_MPENTIUM4)),y)

ARCH=i686

else

ifeq ($(strip $(CONFIG_Mk6)),y)

ARCH=i586

else

ifeq ($(strip $(CONFIG_Mk7)),y)

ARCH=i586

else

ARCH=i386

endif

endif

endif

endif

endif

endif

endif

endif

endif

endif

CONFIG_ARCH= $(shell echo -march=$(ARCH))



#the following are for generial OS

VERSION=`grep UTS_RELEASE $(VERSIONFILE) | awk -F '"' '{ print $$2}'`

OS = $(shell grep UTS_RELEASE $(VERSIONFILE) | awk -F '"' '{ print $$2}')

OS1 = $(shell grep UTS_RELEASE $(VERSIONFILE) | awk -F '"' '{ print $$2}' | awk -F . '{ print $$1 }')

OS2 = $(shell grep UTS_RELEASE $(VERSIONFILE) | awk -F '"' '{ print $$2}' | awk -F . '{ print $$2 }')

OS3 = $(shell grep UTS_RELEASE $(VERSIONFILE) | awk -F '"' '{ print $$2}' | awk -F . '{ print $$3 }' | awk -F- '{print $$1}')



TMPCFLAGS=$(shell echo " $(PUB_CFLAGS) $(INCLUDE_DIR) $(UP_SMP_FLAG) -march=$(ARCH) ")



CC= $(shell if [ $(OS2) -lt 4 ]; then\

echo "kgcc"; \

else \

echo "gcc"; \

fi



ifeq ("x$(CC)","xgcc")

LASTCFLAGS=$(shell echo "$(TMPCFLAGS) -mpreferred-stack-boundary=2 ")

else

LASTCFLAGS=$(shell echo "$(TMPCFLAGS) -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=386 ")

endif

CFLAGS=$(shell echo $(LASTCFLAGS))



MODVERSION_FILE=$(shell echo "$(KERNEL_SRC_DIR)include/linux/modversions.h")



all:$(OBJECT)



$(OBJECT):$(SOURCES)

@echo "kernel version: $(VERSION) "

@if [ -f "$(MODVERSION_FILE)" ]; \

then \

if [ $(OS2) -lt 4 ]; then \

echo "$(CC) -c $(BUILD_FILE) -o $(OBJECT) $(CFLAGS) -DMODVERSION -include $(MODVERSION_FILE)"; \

$(CC) -c $(BUILD_FILE) -o $(OBJECT) $(CFLAGS) -DMODVERSION -include $(MODVERSION_FILE); \

else \

echo "$(CC) -c $(BUILD_FILE) -o $(OBJECT) $(CFLAGS)" ; \

$(CC) -c $(BUILD_FILE) -o $(OBJECT) $(CFLAGS); \

fi; \

else \

echo "$(CC) -c $(BUILD_FILE) -o $(OBJECT) $(CFLAGS)" ; \

$(CC) -c $(BUILD_FILE) -o $(OBJECT) $(CFLAGS); \

fi;



clean:

rm -f pti_st.o pti_st.o.boot 2>&1 >/dev/null



insmod:

-rmmod pti_st

-insmod scsi_mod

-insmod sd_mod

-insmod pti_st.o
poi un altro punto oscuro e nell read me della creazione del driver:

...Before building the

driver code, you have two choices:

1.) If you want run the driver in current kernel version and the kernel

source directory is something like '/usr/src/linux-x.x.xx/', the

'x.x.xx' is the current kernel version, then you can just run make

command in the driver source code directory.

2.) If you don't want run the driver in current kernel version, then you

must tell the make program where is the linux kernel source directory.

thus, you can run 'make KERNEL_SOURCE_DIR=/usr/src/linux-x.xx.xx'

(without the quotation marks).
A scanso di equivoci devo usare l' ozione 2 pel il kernel di BOOT e l' opzione 1 per il kernel 686 (Giusto?)

Scusate se faccio domande stupide ma è da poco che sono passato al mondo LINUX!
Un saluto a tutti JUNK!