Why does the general program usually start at 0x8000?

OfusJK picture OfusJK · Mar 13, 2012 · Viewed 13.3k times · Source

I am not new to bootloader and system SW, but I don't know the origin of the reason why the general program starts at 0x8000. I already know the address 0x8000 has been used as start address in normal C/C++ program.

Does the minimum size of the bootloader for a general program take up to 0x8000? Or is the minimum block size of ROM that should be allocated to the bootloader 32KB? Or is there another reason?

I'd like to know about this, historically or logically, and from a virtual address point of view.


I appreciate all, your time and help with this. To make question more clear, the question is related with virtual address not with physical.

I basically agree with R's opinion from physical memory address point of view.

Without saying a specific system which is diverse, for example linux (even in android), general RTOS (nucleus, and the others, especially ARM linker section), they all use address 0x8000 as start address general program. such named as crt_begin.o, crt.o, etc located at 0x0 with loader exist in this area.

Therefore I guess the minimum size of the bootloader for general program is 32KB considering block size if it would be located at BootROM in boot time(cold boot).

Ummm, But I am not sure...

Answer

R.. GitHub STOP HELPING ICE picture R.. GitHub STOP HELPING ICE · Mar 13, 2012

In general, on all but the smallest embedded systems, the platform ABI designer wants to avoid ever having the lowest addresses in use so that null pointer dereferences can be trapped. Having several KB of never-valid addresses gives you some additional safety if the null pointer is dereferenced with an array or structure member offset, as in null_ptr->some_member.