![]() |
I want to know about C-startup Routine contents and its modification
Hi All,
I am very interest to know the c-startup routine (like GNU gcc C-startup routine). and it s working principle and How this function is attached to operating system Thanks in adavance. with regards Ramaraj |
Re: [OT] C-startup Routine
Ramaraj wrote:
> I am very interest to know the c-startup routine (like GNU gcc > C-startup routine). and it s working principle and How this > function is attached to operating system Ramaraj... The startup function is platform/implementation specific and not a standardized part of the C language. Why not take a look at the compiler and library documentation? For gcc, you can actually look at the source code and answer your own question more quickly than anyone here could provide you with a complete answer. -- Morris Dovey West Des Moines, Iowa USA C links at http://www.iedu.com/c |
Re: [OT] C-startup Routine
In <QDOkb.615$BF1.4471@news.uswest.net> Morris Dovey <mrdovey@iedu.com> writes:
>Ramaraj wrote: > >> I am very interest to know the c-startup routine (like GNU gcc >> C-startup routine). and it s working principle and How this >> function is attached to operating system > >Ramaraj... > >The startup function is platform/implementation specific and not >a standardized part of the C language. Why not take a look at the >compiler and library documentation? In my experience, people asking this kind of questions should better spend their time actually learning C. By the time you actually understand what really C is about, the interest for such issues is very likely to vanish: as a C programmer, you couldn't care less. By the time you're confronted with writing a C startup module yourself, you have enough clues to realise that c.l.c is one of the last newsgroups to ask for help. Dan -- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de |
Re: [OT] C-startup Routine
Dan Pop wrote:
> In <QDOkb.615$BF1.4471@news.uswest.net> Morris Dovey > <mrdovey@iedu.com> writes: > >> Ramaraj wrote: >> >>> I am very interest to know the c-startup routine (like GNU >>> gcc C-startup routine). and it s working principle and How >>> this function is attached to operating system >> >> Ramaraj... >> >> The startup function is platform/implementation specific and >> not a standardized part of the C language. Why not take a >> look at the compiler and library documentation? > > In my experience, people asking this kind of questions should > better spend their time actually learning C. By the time you > actually understand what really C is about, the interest for > such issues is very likely to vanish: as a C programmer, you > couldn't care less. True - except that at one point I found myself writing a startup function for an embedded system (along with the code to produce argc and argv along with a split 'shell', half of which ran on an NT system and half on the SoC under test). > By the time you're confronted with writing a C startup module > yourself, you have enough clues to realise that c.l.c is one > of the last newsgroups to ask for help. /Usually/ true. I didn't search to see if Ramaraj is new to c.l.c - I just assumed that he found himself in a situation similar to that described above. Note that /I/ didn't bring my issue to c.l.c - although I did e-mail a c.l.c regular (after consulting several of my favorite search engines) to ask if he was aware of any available solutions to a related device usage problem. -- Morris Dovey West Des Moines, Iowa USA C links at http://www.iedu.com/c |
Re: [OT] C-startup Routine
In <GY%kb.143$bc4.49274@news.uswest.net> Morris Dovey <mrdovey@iedu.com> writes:
>Dan Pop wrote: >> In <QDOkb.615$BF1.4471@news.uswest.net> Morris Dovey >> <mrdovey@iedu.com> writes: >> >>> Ramaraj wrote: >>> >>>> I am very interest to know the c-startup routine (like GNU >>>> gcc C-startup routine). and it s working principle and How >>>> this function is attached to operating system ^^^ >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>> Ramaraj... >>> >>> The startup function is platform/implementation specific and >>> not a standardized part of the C language. Why not take a >>> look at the compiler and library documentation? >> >> In my experience, people asking this kind of questions should >> better spend their time actually learning C. By the time you >> actually understand what really C is about, the interest for >> such issues is very likely to vanish: as a C programmer, you >> couldn't care less. > >True - except that at one point I found myself writing a startup >function for an embedded system (along with the code to produce >argc and argv along with a split 'shell', half of which ran on an >NT system and half on the SoC under test). > >> By the time you're confronted with writing a C startup module >> yourself, you have enough clues to realise that c.l.c is one >> of the last newsgroups to ask for help. > >/Usually/ true. I didn't search to see if Ramaraj is new to c.l.c >- I just assumed that he found himself in a situation similar to >that described above. Nope, he was explicitly talking about hosted implementations, where one seldom gets to write a startup module. See the underlined text above. Freestanding implementations are a completely different issue, as each case has unique requirements: - is there any main function? - if yes, does it take any arguments? - is there any initialisation code executed before the startup module? - is the program supposed to ever terminate? - etc etc etc Dan -- Dan Pop DESY Zeuthen, RZ group Email: Dan.Pop@ifh.de |
Re: [OT] C-startup Routine
Dan Pop wrote:
> In <GY%kb.143$bc4.49274@news.uswest.net> Morris Dovey >>> >>>> Ramaraj wrote: >>>> >>>>> I am very interest to know the c-startup routine (like >>>>> GNU gcc C-startup routine). and it s working principle >>>>> and How this function is attached to operating system >>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Nope, he was explicitly talking about hosted implementations, > where one seldom gets to write a startup module. See the > underlined text above. Oops! You're right (bad assumption on my part) - thanks for underlining. Suddenly I'm in complete agreement. :-) -- Morris Dovey West Des Moines, Iowa USA C links at http://www.iedu.com/c |
Re: I want to know about C-startup Routine contents and its modification
The C startup routine does the following:
- Initialize all global variables to 0 - Call standard library init - Prepares argc and argv - Calls main Sandeep -- http://www.EventHelix.com/EventStudio EventStudio 2.0 - Generate Message Sequence Charts in PDF |
Re: [still OT] C-startup Routine
Sandeep wrote:
> The C startup routine does the following: > - Initialize all global variables to 0 > - Call standard library init > - Prepares argc and argv > - Calls main Sandeep... Perhaps (more or less; possibly more /and/ less :-) [less] One would hope that the compiler emits code that pre-initializes all globals; [more] If the startup function calls main directly, then it will also need to provide for main's return. This /is/ off-topic for comp.lang.c because nearly every aspect of the subject is platform/implementation dependent; and the OP's question has nothing to do with the C language itself; but rather with a particular implementation (gcc) whose startup function is likely to vary at least somewhat for each target platform. Since the OP didn't specify a platform, providing a list of specifics is almost certainly a misleading response - however well-intended. -- Morris Dovey West Des Moines, Iowa USA C links at http://www.iedu.com/c |
| All times are GMT. The time now is 09:34 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.