Can I use GNU libstdc++ for OS Development?

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.
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Can I use GNU libstdc++ for OS Development?

Post by codemastersnake »

Hi all!

Well since I have started with the third version of Magneto, I was thinking whether it is feaseble to use libstdc++ or any other library for development of my OS.

To make it more clear, My question is that, As we define our own functions for doing anything right from printing onscreen or fetching key strokes from a keyboard, can we integrate libstdc++ and use it's defined function for development?
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Can I use GNU libstdc++ for OS Development?

Post by Love4Boobies »

It depends on how you implement your function. If not, you can port it to your OS. Check out the wiki to get an idea http://wiki.osdev.org/Porting_Newlib .
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by codemastersnake »

It's worth to read that article, But I wanted to know is there any library that is specially meant for developing an OS... I know I may sound stupid... but there's gotta be something...

To be specific: I want a library for my OS's Kernel Implementation. I don't want a cake walk, but if libstdc++ can be used then I could make my OS much generalised...
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by piranha »

Heres a library for kernels. I haven't used it, and I have no idea how to implement it, but I'm sure that infos on the site.

El Linko

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by codemastersnake »

Did looked at it... and it's do very well written.. but do't know about it's stability and it's not standard complaint....

Does any body know the answer of my question... please do tell
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by pcmattman »

You can port Newlib to work in your kernel - ie, link the library to your kernel. Then you simply port libstdc++ (which needs a libc, hence the Newlib port) and can use it in your kernel.

It also doesn't matter if your methods are a bit non-standard, as Newlib takes a set of glue functions that provide the functionality internally. All you'd need to do is link up the glue function with code to do it the way you want.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Can I use GNU libstdc++ for OS Development?

Post by bewing »

It sounds to me like you are asking about an OSKit. There are various ones around, but they all have little problems, and their licenses are generally not good.
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by codemastersnake »

bewing wrote:It sounds to me like you are asking about an OSKit. There are various ones around, but they all have little problems, and their licenses are generally not good.
exactly...

Though newlib idea seems good, But it's latest version was released in 2007... Thats why I was asking about stdlibc and stdlibc++...

Any other views?
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by AJ »

Hi,

I know you have been given the link to Porting Newlib, but have you seen the OS Specific Toolchain article? That goes through a number of steps including porting libstdc++ (and libsupc++).

Cheers,
Adam
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by Combuster »

But it's latest version was released in 2007
Like, its not infested with bugs that warrants a montly release cycle 8)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by codemastersnake »

AJ wrote:Hi,

I know you have been given the link to Porting Newlib, but have you seen the OS Specific Toolchain article? That goes through a number of steps including porting libstdc++ (and libsupc++).

Cheers,
Adam
A very informative article. May be I am wrong but it teaches how to port libc or libc++ to your os along with gcc so that I would be able to develop c/c++ programs on my OS...
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by AJ »

Hi,

That's correct - once you have a text editor, your os would be completely self-hosted.

Cheers,
Adam
kubeos
Member
Member
Posts: 138
Joined: Tue Jan 30, 2007 2:31 pm
Location: Kamloops BC, CANADA
Contact:

Re: Can I use GNU libstdc++ for OS Development?

Post by kubeos »

I wouldn't recommend using Oslib or any other kernel library unless you intend to go with a GPL license. I went down that road and when my filesystem was done, I decided I didn't want the GPL. So I've spent a lot of time getting rid of OSLib and replacing it with my own routines.

Another problem I found early on with OSLib itself is that it would boot fine with Bochs but would GPF on a real computer. So my recommendation is to use one of the tutorial kernel's if you are a beginner. As a side note though, the math library that comes with it is pretty good, and not under GPL.
User avatar
i586coder
Member
Member
Posts: 143
Joined: Sat Sep 20, 2008 6:43 am

Re: Can I use GNU libstdc++ for OS Development?

Post by i586coder »

HI, Snake:

I am glade to hear some one asked my question

In fact it's hard to find OS lib's that quite what you need
I tried Linux lib's but still hard for me understanding many functions,..,SO i decide to develop my own Lib's :wink: and coded what i need (work in progress):
-FAT12
-mouse driver:serial,ps/2
-console I/O
-hardware detection

If you found any open-source OS lib's,please let me know
:!:
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
Post Reply