Problem building Meaty Skeleton tutorial

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Sanchezman
Posts: 18
Joined: Wed Nov 12, 2014 3:48 pm

Problem building Meaty Skeleton tutorial

Post by Sanchezman »

Hello World!
I hate to begin my account on this forum asking for help, but here goes anyway.

I've been following along the beginners tutorials. First came the barebones which I compiled and modified without a hitch. Now I'm on the Meaty Skeleton tutorial and I'm having some trouble with building the provided tutorial. Unless I'm mistaken, the code provided in the tutorial should be enough to compile and display a short message on the screen. I'm running into some trouble with regards to building libc.a. When I run build.sh I eventually run into the following error:

Code: Select all

blah blah compiling...
make: *** No rule to make target '\', needed by 'libc.a'.  Stop.
make: Leaving directory '/home/daniel/documents/Programming/OSDev/dosdos/libc'
A full dump is available here: http://pastebin.com/vVMzDWDq

At first, I thought the issue was an accidental typo on my part in libc's Makefile, but I've checked and rechecked and copy-pasted from the wiki.

Then I thought that maybe a file was in the wrong place. At the bottom of this post is a layout of my project's directories and files. As far as I can tell, they are identically laid out to those in the tutorial (With the exception of the GPL Licensing folder I've added).

If it makes any difference, I'm running 64 bit Arch Linux with GNU Make version 4.1

Could anyone help me with this?

Code: Select all

.
├── build.sh
├── clean.sh
├── config.sh
├── default-host.sh
├── headers.sh
├── iso.sh
├── kernel
│   ├── arch
│   │   └── i386
│   │       ├── boot.S
│   │       ├── crti.S
│   │       ├── ctrn.S
│   │       ├── linker.ld
│   │       ├── make.config
│   │       └── tty.c
│   ├── include
│   │   └── kernel
│   │       ├── tty.h
│   │       └── vga.h
│   ├── kernel
│   │   └── kernel.c
│   └── Makefile
├── libc
│   ├── arch
│   │   └── i386
│   │       └── make.config
│   ├── include
│   │   ├── stdio.h
│   │   ├── stdlib.h
│   │   ├── string.h
│   │   └── sys
│   │       └── cdefs.h
│   ├── Makefile
│   ├── stdio
│   │   ├── printf.c
│   │   ├── putchar.c
│   │   └── puts.c
│   ├── stdlib
│   │   └── abort.c
│   └── string
│       ├── memcmp.c
│       ├── memcpy.c
│       ├── memmove.c
│       ├── memset.c
│       └── strlen.c
├── license
│   ├── COPYING.txt
│   └── GPL Header.txt
├── qemu.sh
└── target-triplet-to-arch.sh

15 Directories, 35 Files
User avatar
eryjus
Member
Member
Posts: 286
Joined: Fri Oct 21, 2011 9:47 pm
Libera.chat IRC: eryjus
Location: Tustin, CA USA

Re: Problem building Meaty Skeleton tutorial

Post by eryjus »

You have a backslash ("\") in the error message, which is uncharacteristic for a Linux separator.
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
Sanchezman
Posts: 18
Joined: Wed Nov 12, 2014 3:48 pm

Re: Problem building Meaty Skeleton tutorial

Post by Sanchezman »

I did notice that. It's what prompted me to check the file stricture as well as the makefiles.

Here is my libc makefile http://pastebin.com/k6dnQKHL. I've taken it directly from the tutorial. I have absolutely no clue what could be causing it.

Thanks to eryjus I removed the two \'s in libc's make.config which allowed me to compile libc.

UPDATE

Now I'm faced with a somewhat similar issue with the kernel's makefile. I get the error:

Code: Select all

make: *** No rule to make target 'arch/i386/crtn.o', needed by 'myos.kernel'.  Stop.
Of course, looking at the kernel's make.config doesn't suggest that the same solution would work.

make.config

Code: Select all

KERNEL_ARCH_CFLAGS:=
KERNEL_ARCH_CPPFLAGS:=
KERNEL_ARCH_LDFLAGS:=
KERNEL_ARCH_LIBS:=
 
KERNEL_ARCH_OBJS:= \
$(ARCHDIR)/boot.o \
$(ARCHDIR)/tty.o \
Pertinent excerpt from the kernel's makefile:

Code: Select all

OBJS:= \
$(KERNEL_ARCH_OBJS) \
kernel/kernel.o \

CRTI_OBJ:=$(ARCHDIR)/crti.o 
CRTBEGIN_OBJ:=$(shell $(CC) $(CFLAGS) $(LDFLAGS) -print-file-name=crtbegin.o) 
CRTEND_OBJ:=$(shell $(CC) $(CFLAGS) $(LDFLAGS) -print-file-name=crtend.o) 
CRTN_OBJ:=$(ARCHDIR)/crtn.o 

ALL_OUR_OBJS:= \
$(CRTI_OBJ) \
$(OBJS) \
$(CRTN_OBJ) \

OBJ_LINK_LIST:= \
$(CRTI_OBJ) \
$(CRTBEGIN_OBJ) \
$(OBJS) \
$(CRTEND_OBJ) \
$(CRTN_OBJ) \

all: myos.kernel

.PHONY: all clean install install-headers install-kernel

myos.kernel: $(OBJ_LINK_LIST) $(ARCHDIR)/linker.ld
	$(CC) -T $(ARCHDIR)/linker.ld -o $@ $(CFLAGS) $(OBJ_LINK_LIST) $(LDFLAGS) $(LIBS)
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Problem building Meaty Skeleton tutorial

Post by sortie »

You have whitespace issues.The wiki markup can be silly. Use the view source feature to get the real version. The backslash characters must be the last on their lines.
Sanchezman
Posts: 18
Joined: Wed Nov 12, 2014 3:48 pm

Re: Problem building Meaty Skeleton tutorial

Post by Sanchezman »

The whitespace errors have been fixed, but now I'm getting:

Code: Select all

i686-elf-gcc: error:  kernel/kernel.o: No such file or directory
Makefile:55: recipe for target 'myos.kernel' failed
make: *** [myos.kernel] Error 1
It's strange, because the file is there in the proper directory and make does indeed build kernel/kernel.o out of kernel/kernel.c. If it weren't, I'd be getting an error saying: "there is no rule for 'PATH_TO_NONEXISTENT_FILE' ", right? I've tried looking up the error both online and in the GNU Make manual, but I can't really find any explanation as to what it means. Does it mean that make can't find where it's supposed to put kernel.o?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Problem building Meaty Skeleton tutorial

Post by sortie »

Did you put the kernel.c file at kernel/kernel.c or kernel/kernel/kernel.c? What is the current directory? Attach a copy of tree(1)'s output again also.

Compare also with https://gitorious.org/sortie/myos/, a little example OS on which I based meaty skeleton.
Sanchezman
Posts: 18
Joined: Wed Nov 12, 2014 3:48 pm

Re: Problem building Meaty Skeleton tutorial

Post by Sanchezman »

Thanks for the link to your code. After looking over your initial commits, I found that there were indeed minute whitespace errors in a few different files.
Post Reply