OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:58 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [SOLVED] - Doubts when building libgcc -mcmodel=kernel
PostPosted: Mon Feb 25, 2019 10:07 pm 
Offline
User avatar

Joined: Mon Feb 25, 2019 9:26 pm
Posts: 3
Hi, I'm new to the community. I'm taking my first steps in the study and development of an OS.
In the readings of the osdev wiki there is something that is not clear to me in the Building libgcc for mcmodel=kernel https://wiki.osdev.org/Building_libgcc_for_mcmodel%3Dkernel.

The question I have is:
   I have to build two libgcc?
   If I have to do this, then I have to build two gcc?
   If this is so, do I have to build two binutils?

On the other hand, from what I have understood so far:
   -mcmodel=kernel, as its name implies is used for kernel's compilation?
   -mcmodel=large is used for compilations of user mode applications?
   in both cases they are used to make compilations for different objective platforms. Right?

Thanks in advance for your answers.


Last edited by remizero on Sat Mar 02, 2019 6:12 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Doubts when building libgcc -mcmodel=kernel
PostPosted: Tue Feb 26, 2019 5:17 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
remizero wrote:
I have to build two libgcc?

Yes, but I think you can use the multilib system to do it. The documentation for that is here and a guide for setting it up is here.

remizero wrote:
If I have to do this, then I have to build two gcc?

If you use multilib, you only need one GCC. Otherwise, you'll have to build two.

remizero wrote:
If this is so, do I have to build two binutils?

No.

remizero wrote:
-mcmodel=kernel, as its name implies is used for kernel's compilation?

It's used for higher-half kernels, where all code and statically-allocated data is in the highest 2GB of the virtual address space. If your kernel is not located there, you must use a different memory model.

remizero wrote:
-mcmodel=large is used for compilations of user mode applications?

It can be, but it's only really useful if you need more than 2GB of address space for your code and static data. The generated code is slightly less efficient, too. The default -mcmodel=small works best in most cases.

remizero wrote:
in both cases they are used to make compilations for different objective platforms. Right?

I don't understand the question. What is an "objective platform"?


Top
 Profile  
 
 Post subject: Re: Doubts when building libgcc -mcmodel=kernel
PostPosted: Wed Feb 27, 2019 12:37 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
Octocontrabass wrote:
remizero wrote:
remizero wrote:
in both cases they are used to make compilations for different objective platforms. Right?

I don't understand the question. What is an "objective platform"?


I believe remizero means 'objective' in the sense of 'goal', here, not in the sense of 'not subjective', so 'target platform' would be the more typical wording.

_________________
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: Doubts when building libgcc -mcmodel=kernel
PostPosted: Wed Feb 27, 2019 8:26 pm 
Offline
User avatar

Joined: Mon Feb 25, 2019 9:26 pm
Posts: 3
Thanks for such a quick response.

Exactly that's what I meant Schol-R-LEA, sorry for my poor English :(
What I meant was target platform, but it does not matter anymore, your explanation has been a great help to move forward and clear doubts.

But now the next question arises.

Working even from my host system, then I would not need another gcc to compile applications in user space, right?

therefore the question of whether to build two gcc


Top
 Profile  
 
 Post subject: Re: Doubts when building libgcc -mcmodel=kernel
PostPosted: Thu Feb 28, 2019 6:38 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5100
remizero wrote:
Working even from my host system, then I would not need another gcc to compile applications in user space, right?

That's right.


Top
 Profile  
 
 Post subject: Re: [SOLVED] - Doubts when building libgcc -mcmodel=kernel
PostPosted: Sat Mar 02, 2019 6:13 pm 
Offline
User avatar

Joined: Mon Feb 25, 2019 9:26 pm
Posts: 3
Thanks for a lot


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: Majestic-12 [Bot] and 52 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