Initial commit

This commit is contained in:
Alexander Myltsev 2022-09-21 16:53:45 +03:00
commit 298d1be60c
3 changed files with 41 additions and 0 deletions

12
Makefile Normal file
View File

@ -0,0 +1,12 @@
AS=x86_64-elf-as
LD=x86_64-elf-ld
run: mbr.bin
qemu-system-i386 -drive format=raw,file=$<
%.o: %.S
$(AS) $^ -o $@
mbr.bin: mbr.o
$(LD) -Ttext=0x7c00 --oformat=binary $^ -o $@

1
README.md Normal file
View File

@ -0,0 +1 @@
Yet Another BootLoader, OS Kernel and Other stuff

28
mbr.S Normal file
View File

@ -0,0 +1,28 @@
.code16
.global _start
_start: #точка входа
mov $banner, %si
call print_string
jmp . // loop forever
print_string:
mov $0x0e, %ah // "teletype output"
repeat:
lodsb // equivalent to mov (%si), %al; inc %si
test %al, %al
je done
int $0x10 // bios interrupt
jmp repeat
done:
ret
. = _start + 256 # pad to 256 bytes
banner:
.asciz "YABLOKO bootloader started\r\n"
. = _start + 510 # pad to 510 bytes
.byte 0x55, 0xaa # boot sector magic value