add kernel
This commit is contained in:
@@ -1,34 +0,0 @@
|
|||||||
%define cr 0x0a
|
|
||||||
%define lf 0x0d
|
|
||||||
%define endl 0x0
|
|
||||||
|
|
||||||
; Reads a character
|
|
||||||
; out:
|
|
||||||
; al = asci character
|
|
||||||
; ah = scan code
|
|
||||||
read_char:
|
|
||||||
mov ah, 0
|
|
||||||
int 0x16
|
|
||||||
ret
|
|
||||||
|
|
||||||
; Prints a character
|
|
||||||
; in:
|
|
||||||
; al = asci character to print
|
|
||||||
print_char:
|
|
||||||
mov ah, 0x0e
|
|
||||||
int 0x10
|
|
||||||
ret
|
|
||||||
|
|
||||||
; Prints a null terminated string
|
|
||||||
; in:
|
|
||||||
; si = null terminated string pointer
|
|
||||||
print_line:
|
|
||||||
.loop:
|
|
||||||
cmp byte [si], 0
|
|
||||||
je .done
|
|
||||||
mov al, [si]
|
|
||||||
call print_char
|
|
||||||
inc si
|
|
||||||
jmp .loop
|
|
||||||
.done:
|
|
||||||
ret
|
|
||||||
10
makefile
10
makefile
@@ -1,8 +1,8 @@
|
|||||||
boot/boot.bin: boot/boot.asm
|
src/boot.bin: src/boot.asm
|
||||||
nasm -o boot/boot.bin boot/boot.asm
|
nasm -o src/boot.bin src/boot.asm
|
||||||
|
|
||||||
run: boot/boot.bin
|
run: src/boot.bin
|
||||||
qemu-system-x86_64 -drive file=boot/boot.bin,format=raw,index=0,media=disk
|
qemu-system-x86_64 -drive file=src/boot.bin,format=raw,index=0,media=disk
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm boot/boot.bin
|
rm src/boot.bin
|
||||||
0
src/kernel.c
Normal file
0
src/kernel.c
Normal file
Reference in New Issue
Block a user