Page 1 of 3
Need help! Please help me!
Posted: Tue Jul 18, 2006 1:55 pm
by Jojje
Look i am making a OS in C but there is a problem i dunno how to link it or how to compile and stuff and i've tried to do it over 2 days now and its getting "pritty" irritating, lol
Could someone that is experienced in this kind of stuff help me, please
Either you post here or please add me in MSN Messenger
[email protected]
-Jojje
Re:Need help! Please help me!
Posted: Tue Jul 18, 2006 1:57 pm
by Jojje
Oh, sorry i forgot to tell you "Thank you" in advanced
Re:Need help! Please help me!
Posted: Tue Jul 18, 2006 8:59 pm
by GUEST
What compiler are you ussing? ???
Re:Need help! Please help me!
Posted: Tue Jul 18, 2006 10:47 pm
by Solar
Please click on the banner above (which reads "Mega-Tokyo.com"), and consult our FAQ, especially the
Foreword (
yes, read it!, the
BareBones tutorial, and the page
HowToAskQuestions...
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 4:48 am
by Jojje
I suck at reading i tried this Tutorial but i coudnt get it working. Please help me in MSN or something "plzzz"!
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 5:12 am
by Solar
Jojje wrote:
I suck at reading...
That means you are missing the most fundamental skill required for OS development... :-\
i tried this Tutorial but i coudnt get it working
Perhaps you should tell us what exactly went wrong, then. This is called "debugging" and is another very fundamental and required skill.
Please help me in MSN or something "plzzz"!
You know the saying, "give a man a fish and he has food for a day; teach him how to fish and he never has to go hungry again"? You are basically expecting people to spoon-feed you the fish here...
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 6:22 am
by Ryu
*tries to come up with his version of the quote*
"Give a man a code snipplet and hes made a program working in some way; teach him how to program and perhaps he can make an OS someday.."
Hey, that actually rhymes too..
Theres also a saying in my native tounge "learning how to learn", if you don't quite understand some parts of the tutorial then take a step back and research on the points that your not understanding. At least this way you've narrowed it down as much as you could resulting to questions which will probably get answered in the forum, something like "how can I write a kernel?" which will most likely gets you redirected back to the FAQ page. It'll also help if you tell us your compiler/assemblers and linker your writing in, please be more specific on what troubles you to understand in the tutorials.
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 8:56 am
by Jojje
The only thing i know is that i Wrote the Kernel i use an Fat12 Bootsector and i use Partcopy to put this things inside my diskett i do like this.
The kernel:
Code: Select all
void print( char * msg, unsigned int line )
{
unsigned char * vgamemory = ( unsigned char * ) 0xb8000;
unsigned int i = ( line * 80* 2 );
while( *msg != 0 )
{
vgamemory[ i ] = * msg;
* msg++;
++i;
vgamemory[ i ] = 0x07;
++i;
}
}
void clearscreen( )
{
unsigned char * vgamemory = ( unsigned char * ) 0xb8000;
unsigned int i = 0;
while( i < ( 80 * 25 * 2 ) )
{
vgamemory[ i ] = ' ';
++i;
vgamemory[ i ] = 0x07;
++i;
}
}
int main( void )
{
clearscreen( );
print( "< Fetco Operating System - v1.0 >", 0 );
print( "[ system ]: Ok, there wasn't any errors in the progress of the boot!", 1 );
}
And then the batch file to compile this stuff or what u should call it
:
Code: Select all
@echo off
echo Errors:
gcc -c _kernel_main.c -o _kernel_main.o
echo.
ld -e _main -o kernel.sys _kernel_main.o
echo.
ld -i -e _main -o kernel.sys _kernel_main.o
echo.
partcopy boot.bin 0 200 -f0
echo.
copy kernel.sys a:
echo ...
pause
And sorry i dont have the code for the bootsector
....
What is wrong maybe you guys coud help me out now please
When i mean i suck at reading i mean like i cant read large texts etc blablabla ( in english ).
Thank you in advanced
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 9:12 am
by Solar
*sigh*
Take a step back, look at what you've posted so far, and ask yourself how anyone could even guess at what your troubles are...
...especially since you did not mention what worked or didn't work for you.
We could guess that you work under Windows (as you are using partcopy). I assume that you did not build a cross-compiler (due to your reading allergy). Is that DJGPP you are using, or Cygwin, or something else?
We have no idea what "bootsector" you are using, and what it does before main() is entered. It might actually play the Tower of Hanoi and format your hard drive.
Your batch script first does a complete linking of kernel.sys, then a relocatable link of kernel.sys, which strikes me as odd.
And I don't think you actually got any of the criticism voiced by Ryu and myself. So I will use stronger wording, for your benefit: Get a good grip on English reading, using Google, how to ask questions in technical forums, and practice with a couple of "toy" applications before setting out to do OS work. Honestly, you will do yourself a favor.
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 9:15 am
by Jojje
I have made a lot of programs i know almost the whole C and C++ language but... I suck at linking i dont know a lot of computers and i am just asking for help why are u being so angry about it?
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 9:22 am
by Solar
Because all the information you are asking for is readily available, prepared and carefully edited over a span of several years, by the makers of e.g. the binutils manual and the OS FAQ (i.e., us here).
And you still haven't told us what isn't working with your setup...
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 9:26 am
by Jojje
Ops
I get this Messages from the Batch file
Theese are the problems:
Errors:
_kernel_main.o(.text+0xaf):_kernel_main.c: undefined reference to `_alloca'
_kernel_main.o(.text+0xb4):_kernel_main.c: undefined reference to `__main'
The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the v
olume is not corrupted.
0 file(s) copied.
...
Press any key to continue . . .
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 9:35 am
by Solar
Let me relativize that last post. If you want to do an OS project, there are huge amounts of texts you will have to read to get anywhere. Virtually all those texts are in English, and only very few of them are available in any other language. Some of those texts are contained in, or linked from, our FAQ. Being unable, or unwilling, to cope with such texts basically disqualifies anyone from doing OS development, because he would have to ask for every tidbit of information on forums and mailing lists - basically making other people to do their work for him.
This forum created itself a reputation of being a rather good place to come to with questions regarding OS development, or programming in general. However, that also means we get more than our share of "stupid" questions.
By "stupid" I dont want to say those who ask are stupid, just that their questions could be answered very easily, and have been answered before, lots and lots of times.
You grow weary of answering the same questions over and over, and you start writing FAQs, tutorials and manuals so the next time such a question comes up, you can simply point the person to that prepared texts - much less tiring for you, much more informative for the person doing the asking.
Imagine how it feels when someone replies with "I can't read all that, please talk me through this step by step for my convenience"...
So, try to come up with more specific questions. If it goes like, "what does the '-i' option of 'ld' do?", you should be smart enough to look that up in the manual. If you get some strange error message from ld, post it here with all the auxiliary information required (minimum set of info required to reproduce the error), and we will have a look at it. If you get some strange error message from your mysterious bootloader, you should get the idea that we cannot possibly help you with that without knowing that bootloader.
You see? We are not exactly "angry" at anyone. It is just that this thread was pretty unproductive so far...
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 9:40 am
by Solar
Jojje wrote:
Theese are the problems:
Errors:
_kernel_main.o(.text+0xaf):_kernel_main.c: undefined reference to `_alloca'
_kernel_main.o(.text+0xb4):_kernel_main.c: undefined reference to `__main'
Aaaahhhh! Now it makes sense.
You are using a toolchain (DJGPP or Cygwin, I suppose) that targets Windows. That means the binaries generated contain Windows-specific dependencies, like _alloca. This is mentioned in the FAQ... and in the FAQ you will find a tutorial on how to build a
GCC cross-compiler toolchain (which is the approach customarily recommended by us for Windows/Cygwin developers).
There are other ways to get around those dependencies - tricky command-line options, mostly - but we recommend the cross-compiler, because it will allow e.g. Linux users to easily reproduce any errors you might have further down the road without having to get their hands on a Windows machine. (Among many other advantages.)
Re:Need help! Please help me!
Posted: Wed Jul 19, 2006 10:53 am
by Kemp
Think someone's had a bit too much sugar today. Maybe a good idea to cut down on their ration of help in order to compensate.