[U-Boot] [PATCH 1/5] Add bmp_layout module for accessing BMP header data

Igor Grinberg grinberg at compulab.co.il
Tue Feb 5 12:38:55 CET 2013


On 02/05/13 11:57, Wolfgang Denk wrote:
> Dear Igor Grinberg,
> 
> In message <5110BDB2.8040800 at compulab.co.il> you wrote:
>>
>>> Yes, struct bmp_header is a packed array with non-natural order of
>>> entries; see also section "Bitmap file header" at [1]; we may consider
>>> this a really stupid thing to do, but we have to live with this fact.
>>
>> It was not that stupid in times of DOS and Win 3.1
>> when int was 16 bits long (and DRAM was 64K or even less)...
> 
> It was as stupid then, too.  At that time, a large number of systems
> with similar alignment requirements existed, and experience with these
> existed, too.
> 
> Do you remember the "The Ten Commandments for C Programmers"?  If not,
> look them up and check how old these are.  Note especially the ``All
> the world's a VAX'' part - this is exactly what we see here in
> operation.

Yep. Agreed on this.
Although, I don't know, if anyone of us would tell the same 20+ years ago...
It is now we can...

> 
> The design of the BMP header is just BRAINDEAD.

That is for sure.

> 
>>> Indeed, this should be documented.  And eventually the bmp command
>>> should print a warning message if it sees other alignment.
>>
>> Agreed on this also, but again what about the board brick case?
> 
> There is a ton of ways to brick a board.  Why should we add protection
> for one special case while we agree to leave the 50 other ways
> onfixed?

Because, I think this one is a bit different because of the bmp header
and also is of very high demand.

> 
>> Should we add the check for alignment and if it does not properly aligned
>> deny further bmp header processing along with printing a warning?
> 
> Why should we?  Who tells that this is not perfectly legal on the
> running system?

It might be perfectly legal, but we also consider a tons of work
explaining why and how this should be done (needless to mention the
amount of bricked boards).
Instead of simplifying the case, and I think this is a special case,
at least because of the high demand and user (who is not a programmer)
selectable address, you want us to teach the whole world about the bmp
header alignment issues?

> 
> 
> Let me repeat it: U-Boot is a boot loader.  It is not intended for
> meddling by avarage Johnny Loser, but for system programmers who know
> what they are doing. And anyone doing such things is well adviced to
> _test_ his settings on the command line before storing these for
> automatic use.  As I mentioned before, omitting such tests is a sin
> that carries with it its own punishment.

What are you trying to say?
Is it that the environment variables change and in particular
the splash screen installation _must_ be done by a programmer?
Hmm.. that does not sound good...


-- 
Regards,
Igor.


More information about the U-Boot mailing list