LoginSignup
1
0

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

Posted at

概要

wslで、kernel.elfのコンパイル、やってみた。
さらに、上のkernel見つけたので、コンパイルしてみた。
fizzbuzz、やってみた。

写真

image.png

サンプルコード

#include "apilib.h"
#include "stdlibc.h"

void HariMain(void) {
	char str[30];
	int i,
		j,
		k;
	for (i = 1; i < 101; i++)
	{
		if (i % 15 == 0)
		{
			api_putstr0("FizzBuzz ");
		}
		else if (i % 3 == 0)
		{
			api_putstr0("Fizz ");
		}
		else if (i % 5 == 0)
		{
			api_putstr0("Buzz ");
		}
		else
		{
			_sprintf(str, "%d ", i);
			api_putstr0(str);
		}
	}
	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