Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   I want to know about C-startup Routine contents and its modification (http://www.velocityreviews.com/forums/t315858-i-want-to-know-about-c-startup-routine-contents-and-its-modification.html)

Ramaraj 10-20-2003 10:03 AM

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



Morris Dovey 10-20-2003 10:13 AM

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


Dan Pop 10-20-2003 02:38 PM

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

Morris Dovey 10-21-2003 01:23 AM

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


Dan Pop 10-21-2003 11:42 AM

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

Morris Dovey 10-21-2003 11:49 PM

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


Sandeep 10-22-2003 04:04 AM

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

Morris Dovey 10-22-2003 05:43 AM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57