Page 1 of 1

problem with makefile

Posted: Wed Apr 30, 2003 4:26 pm
by beyondsociety
When I run my makefile from Linux, I get this error:

Code: Select all

nasm -f elf -o /boot/stub.o /boot/stub.asm
make: *** [boot/stub.o] Segmentation Fault
make: *** Deleting file 'boot/stub.o'

What would cause a segmentation fault and what is it?
If you need to see code, then just ask! 

Re:problem with makefile

Posted: Wed Apr 30, 2003 4:54 pm
by Pype.Clicker
segmentation fault (a.k.A. segfault or sigsegv) is the unix word for "blue screen of death" ... your application behaved badly and has been terminated. probably you either have a too old and buggy version of NASM or you're not giving it parameters it requires (isn't it -felf rather than -f elf ?)

Re:problem with makefile

Posted: Wed Apr 30, 2003 7:40 pm
by beyondsociety
(isn't it -felf rather than -f elf ?)
Tried it and didn't change a thing.

Heres my makefile:

Code: Select all

# Basic Makefile for IBOX OS, Ver 0.01, Date: 04/22/03 1:14 PM

# Name of IBOX OS Kernel
KERNEL_NAME = ibox.img

# C compiler to use
CC = gcc                          # Changing this may cause problems
CFLAGS = -c -Wall -I./include/    # Arguments given to GCC

# Assembler to use
NASM = nasm                       # Assembler has to support Intel Syntax                
NASMFLAGS = -f elf                # Compile to elf

# Linker to use
LD = ld                           # We're using the GNU Linker
LDFLAGS = -T linker.d -o $(KERNEL_NAME)

# Add the rest of the C files to this list
OBJS = boot/stub.o kernel/kernel.o kernel/stdio.o /kernel/8259.o /kernel/timer.o /kernel/io.o /kernel/exceptions.o /boot/handlers.o

all: $(KERNEL_NAME)

install:

        # This will install the kernel to a Floppy Disk
        mount /floppy/
        cp $(KERNEL_NAME) /floppy/
        umount /floppy/

clean:

        rm $(OBJS)

# Compile all assembler files
%.o : %.asm
        $(NASM) $(NASMFLAGS) -o $@ $<

# Compile all C files
%.o : %.c
        $(CC) $(CFLAGS) -o  $@ $<

# Link them all together
$(KERNEL_NAME): $(OBJS)
        $(LD) $(LDFLAGS) $(OBJS)
The file thats giving me the error is attached below:


[attachment deleted by admin]

Re:problem with makefile

Posted: Thu May 01, 2003 2:28 am
by Pype.Clicker
afaik, MAKE is not to blame here. NASM is the one that caught a segfault ... and i'm not sure, but i think you should put a argument to your

Code: Select all

%REP 
...
%ENDREP ;; pype's internal assembler running on /dev/brain says "rep how many times ?"
try to get the version of your NASM (nasm -r) and check (f.i. on freshmeat, etc) if there isn't a more recent version available.

Re:problem with makefile

Posted: Thu May 01, 2003 1:51 pm
by beyondsociety
I'll try that and get back to you later on the outcome.

I think I have an older version of nasm.

Re:problem with makefile

Posted: Tue May 06, 2003 3:11 pm
by beyondsociety
I solved my problem thanks to Pype Clicker. I had to get a newer version of linux. Once I did that, it worked.
Thanks again.