59 lines
580 B
NASM
59 lines
580 B
NASM
|
|
%include "bootdef.inc"
|
|
|
|
%define GDT 0x140000
|
|
%define IDT 0x150000
|
|
|
|
[global start]
|
|
extern _isr
|
|
|
|
bits 32
|
|
|
|
start:
|
|
call cls
|
|
|
|
mov esi, msg
|
|
mov edi, 0xb8000
|
|
|
|
msg_loop:
|
|
lodsb
|
|
or al, al
|
|
jz msg_done
|
|
stosb
|
|
mov al, 15
|
|
stosb
|
|
jmp msg_loop
|
|
|
|
msg_done:
|
|
|
|
jmp $
|
|
|
|
cls:
|
|
push eax
|
|
push ecx
|
|
push edi
|
|
|
|
mov edi, 0xb8000
|
|
mov ecx, 2000
|
|
mov eax, 0x0700
|
|
cls_loop:
|
|
stosw
|
|
loop cls_loop
|
|
|
|
pop edi
|
|
pop ecx
|
|
pop eax
|
|
|
|
ret
|
|
|
|
msg:
|
|
db "This kernel is located at 0x100000! Aren't you glad?", 0
|
|
|
|
|
|
|
|
%include "gdt.inc"
|
|
%include "idt.inc"
|
|
|
|
|
|
|