OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:09 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [SOLVED] GCC suddenly can't find kernel.o
PostPosted: Tue Apr 04, 2017 11:00 am 
Offline

Joined: Tue Apr 04, 2017 10:05 am
Posts: 3
Hello,
I followed the video tutorial from the wiki on how to build the GCC cross compiler with cygwin on Windows and I used the Meaty Skeleton page to structure the folders, so basically I have the same structure as on the wiki page.
Everything worked fine, I modified the Hello world program and added some stuff like color changing and automatic scroll down, added %d and hex support to printf and stuff like that.

Then I started following the GDT and IDT section of the James Molloy tutorial and I created a VS solution so I can use a decent editor (was using np++) and for a while it compiled fine but I must have messed something up along the way because now GCC says it can't find kernel/kernel.o:
Screenshot
Even though kernel.o is there and it is being generated because when i run build.sh the file is recreated when i delete it.
Obviously I had to modify the ASM files to work with GCC and it seems that I fixed all the errors.

I tried messing with the Makefile but if i try to change the path there, make will output that there are missing rules to make the object (or something like that, it's translated).

My Makefile right now is exactly the same as the one on the wiki, I didn't even change the "myos" name anywhere. And before I started adding the new files from the James Molloy tutorial the kernel compiled fine, maybe I creating a VS solution did some damage?
I tried excluding the new files from the build (see below) as the GDT part was not even implemented in the kernel yet but it still throws that error.

Also, to make new C files work i have to manually add them to the makefile.conf file like that:
KERNEL_ARCH_OBJS=\
$(ARCHDIR)/boot.o \
$(ARCHDIR)/tty.o \
$(ARCHDIR)/common.o \
$(ARCHDIR)/gdt.o \
$(ARCHDIR)/interrupt.o \
$(ARCHDIR)/isr.o \
$(ARCHDIR)/descriptor_tables.o \

Is this the right way to do that?

Is there something more I need to provide? I can't figure out what caused this problem.
Thanks.


Last edited by sirbounce on Tue Apr 04, 2017 1:22 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: GCC suddenly can't find kernel.o
PostPosted: Tue Apr 04, 2017 12:14 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
=D> :wink:
sirbounce wrote:
KERNEL_ARCH_OBJS=\
$(ARCHDIR)/boot.o \
$(ARCHDIR)/kernel.o \ //Where is this?
$(ARCHDIR)/tty.o \
$(ARCHDIR)/common.o \
$(ARCHDIR)/gdt.o \
$(ARCHDIR)/interrupt.o \
$(ARCHDIR)/isr.o \
$(ARCHDIR)/descriptor_tables.o \

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
 Post subject: Re: GCC suddenly can't find kernel.o
PostPosted: Tue Apr 04, 2017 12:24 pm 
Offline

Joined: Tue Apr 04, 2017 10:05 am
Posts: 3
octacone wrote:
=D> :wink:
sirbounce wrote:
$(ARCHDIR)/kernel.o \ //Where is this?

kernel.o gets added later in the Makefile, that list is from arch/i386/make.conf, while in the root Makefile it looks like this:
Code:
KERNEL_OBJS=\
$(KERNEL_ARCH_OBJS) \
kernel/kernel.o \

So yeah it is there


Top
 Profile  
 
 Post subject: Re: GCC suddenly can't find kernel.o
PostPosted: Tue Apr 04, 2017 1:02 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
sirbounce wrote:
Hello,
I followed the video tutorial from the wiki on how to build the GCC cross compiler with cygwin on Windows


The what?

checks the page

Huh. I never noticed that there.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: GCC suddenly can't find kernel.o
PostPosted: Tue Apr 04, 2017 1:03 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 03, 2008 4:13 am
Posts: 153
Location: Ogre, Latvia, EU
In your screenshot there's a backslash (\) character before kernel/kernel.o

I think linker searches for a file named ' kernel/kernel.o' (note the space character).

_________________
If something looks overcomplicated, most likely it is.


Top
 Profile  
 
 Post subject: Re: GCC suddenly can't find kernel.o
PostPosted: Tue Apr 04, 2017 1:22 pm 
Offline

Joined: Tue Apr 04, 2017 10:05 am
Posts: 3
Velko wrote:
In your screenshot there's a backslash (\) character before kernel/kernel.o

I think linker searches for a file named ' kernel/kernel.o' (note the space character).

Wow, that was it #-o
I fixed it by removing the last backslash in the KERNEL_ARCH_OBJS list.
Thank you so much!

Schol-R-LEA wrote:
sirbounce wrote:
Hello,
I followed the video tutorial from the wiki on how to build the GCC cross compiler with cygwin on Windows

The what?

checks the page

Huh. I never noticed that there.

Yeah it took me some time to notice that too


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 29 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