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

can you help me?thanks



dear sir:
  i am very interested in oskit.for the purpose to master it,i try to make a
little os whith oskit.but when i try to write makefile and make my kernel,
i met some problems.
  i find it is very difficult to write a makefile all by myself,because i
don't know which liboskit_*.a file i need to link. how can i know which lib
a certern head file belong to in a convenient way? 
  i attempted to write a makefile by myself to make hello(the example),but,i
find the lib linked also need other libs. should i find them all and link 
all of them together when i make my cernel ? it is too tired ,isn't it?
  so i tested another way ,i copy such lines from the makerules to my 
makefile as bellow:
  


 ifndef _oskit_examples_x86_makerules_
_oskit_examples_x86_makerules__ = yes

TARGETS = hello multiboot timer timer_com timer_com2 stream_netio \
	spf uspf pingreply diskpart diskpart2 blkio tty netbsd_fs_com \
	netbsd_fs_posix fsread socket_com socket_com2 mouse memtest \
        memfs_com memfstest1 perfmon anno_test

all: $(TARGETS)

prepare::

OSKIT_SRCDIR= /root/oskit-20010214
OBJDIR=/root/oskit/lib
SRCDIRS +=	$(OSKIT_SRCDIR)/examples/x86 \
		$(OSKIT_SRCDIR)/examples/x86/more \
		$(OSKIT_SRCDIR)/examples/x86/shared
INCDIRS +=	$(OSKIT_SRCDIR)/oskit/c	\
		$(OSKIT_SRCDIR)/examples/x86/shared
CLEAN_FILES +=	$(TARGETS) *.gdb
OSKIT_CFLAGS += -DOSKIT

CLIB   = -loskit_c
CLIB_P = -loskit_c_p -loskit_gprof -loskit_c_p -loskit_kern_p

include $(OSKIT_SRCDIR)/GNUmakerules

DEPENDLIBS = $(filter %.a, $(foreach DIR,$(LIBDIRS),$(wildcard $(DIR)/*)))

hello: $(OBJDIR)/lib/multiboot.o hello.o $(DEPENDLIBS)
	$(OSKIT_QUIET_MAKE_INFORM) "Linking example $@"
	$(LD) -Ttext 100000 $(LDFLAGS) $(OSKIT_LDFLAGS) \
		-o $@ $(filter-out %.a,$^)		\
		-loskit_clientos -loskit_kern -loskit_lmm \
		$(CLIB) $(OBJDIR)/lib/crtn.o 

endif



  then i rewrite a same hello.c as the example ,but I still can't make hello
successfully.
  can you tell me a simple way to make my own kernel c file.
  thank you very much !
                                          yours   lawranceyang@263.net





_____________________________________________
精彩演出,巨星云集   http://shopping.263.net/category16.htm
贵族香水,平民价格   http://shopping.263.net/perfume/