;description: This is the "kernel" file which will be loaded by the bootloader.
; For the sake of simplicity it just displays a message on the screen.
; This "kernel" can on the other hand start memory management routines, loads
; a command prompt like DOS does or switch to protected mode or long mode for
; 64 bit operations. To make a long story short: here the main work starts.
;build: nasm -fbin kernel.asm -o kernel.bin
cli ;disable interrupts
mov ss,ax ;set stack segment and pointer
sti ;enable interrupts
mov ax,0x2000 ;set all segments to match where kernel is loaded
mov ds,ax ;after this, we don't need to bother with
mov es,ax ;segments ever again,as its programs
mov fs,ax ;live entirely in 64K
mov ah,0x0E ;int 10h teletype function
lodsb ;get char from string
jz .done ;if char is zero, end of string
int 0x10 ;otherwise, print it
jmp .repeat ;and move on to next char
welcome: db 'Kernel example by Agguro - Version 188.8.131.52', 10, 13, 0