473,473 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Nov 13 '05 #1
6 5024
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

Nov 13 '05 #2
In <QD****************@news.uswest.net> Morris Dovey <mr*****@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: Da*****@ifh.de
Nov 13 '05 #3
In <GY*****************@news.uswest.net> Morris Dovey <mr*****@iedu.com> writes:
Dan Pop wrote:
In <QD****************@news.uswest.net> Morris Dovey
<mr*****@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: Da*****@ifh.de
Nov 13 '05 #4
Dan Pop wrote:
In <GY*****************@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

Nov 13 '05 #5
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
Nov 13 '05 #6
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

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: mr.iali | last post by:
Hi Everyone I would like to get into software developent using a programming language like c++, java or pl/sql for oracle. I have no idea where to start from. Which language is there more...
16
by: G Patel | last post by:
Hi, If I want to call functions that don't return int without declaring them, will there be any harm? I only want to assign the function(return value) to the type that it returns, so I don't...
10
by: Atul | last post by:
Hi, I just stepped into C#. I am facing one problem. Here is the scenario. I am posting some data to one website (https site). It returns me response HTML. I want to parse this HTML and want to...
4
by: Junjie Wang | last post by:
It seems the aspx always is saved in IE history, how to write aspx that make IE does not save it ? Thanks. -Junjie
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
1
by: _thedebugger | last post by:
Dear Friends, We are developing one wbesite in visual studio 2005 and sql server 2000. now my question is I want to seperate some modules on the website. Like 1. there will be few...
21
by: Russell Hoover | last post by:
I want to make sure that no border (around a specific small "blog-button" image) ever appears in FF or IE, or any other browswer. I couldn't seem do it with xhtml, so I reverted to border="0" ...
6
by: damod.php | last post by:
hai , friends, am new one to this group, I want to know About frame works in php Which one is best i want learn any one frame work can you help me Am workin in PHP MY SQL i want to learn it....
7
by: Gary | last post by:
Hello guys! Bear with me, I am a newbie. She is the Data Warehouse manager. She has about 50 users to use the Oracle database from M$ Access via ODBC connection. All those users have only...
8
by: =?GB2312?B?yum09MXt?= | last post by:
today I forgot to include some header,then I found the error message by the compiler is quite strange. so I want to know exactly the inner details of the compiler impletation,if possible. and I...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.