Bootloader in C won't compile

后端 未结 5 1906
你的背包
你的背包 2021-01-30 04:30

I am a newbie in writing bootloaders. I have written a helloworld bootloader in asm, and I am now trying to write one in C. I have written a helloworld bootloader in C, but I ca

5条回答
  •  粉色の甜心
    2021-01-30 05:16

    Since you are using GCC, you should read the info pages about the different "target environments". You most probably want to use the -ffreestanding flag. Also I had to use -fno-stack-protector flags to avoid some ugly magic of the compiler.

    Then, you will get linker errors saying that memset and the like are not found. So you should implement your own version of these and link them in.

提交回复
热议问题