LoginSignup
1
0

wslで、最小のカーネルをコンパイル その34

Posted at

概要

wslで、kernel.elfのコンパイル、やってみた。
さらに、上のkernel見つけたので、コンパイルしてみた。
俺言語インタープリタを、移植してみた。

写真

スクリーンショット 2024-03-29 061329.png

サンプルコード


void putchr(unsigned char c) {
	api_putchar(c);
}
void putint(int i) {
	char str[30];
	_sprintf(str, "%d ", i);
	api_putstr0(str);
}
void crlf() {
	api_putstr0("\n");
}
void HariMain(void) {
	char str[30];
	int i,
		j,
		k;
	api_putstr0("Ore Gengo v1.0\n");
	for ( ; ; )
	{
		j = api_getkey(1);
		if (j == 10)
		{
			crlf();
			WR(Ptr++, '\0');
			run();
		}
		else
		{
			putchr(j);
			WR(Ptr++, j);
		}
	}
	api_end();
}


以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0