2020-09-06 04:35:32 +03:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <gzip/tinf.h>
|
|
|
|
|
|
|
|
__attribute__((noreturn))
|
2020-09-18 23:15:27 +03:00
|
|
|
void entry(uint8_t *compressed_stage2, size_t stage2_size, uint8_t boot_drive) {
|
2020-09-06 06:15:55 +03:00
|
|
|
// The decompressor should decompress compressed_stage2 to address 0x4000.
|
2020-09-18 23:15:27 +03:00
|
|
|
uint8_t *dest = (uint8_t *)0x4000;
|
2020-09-06 04:35:32 +03:00
|
|
|
|
|
|
|
tinf_gzip_uncompress(dest, compressed_stage2, stage2_size);
|
|
|
|
|
|
|
|
__attribute__((noreturn))
|
|
|
|
void (*stage2)(uint8_t boot_drive) = (void *)dest;
|
|
|
|
|
|
|
|
stage2(boot_drive);
|
|
|
|
}
|