view compal/osmovoodoo.c @ 215:d69f7512e3c1

Pirelli: documented and verified the checksum scheme used for the factory block
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Dec 2016 23:48:16 +0000
parents a39a38bbec4d
children
line wrap: on
line source

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

u_char data_hdr_c123[]    = { 0xee, 0x4c, 0x9f, 0x63 };

u_char data_hdr_c155[]    = { 0x78, 0x47, 0xc0, 0x46 };

u_char chainloader[] = {
	0x0a, 0x18, 0xa0, 0xe3, 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff,
	0x1a, 0x08, 0x10, 0x9f, 0xe5, 0x01, 0x2c, 0xa0, 0xe3, 0xb0, 0x20,
	0xc1, 0xe1, 0x00, 0xf0, 0xa0, 0xe3, 0x10, 0xfb, 0xff, 0xff,
};

char outfile[] = "osmovoodoo.bin";

main()
{
	FILE *f;

	f = fopen(outfile, "w");
	if (!f) {
		perror(outfile);
		exit(1);
	}
	fwrite(data_hdr_c123, 1, sizeof data_hdr_c123, f);
	fwrite(data_hdr_c155, 1, sizeof data_hdr_c155, f);
	fwrite(chainloader, 1, sizeof chainloader, f);
	fclose(f);
	exit(0);
}