The bootloader of many Realtek switches only supports gzipped kernel images. With limited flash space that might get critical in future versions. For better compression allow support for compressed images. For this a new loader was developed. Several ideas have been taken over from the existing lzma loader but this has been enhanced to make integration simpler. What is new: - Loader is position independent. No need to define load addresses - Loader identifies device memory on its own - Loader uses "official" upstream kernel lzma uncompress https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/decompress_unlzma.c - Loader uses "official" UNMODIFIED nanoprintg that is used by several bare metal projects. https://github.com/charlesnicholson/nanoprintf Compiled the loader ist just under 12KiB and during boot it will show: rt-loader Found RTL8380M (chip id 6275C) with 256MB Relocate 2924240 bytes from 0x80100000 to 0x8fce0000 Extract kernel with 2900144 bytes from 0x8fce521c to 0x80100000... Extracted kernel size is 9814907 bytes Booting kernel from 0x80100000 ... [ 0.000000] Linux version 6.12.33 ... [ 0.000000] RTL838X model is 83806800 ... Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/18397 Signed-off-by: Robert Marko <robimarko@gmail.com>
14 lines
265 B
C
14 lines
265 B
C
/*
|
|
* rt-loader header
|
|
* (c) 2025 Markus Stockhausen
|
|
*/
|
|
|
|
#ifndef _BOARD_H_
|
|
#define _BOARD_H_
|
|
|
|
unsigned int board_get_memory(void);
|
|
void board_get_system(char *buffer, int len);
|
|
void board_panic(void);
|
|
void board_putchar(int ch, void *ctx);;
|
|
|
|
#endif // _BOARD_H_
|