Hello, World! (Не Колибри)
Posted: Fri Apr 15, 2011 6:32 pm
мой привет миру
; сборка :
; gcc -c -ffreestanding -o kernel.o bootsector.S
; ld -o kernel.bin --oformat binary -Ttext 0x0000 kernel.o
; cat kernel.bin > /dev/fd0
.code 16
.text
jmp kernel_entry
kernel_entry:
cli
movw $0x7c0, %ax
movw %ax, %ds
movw $0x1000,%sp
sti
movw $hello_msg, %si
print_string:
movb (%si),%al
cmpb $0x00, %al
je kernel_exit
movb $0x0e, %ah
xorw %bx, %bx
int $0x10
incw %si
jmp print_string
kernel_exit:
hlt
jmp kernel_exit
hello_msg:
.asciz "Hello World!!!"
boot_signature:
.word 0xaa55
; сборка :
; gcc -c -ffreestanding -o kernel.o bootsector.S
; ld -o kernel.bin --oformat binary -Ttext 0x0000 kernel.o
; cat kernel.bin > /dev/fd0
.code 16
.text
jmp kernel_entry
kernel_entry:
cli
movw $0x7c0, %ax
movw %ax, %ds
movw $0x1000,%sp
sti
movw $hello_msg, %si
print_string:
movb (%si),%al
cmpb $0x00, %al
je kernel_exit
movb $0x0e, %ah
xorw %bx, %bx
int $0x10
incw %si
jmp print_string
kernel_exit:
hlt
jmp kernel_exit
hello_msg:
.asciz "Hello World!!!"
boot_signature:
.word 0xaa55