second_stage/entry.s (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
.section .text
.global _ss_start
_ss_start:
# this code prints out all ascii characters in reverse order in
# rainbow colors just to test if this point of the code was reached
# (you might call it overkill, i call it fabulous)
mov $255, %ecx
mov $0xB8000, %esi
test:
movb %cl, (%esi)
inc %esi
movb %cl, (%esi)
inc %esi
loop test
# TODO:
# - copy the kernel code to 0x00100000
call copy_kernel
# - create a page directory for the kernel that maps it to 0xC0000000
# and identity maps the first 1M of memory
# - enable paging
# - jump to kernel code
# loop until the heat death of the universe
loop:
jmp loop
.section .data
low_kernel_welcome:
.ascii "Welcome to the low kernel!"
.byte 13
.byte 10
.byte 0