The Place to Start for Operating System Developers
It is currently Tue Sep 29, 2020 12:14 pm

All times are UTC - 6 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Tutorial Meaty Skeleton & -lk option
PostPosted: Tue Mar 17, 2020 12:48 pm 

Joined: Sat Aug 25, 2012 1:59 am
Posts: 13
Hi all,

OS dev newbie here.

I've followed the Meaty Skeleton tutorial and launched the ./iso.sh script.
During the compilation I received the following error:

i686-elf-gcc --sysroot=/home/username/test/os/test4/sysroot -isystem=/usr/include -T arch/i386/linker.ld -o myos.kernel -O2 -g -ffreestanding -fbuiltin -Wall -Wextra  arch/i386/crti.o /home/username/opt/cross/lib/gcc/i686-elf/9.2.0/crtbegin.o arch/i386/boot.o arch/i386/gdt.o arch/i386/idt.o arch/i386/interrupt-entry.o arch/i386/interrupt.o arch/i386/pic.o arch/i386/tty.o  kernel/kernel.o  /home/username/opt/cross/lib/gcc/i686-elf/9.2.0/crtend.o arch/i386/crtn.o     -nostdlib -lk -lgcc
/home/username/opt/cross/lib/gcc/i686-elf/9.2.0/../../../../i686-elf/bin/ld: cannot find -lk
collect2: error: ld returned 1 exit status
Makefile:55: recipe for target 'myos.kernel' failed
make: *** [myos.kernel] Error 1

If I got it right it seems ld doesn't find the k library.
I also searched inside the forum but I couldn't find anything.

Where is my mistake?


I'm going to answer to myself, should someone else be silly like me (it's hard I know).

1) I downloaded the source of the Meaty Skeleton from the git repository instead of using what is written under the web page of the Meaty Skeleton tutorial. First, because it was suggested to so in order to avoid "error-prone copy mistakes" and second the one on git seemed to me slightly more updated. The downloaded source contains an additional library never mentioned in the tutorial. In particular under libc/Makefile, line 52 the variable BINARIES is also assigned the library libg.a. Remove it. At lines 62 there is a relative rule of libg.a. Remove its entire rule.

2) Inside the shell script build.sh I left mistakenly the variable $SYSROOT. That came from the source from the online (here) tutorial of Meaty Skeleton that I has started to use before switching to the git ones. The git repository instead has used simply sysroot.

Additional Bonus:
In my case I couldn't install grub on wsl2 (I'm using it instead of an official distribution). I installed instead apt-get install grub-pc and it worked creating the iso image.

 Post subject: Re: Tutorial Meaty Skeleton & -lk option
PostPosted: Wed Sep 16, 2020 4:48 am 
User avatar

Joined: Tue Sep 15, 2020 8:07 am
Posts: 23
Location: London, UK
Ok, you have managed to get further than I did with the Meaty Skeleton.

when I run build.sh I just get the error:

Makefile:23: arch//make.config: No such file or directory
make: *** No rule to make target 'arch//make.config'. Stop.

I have always struggled with make... now after 20 years it's time to learn it, any clues as to where I'm going wrong would be most welcome.

Trying to build a single address space Microkernel for use in embedded applications...

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours

Who is online

Users browsing this forum: bloodline, Ethin, foliagecanine, Google [Bot], mrjbom, PeterX and 9 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group