Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: C++ without libraries, I need a reference...< Next Oldest | Next Newest >
mage492 Offline

Group: Members
Posts: 15
Joined: Jan. 2004
Posted: Feb. 15 2005,03:57 QUOTE

I've searched through man pages and google, without success, so perhaps someone could enlighten me...

To begin with, I'm one of those people that just has to know how things work.  If you start to think to yourself, "So what?" please bear with me.

Okay, almost all programs start with something to the effect of "include these libraries".  In c++, these libraries give the user many powerful functions, as well as more simple things like outputting text to a console.

Now, here's my question.  If you take away all of those libraries and functions, what are you left with?  What functions and operators are available?

I'm trying to make a tiny program that, when you turn on your computer, prints "hello world", on the screen.  I want to take an unused computer, dump this into the boot sector, and see it run.

This is being done for a few reasons.  First off, it would really give me a chance to learn about the boot process.  Second, because I would get to learn about programming without libraries (I have no illusions about the difficulty, but with enough persistence, reference books, and caffeine, I'm sure I can do it!).  Third, it might pave the way for bigger and better things.  Finally, because I can!

Thanks in advance!

Coming soon, to a server near you...

FoxMage Enterprises
Back to top
Profile PM 
mikshaw Offline

Group: Members
Posts: 4856
Joined: July 2004
Posted: Feb. 15 2005,07:08 QUOTE

I don't know much about programming, but I'm guessing that you really can't do anything without at least one or two includes.

Even a simple "hello world" needs iostream, which may need more includes itself.  C++ is an object-oriented programming language, which by definition uses various external files to do its work.

Back to top
Profile PM WEB 
clacker Offline

Group: Members
Posts: 570
Joined: June 2004
Posted: Feb. 15 2005,22:58 QUOTE

The short answer is sure you can do that.  No libraries needed.  You need to understand what the boot sector wants to see and then put your program where it needs to go.  You will need to put your text string into memory and make a BIOS call to write the text to the screen, and then probably set up an infinite loop after that to keep anything else from executing.

You need to look up boot sector layout and BIOS calls, and looking into the linux boot process might help too.
Back to top
Profile PM 
2 replies since Feb. 15 2005,03:57 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Quick Reply: C++ without libraries

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code