Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > I want to know about C-startup Routine contents and its modification

Reply
Thread Tools

I want to know about C-startup Routine contents and its modification

 
 
Ramaraj
Guest
Posts: n/a
 
      10-20-2003
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


 
Reply With Quote
 
 
 
 
Morris Dovey
Guest
Posts: n/a
 
      10-20-2003
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

 
Reply With Quote
 
 
 
 
Dan Pop
Guest
Posts: n/a
 
      10-20-2003
In <QDOkb.615$(E-Mail Removed)> Morris Dovey <(E-Mail Removed)> 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: http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Morris Dovey
Guest
Posts: n/a
 
      10-21-2003
Dan Pop wrote:
> In <QDOkb.615$(E-Mail Removed)> Morris Dovey
> <(E-Mail Removed)> 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

 
Reply With Quote
 
Dan Pop
Guest
Posts: n/a
 
      10-21-2003
In <GY%kb.143$(E-Mail Removed)> Morris Dovey <(E-Mail Removed)> writes:

>Dan Pop wrote:
>> In <QDOkb.615$(E-Mail Removed)> Morris Dovey
>> <(E-Mail Removed)> 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: (E-Mail Removed)
 
Reply With Quote
 
Morris Dovey
Guest
Posts: n/a
 
      10-21-2003
Dan Pop wrote:
> In <GY%kb.143$(E-Mail Removed)> 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

 
Reply With Quote
 
Sandeep
Guest
Posts: n/a
 
      10-22-2003
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
 
Reply With Quote
 
Morris Dovey
Guest
Posts: n/a
 
      10-22-2003
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ant COPY task, want to copy the directory itself, not just its contents! dxd@ptc.com Java 6 01-12-2011 12:30 PM
Its a bird, its a plane, its.. um, an Attribute based System? thunk Ruby 14 04-03-2010 10:08 AM
Its a bird, its a plane, its.. um, an Attribute based System? thunk Ruby 0 04-01-2010 10:25 PM
Its a bird, its a plane, no ummm, its a Ruide thunk Ruby 1 03-30-2010 11:10 AM
if innerHTML used twice then it replaces the contents i want it to display all the contents virendra.amritkar@gmail.com Javascript 0 06-29-2007 08:13 AM



Advertisments