Title : How to write bootloader from scratch.
Re-studying the boot loader ....
Re-studying the boot loader ....
#define IH_OS_LINUX 5 /* Linux */
#define IH_CPU_ARM 2 /* ARM */
LA LA LA HA HA HA HA : Magic number :
#define IH_MAGIC 0x27051956 /* Image Magic Number */
Lol looks like a birthday date : 27th May 1956.
Abooo U-boot header :
typedef struct uboot_image_header {
uint32_t ih_magic; /* Image Header Magic Number */
uint32_t ih_hcrc; /* Image Header CRC Checksum */
uint32_t ih_time; /* Image Creation Timestamp */
uint32_t ih_size; /* Image Data Size */
uint32_t ih_load; /* Data Load Address */
uint32_t ih_ep; /* Entry Point Address */
uint32_t ih_dcrc; /* Image Data CRC Checksum */
uint8_t ih_os; /* Operating System */
uint8_t ih_arch; /* CPU architecture */
uint8_t ih_type; /* Image Type */
uint8_t ih_comp; /* Compression Type */
uint8_t ih_name[IH_NMLEN]; /* Image Name */
} uboot_image_header_t;
