diff --git a/head.S b/head.S index 0a8571d..8e13197 100644 --- a/head.S +++ b/head.S @@ -33,8 +33,9 @@ GLOBAL(sl_header) .word _entry /* SL header SKL offset to code start */ - .word bootloader_data /* SL header SKL measured length */ - .word skl_info + .word _end_of_measured /* SL header SKL measured length */ + .word skl_info /* Offset to SKL info with UUID and version */ + .word bootloader_data /* Offset to SLRT filled by the bootloader */ ENDDATA(sl_header) .text diff --git a/include/boot.h b/include/boot.h index 7329ecf..6f322d6 100644 --- a/include/boot.h +++ b/include/boot.h @@ -43,8 +43,9 @@ extern const char _start[]; typedef struct __packed sl_header { u16 skl_entry_point; - u16 bootloader_data_offset; + u16 skl_measured_size; u16 skl_info_offset; + u16 bootloader_data_offset; } sl_header_t; extern sl_header_t sl_header; diff --git a/link.lds b/link.lds index 82c4723..c8e33b7 100644 --- a/link.lds +++ b/link.lds @@ -33,6 +33,8 @@ SECTIONS *(SORT_BY_ALIGNMENT(.rodata*)) } + _end_of_measured = .; + .bss : { . = ALIGN(4096); _bss = .; @@ -47,18 +49,13 @@ SECTIONS _ebss = .; } - .skl_info : { - *(.skl_info) - } - - . = ALIGN(8); - /* * Bootloader must pass non-constant data (e.g. address of zeropage). Keep * it in separate section, outside of measured part of SL. This must be * done in order to keep hashes constant, it also allows us to measure SL * offline. */ + . = ALIGN(4); .bootloader_data : { *(.bootloader_data) }