Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kasm.o
kc.o
kernel
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kernel: kasm.o kc.o
ld -m elf_i386 -T link.ld -o kernel kasm.o kc.o
kasm.o: kernel.asm
nasm -f elf32 kernel.asm -o kasm.o
kc.o: kernel.c
gcc -m32 -c kernel.c -o kc.o
test:
qemu-system-i386 -kernel kernel
clean: kasm.o kc.o kernel
rm kasm.o kc.o kernel
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ This is a minimalist kernel which prints "`my first kernel`" on the screen and t

[Kernel 101 – Let’s write a Kernel](http://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel)

#### Use Makefile ####
A premade Makefile is included

Use `make` to compile, assemble, and link the kernel easily and automatically.
Use `make test` to test the kernel in QEMU.
Use `make clean` to automatically remove outfiles and binaries.

Or, see below to compile, assemble, and link the kernel yourself.

#### Build commands ####
```
nasm -f elf32 kernel.asm -o kasm.o
Expand Down Expand Up @@ -50,4 +59,4 @@ Voila!
![kernel screenshot](http://static.tumblr.com/gltvynn/yOdn443dr/mkernel.png "Screenshot")

#### The next step ####
See [mkeykernel repo](//github.com/arjun024/mkeykernel)
See [mkeykernel repo](github.com/arjun024/mkeykernel)