This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Bug in crc32 routine?


On Thu, 2002-10-10 at 09:06, Andrew Lunn wrote:
> Hi Roland
> 
> The crc32 routine came originally from RedBoot. Gary will correct me
> if im wrong, but i don't think it was supposed to be compatible with
> anything in particular. Gary just wanted a CRC for the flash
> contents. Thats they only place its used. I thought the crc functions
> are useful all general, so made a package out of them.
> 
> If you want a CRC function that is compatible to something, use
> cyg_posix_crc32(). I have tested that and proved (on little endian at
> least) that it produces the same result as what the posix standard
> says.
> 
> Changing this function would not be nice. New Redboot would compile
> about false checksums, when strictly they are not.
> 

There's really no need to worry about keeping this the way it was.
I have no problem with code reuse or even "breaking" an existing
installation - the CRC's used by FIS are advisory only.  So, if we
can fix it and/or let RedBoot use a common routine, all the better.


> What we could do is add a new crc32, which is compatible to zlib's
> crc. This would be easy and not cause any backward compatibility
> problems. Does the zlib CRC function have an official name, or
> reference a standard? We can use that for a basis for the function
> name. 
> 

Maybe we can come up with a way to only have one (or at least fewer)
CRC routine which is can be compatible with all of the existing uses.
Note that this might not be 100% possible - I seem to recall that the
"crc" calculations used by X-modem are broken [for everyone in the 
world], but we would need to preserve that for compatibility.

>       Andrew
> 
> On Thu, Oct 10, 2002 at 04:54:28PM +0200, Roland Ca?ebohm wrote:
> > I think in the crc23 routine in the crc package is a bug.
> > If I use under linux the crc32 routine of the zlib I get not the same result 
> > as the one of eCos.
> > I have seen, that in the Samsung KS32C5000 ethernet driver is a crc32 routin 
> > too and it differs from the one off the crc package. After changing this 
> > routine like the one off the ethernet driver, I get the same result right.
> > As an attachment I send the patch.
> > 
> > Best regards
> > 
> > Roland Caßebohm
> 
> 
> 
> -- 
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]