From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pantelis Antoniou Date: Mon, 21 Apr 2003 10:34:36 +0300 Subject: [U-Boot-Users] [PATCH] ARTOS boot support for u-boot In-Reply-To: <20030420135559.AC525C58B9@atlas.denx.de> References: <20030420135559.AC525C58B9@atlas.denx.de> Message-ID: <3EA39F0C.2050509@intracom.gr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: >Dear Pantelis, > >in message <3E9E9B5C.30904@intracom.gr> you wrote: > > >>The following patch against u-boot-0.3.0 adds support for booting ARTOS >>images >>using u-boot. ARTOS is a custom in-house operating system in use by my >>company. >> >> > >I will not add the patch for now, as it contains some severe >problems: > > Correct. > > >>+ /* >>+ * Booting an ARTOS kernel image + application >>+ */ >>+ >>+ /* place data at the top of memory */ >>+ top = gd->bd->bi_memstart + gd->bd->bi_memsize; >>+ >>+ /* first check the artos specific boot args, then the linux args*/ >>+ if ((s = getenv("abootargs")) == NULL && (s = getenv("bootargs")) == NULL) >>+ s = ""; >>+ >>+ /* get length of cmdline, and place it */ >>+ len = strlen(s); >>+ top = (top - (len + 1)) & ~0xF; >>+ cmdline = (char *)top; >>+ debug ("## cmdline at 0x%08lX ", top); >>+ strcpy(cmdline, s); >> >> >^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > >>+ /* copy bdinfo */ >>+ top = (top - sizeof(bd_t)) & ~0xF; >>+ debug ("## bd at 0x%08lX ", top); >>+ kbd = (bd_t *)top; >>+ memcpy(kbd, gd->bd, sizeof(bd_t)); >> >> >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >You cannot do that. U-Boot copies itself to the top of memory, so you >are overwriting U-Boot's data here. It was pure luck if this wrked >for you. but the behaviour is completely undefined. > >Please implement this in a way that is compatible to U-Boot's memory >map. > >Also, since this is a proprietary OS with a very limited propagation >I would like to ask to make the ARTOS boot code configurable, i. e. >add a #define so it can enabled it in the board config file, but will >not add to the code size for those systems that don't want it. > >Best regards, > >Wolfgang Denk > > > Points addressed with this patch. That it worked the first time was very lucky indeed. Regards -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: u-boot-0.3.0-artos-v2.patch Url: http://lists.denx.de/pipermail/u-boot/attachments/20030421/097e7518/attachment.txt