Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
"Hello"を出力するサンプルを追加
- Loading branch information
0 parents
commit 9a38116
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*~ | ||
*.o | ||
*.bin | ||
*.dat | ||
*.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
AS = as | ||
|
||
.s.o: | ||
$(AS) -o $*.o $< | ||
|
||
all: fd.img | ||
|
||
fd.img: hello.o signature.dat | ||
objcopy -O binary hello.o hello.bin | ||
dd if=/dev/zero of=zero.dat bs=1 count=$$((510 - $$(stat -c%s hello.bin))) | ||
cat hello.bin zero.dat signature.dat > fd.img | ||
|
||
hello.o: hello.s | ||
|
||
signature.dat: | ||
bash -c 'echo -en "\x55\xaa" > signature.dat' | ||
|
||
clean: | ||
rm -f *~ *.o *.bin *.dat *.img | ||
|
||
run: fd.img | ||
qemu -fda fd.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.code16 | ||
|
||
/* ビデオモード設定(画面クリア) */ | ||
movw $0x0000, %ax | ||
int $0x10 | ||
|
||
/* 文字列出力 */ | ||
BOOTSEG = 0x07c0 | ||
movw $0x0000, %dx | ||
movw $5, %cx | ||
movw $0x0007, %bx | ||
movw $BOOTSEG, %ax | ||
movw %ax, %es | ||
movw $msg, %bp | ||
movw $0x1301, %ax | ||
int $0x10 | ||
|
||
end: | ||
jmp end | ||
|
||
msg: | ||
.ascii "Hello" |