[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Booting problems with netboot
- Date: Tue, 26 Oct 1999 13:48:37 +0200 (MET DST)
- From: Kris.Hermans at cs.kuleuven.ac.be (Kris Hermans)
- Subject: Booting problems with netboot
Hello Again,
I'm trying to create a set-up with 2 PC's (host: pentium with linux,
target: pc386). I want to work with GNAT/RTEMS - 4.0.
Up until now, I can make a hello world progam in Ada, create a .exe file
and boot it on the target using GRUB and a diskette. However, to make
development more comfortable, I want to use netboot (and download the *.bt
files ...).
So, I read the bsp-pc386-howto and followed the guidelines for setting up
a BOOTP/TFTP server and a bootrom image on floppy. After setting up, I
tried to compile the hello.adb and create a hello.bt. These are the
steps I took:
1) make -f Makefile.pc386
This gives the following output. There *are* error-msgs, but as I have a
.exe and a .bt, I assume correct results (Any ideas why these msgs ?)
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//bin/i386-rtems-gnatmake -v -O
-gnata -gnatE -gnato hello -g -o hello.obj \
-bargs -r \
-cargs -B/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//rtems/pc386/lib/
-specs bsp_specs -qrtems -Wl,-Ttext,0x00100000 -Wl,--oformat,elf32-i386 \
-largs -B/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//rtems/pc386/lib/
-specs bsp_specs -qrtems -Wl,-Ttext,0x00100000 -Wl,--oformat,elf32-i386
init.o
GNATMAKE 3.11p (981118) Copyright 1995-1998 Free Software Foundation,
Inc.
"hello.ali" being checked ...
"bsp_specs" missing.
i386-rtems-gnatbind -aO./ -r -I- -x hello.ali
i386-rtems-gnatlink -g -o hello.obj
-B/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//rtems/pc386/lib/ -specs
bsp_specs -qrtems -Wl,-Ttext,0x00100000 -Wl,--oformat,elf32-i386 init.o
hello.ali
i386-rtems-gcc: file path prefix
`/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//rtems/pc386/lib/' never used
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//bin/i386-rtems-size hello.obj
text data bss dec hex filename
165312 6548 42188 214048 34420 hello.obj
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//bin/i386-rtems-nm -g -n
hello.obj >hello.num
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//bin/i386-rtems-objcopy -O
a.out-i386 \
--remove-section=.rodata \
--remove-section=.comment \
--remove-section=.note \
--strip-unneeded hello.obj hello.exe
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//bin/i386-rtems-objcopy -O
binary hello.obj hello.bin
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//rtems/pc386/build-tools/bin2boot
-v hello.bt 0x00097E00 \
/home/pcuser8/RTEMS/gnat-3.11p/i386-rtems//rtems/pc386/lib/start16.bin
0x00097C00 0 hello.bin 0x00100000 0
header address 0x00097e00, its memory size 0x00000200
first image address 0x00097c00, its memory size 0x00000200
second image address 0x00100000, its memory size 0x0002a000
ln hello.exe hello
ln: hello: File exists
make: *** [hello] Error 1
2) Copy the hello.bt to a location accessible by the client.
3) Boot the client. The client boots and finds the server and its own
IP-address. It also finds the image on the server(because if I remove it,
he complains). But It doesn't execute the program: there is a quick blink
on the screen (I read an error but it is too fast to follow), and then the
client reboots.
If I read the log for tftpd, I see there was a correct read-request for
the .bt file.
I also read about a bug in bin2boot (opening the ouput file in ascii).
However, applying the file gave me the same results ...
Here is the makefile I used:
#
# Makefile for hello world example
#
MAIN=hello
# Tool paths
target=i386-rtems
tooldir=/home/pcuser8/RTEMS/gnat-3.11p/${target}/
rtemsdir=${tooldir}/rtems/pc386
# Tool names
GCC=${tooldir}/bin/${target}-gcc
GNATMAKE=${tooldir}/bin/${target}-gnatmake
SIZE=${tooldir}/bin/${target}-size
OBJCOPY=${tooldir}/bin/${target}-objcopy
NM=${tooldir}/bin/${target}-nm
HEADERADDR=0x00097E00
START16FILE=$(rtemsdir)/lib/start16.bin
START16ADDR=0x00097C00
RELOCADDR=0x00100000
CARGS=-B${rtemsdir}/lib/ -specs bsp_specs -qrtems \
-Wl,-Ttext,$(RELOCADDR) -Wl,--oformat,elf32-i386
all: init.o $(MAIN)
$(MAIN): $(MAIN).exe
ln $(MAIN).exe $(MAIN)
$(MAIN).exe: init.o
$(GNATMAKE) -v -O -gnata -gnatE -gnato $(MAIN) -g -o $(MAIN).obj \
-bargs -r \
-cargs $(CARGS) \
-largs $(CARGS) init.o
$(SIZE) $(MAIN).obj
$(NM) -g -n $(MAIN).obj >$(MAIN).num
$(OBJCOPY) -O a.out-i386 \
--remove-section=.rodata \
--remove-section=.comment \
--remove-section=.note \
--strip-unneeded $(MAIN).obj $@
$(OBJCOPY) -O binary $(MAIN).obj $(MAIN).bin
$(rtemsdir)/build-tools/bin2boot -v $(MAIN).bt $(HEADERADDR) \
$(START16FILE) $(START16ADDR) 0 $(MAIN).bin $(RELOCADDR) 0
init.o: init.c
$(GCC) -O4 -g -Wall -ansi -fasm $(CARGS) \
-DGNAT_MAIN_STACKSPACE=16 -c init.c
clean:
rm -f b_$(MAIN).c b_$(MAIN).o *.o *.ali $(MAIN)
Hopefully, there is someone out there who can give me any
hints/tips/patches on the subject ? I really would appreciate it.
Thanks,
Kris Hermans,
Researcher at the Computer Science Dept, KULeuven (Belgium)