baremetal: fix heap and stack position in preparation for CLI arguments

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-04-01 02:00:01 +00:00
parent 6bb20c0386
commit e25e79c26b
9 changed files with 58 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
/* https://cirosantilli.com/linux-kernel-module-cheat#baremetal-linker-script */
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
extern int32_t lkmc_argc;
extern int32_t lkmc_heap_low;
int main(int argc, char **argv) {
(void)argc;
(void)argv;
printf("&lkmc_heap_low %p\n", (void*)&lkmc_heap_low);
printf("&lkmc_argc %p\n", (void*)&lkmc_argc);
printf("lkmc_argc %" PRId32 "\n", lkmc_argc);
}