Re: Startup code
- From: "Jet Morgan" <jm@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 29 Jun 2005 14:19:15 +0100
"Meindert Sprang" <mhsprang@xxxxxxxxxxxxxxxxxxx> wrote in message
news:11c4uoqp2qdc8f5@xxxxxxxxxxxxxxxxxxxxx
> Again, all startup codes I have seen so far, were written in assembler.
> Probably because at startup time, there is no environment set up yet to
run
> compiled C code at all. But this only holds true with "my" definition of
> startup code, where the call to main() is not executed yet.
I tend to get some semblance of a limited C environment ready first, then
call something (in C) perhaps called _premain, which sets things up some
more
and then calls main. _premain would typically operate under certain
restrictions (like no/limited stack, no assumption that .bss is zeroed,
cpu running at a low clock speed. It then alters those and then calls
the real main().
Richard [in PE12]
.
- References:
- Startup code
- From: ravikumar . n
- Re: Startup code
- From: Jet Morgan
- Re: Startup code
- From: Meindert Sprang
- Re: Startup code
- From: Jet Morgan
- Re: Startup code
- From: Meindert Sprang
- Startup code
- Prev by Date: Re: Startup code
- Next by Date: Re: Startup code
- Previous by thread: Re: Startup code
- Next by thread: Re: Startup code
- Index(es):