Now I am trying to write on the screen, however when i call the function puts() does not pass the string.
I have no idea of why does not work, someone can have a look and help me find the problem
this is my kmain.c
Code: Select all
void kmain(void)
{
iniciarVideo();
puts("hello");
for (;;);
}
this is my video.c
Code: Select all
void puts(char *str)
{
int i;
if(!str)
return;
for (i = 0; i < strlen(str) ; i++)
putch(str[i]);
}
Code: Select all
void puts(char *str)
{
int i;
char bla[] = "HELLO WORLD";
for (i = 0; i < strlen(bla) ; i++)
putch(bla[i]);
}
this is my linker script
Code: Select all
SECTIONS
{
.data :
{
data = .; _data = .; __data = .;
*(.data*)
}
.rodata :
{
rodata = .; _rodata = .; __rodata = .;
*(.rodata*)
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss*)
}
end = .; _end = .; __end = .;
}
Code: Select all
[BITS 32]
GLOBAL start
start:
mov ax, 0x10
mov ds, ax
mov ss, ax
mov es, ax
mov esp, 90000
extern _kmain
call _kmain
cli
hl
Code: Select all
ld --oformat binary -Ttext 0x10000 -T linker.ld -o KERNEL.SYS kinit.o kmain.o video.o klib\opmem.o klib\string.o lib\ports.o