man読みましょうね
manを読むのは基本中の基本ですよね。
カーネルのような、そのまま実行可能なバイナリの作成方法が疑問だったので
色々調べてたら
manみればちゃんと載ってたorz
#そのものズバリではないけど
ld --oformat binary -Ttext .textの開始アドレス
これを指定してあげれば実行可能なバイナリが作れる。
ちなみにgccも含めると
gcc -Os -fno-common -fno-builtin -fomit-frame-pointer -c hello.c
ld -Ttext 0x0 -o hello hello.o --oformat binary
dd if=hello of=hello.img bs=512 count=1 seek=0 conv=sync
こうしてあげるとハローワールドできるバイナリが完成。
fddにでも突っ込めばブートできる。