Thank you!
I'm working on a project where I intend to do basically the same thing and
this will jumpstart that effort.

Greg

-----Original Message-----
From: sdcc-user-boun...@lists.sourceforge.net
[mailto:sdcc-user-boun...@lists.sourceforge.net] On Behalf Of Brandon
Fosdick
Sent: Wednesday, February 17, 2010 9:34 AM
To: sdcc-user@lists.sourceforge.net
Subject: Re: [Sdcc-user] Default linker script for mcs51?

I've had a request to add a writeup of my bootloader adventure to the
project wiki. Hopefully I'll get to it this weekend. I don't see a How-To
section on the front wiki page, anyone mind if I add it?

In case anyone is curious, or I'm too lazy to actually do the wiki bits,
here's the gist I made with the relevant crtstart.asm and Makefile:
http://gist.github.com/304594


On Feb 15, 2010, at 10:47 , Brandon Fosdick wrote:

> I think I figured it out.
> In addition to everything from my last message, I added a GSFINAL section
to crtstart.asm with an "ljmp _bootloader" instruction. That seems to have
put everything in the right place.
> 
> Thanks for the help
> 
> 
> -----Original Message-----
> From: Brandon Fosdick [mailto:bfosd...@movea.com] 
> Sent: Friday, February 12, 2010 4:53 PM
> To: sourceforge.br...@dse.nl; sdcc-user@lists.sourceforge.net
> Subject: Re: [Sdcc-user] Default linker script for mcs51?
> 
> Ok, that got me a little further. I renamed main() to bootloader() and
made a linker script that moves both HOME and CSEG. Then I made my own
crtstart.asm that puts " ljmp   __sdcc_gsinit_startup" at the reset vector,
and changes  __sdcc_gsinit_startup to jump to _bootloader instead of
__sdcc_program_startup. 
> 
> Compiling and linking all of that gives me output that seems to do what I
want. However, I noticed that main.asm has what appears to be code for
initializing global variables. And it seems that normally this code is run
after a jump to __sdcc_init_data and then there's a jump to
__sdcc_program_startup after the initialization is finished. When I changed
main() to bootloader() that last jump to __sdcc_program_startup went away.
> 
> I'm trying to figure out how to get that initialization code to run. I
can't jump to __sdcc_init_data because there's no jump after the
initialization that will get me back to _bootloader. Any suggestions?
> 
> (No worries, happens all the time)
> 
> -----Original Message-----
> From: Maarten Brock [mailto:sourceforge.br...@dse.nl]
> Sent: Thursday, February 11, 2010 10:39 PM
> To: sdcc-user@lists.sourceforge.net
> Subject: Re: [Sdcc-user] Default linker script for mcs51?
> 
> Brandon,
> 
> You could also rename your main() to mymain() and generate the necessary
startup code yourself in assembly.
> 
> (Sorry for misspelling your name earlier.)
> 
> Maarten
> 
>> 
>> On Feb 11, 2010, at 20:04 , Peter Van Epp wrote:
>> 
>>> On Thu, Feb 11, 2010 at 12:27:04PM +0100, Brandon Fosdick wrote:
>>>> Well, it looks like I spoke too soon. 
>>>> 
>>>> SDCC is still dumping some non-vector stuff in the GSINIT and HOME
segments. I see how I could use the linker to relocate GSINIT* segments to
someplace else (or modify the mcs51 library). But I don't see how to
relocate __sdcc_program_startup from HOME to CSEG. It doesn't seem to be
defined anywhere in the lib directory that was installed with SDCC.
>>> 
>>>     It is defined in main (and thus will be in the code generator 
>>> somewhere I expect), and called from 
>>> sdcc/device/lib/mcs51/crtstart.asm. I expect you would meed to 
>>> modify the code generator to do what you want (or modify main.asm by
hand).
>> 
>> 
>> I was afraid of that. I may take a stab at modifying the generator, just
for fun. Does anyone have a git mirror of the repository?
>> ----------------------------------------------------------------------
>> -------- SOLARIS 10 is the OS for Data Centers - provides features 
>> such as DTrace, Predictive Self Healing and Award Winning ZFS. Get 
>> Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev
>> _______________________________________________
>> Sdcc-user mailing list
>> Sdcc-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>> 
> 
> 
> 
>
----------------------------------------------------------------------------
--
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
> 
>
----------------------------------------------------------------------------
--
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
> 
>
----------------------------------------------------------------------------
--
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user


----------------------------------------------------------------------------
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to