我正在尝试创建一个内核,我无法将C输出与程序集链接起来.的ld.我收到错误:
无法识别的仿真模式:elf_i386
我正在使用Windows 10专业版与MinGW32和MSYS.我正在使用的代码:
link.ld
/*
* link.ld
*/
OUTPUT_FORMAT(elf32-i386)
ENTRY(start)
SECTIONS
{
. = 0x100000;
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss) }
}
Run Code Online (Sandbox Code Playgroud)
kernel.c
/*
* kernel.c
*/
void kmain(void)
{
const char *str = "my first kernel";
char *vidptr = (char*)0xb8000; //video mem begins here.
unsigned int i = 0;
unsigned int j = 0;
/* this loops clears the screen
* there are 25 lines …Run Code Online (Sandbox Code Playgroud)