Hi,
I want to call C functions from my kernel code. Can somebody plz help me with this:
; call c function
extern [_K_main]
;--- test kernel.bin---
; push cs
; push cs
; pop ds
; pop es
mov ax, 7E0H
mov ds,ax
mov es,ax
mov si, msg
mov ah, 0Eh
mov bx, 7
top:
lodsb
cmp al, 0
jz blackhole
int 10h
jmp short top
blackhole:
mov cx,1000
Delay: Loop Delay
call _K_main; this is in main.c
hlt
jmp blackhole
I am getting following error mesg.
D:\nasm prog>nasm -f bin -o boot.bin test_kernel2.asm
test_kernel2.asm:5: error: label or instruction expected at start of line
D:\NASMPR~1>
msg db 'Welcome to the Kernel!', 0
times 0x200-($-$$) db 0