Can you help me?
This is my code:
Kernel.c
Code: Select all
k_main()
{
k_clear_screen();
k_printf("Carregado com sucesso...!\n2piv.0.1"", 0);
};
Code: Select all
[BITS 32]
[global start]
[extern _k_main]
start:
lgdt [gdt_ptr]
mov ax,LINEAR_DATA_SEL
mov ds,ax
mov es,ax
mov ss,ax
mov fs,ax
mov gs,ax
call _k_main
jmp $
SECTION .data
gdt:
; NULL descriptor
dw 0; limit 15:0
dw 0; base 15:0
db 0; base 23:16
db 0; type
db 0; limit 19:16, flags
db 0; base 31:24
; unused descriptor
dw 0
dw 0
db 0
db 0
db 0
db 0
LINEAR_DATA_SELequ$-gdt
dw 0FFFFh
dw 0
db 0
db 92h; present, ring 0, data, expand-up, writable
db 0CFh; page-granular (4 gig limit), 32-bit
db 0
LINEAR_CODE_SELequ$-gdt
dw 0FFFFh
dw 0
db 0
db 9Ah; present,ring 0,code,non-conforming,readable
db 0CFh; page-granular (4 gig limit), 32-bit
db 0
gdt_end:
gdt_ptr:
dw gdt_end - gdt - 1
dd gdt
Code: Select all
define WHITE_TXT 0x07
void k_clear_screen()
{
char *vidmem = (char *) 0xb8000;
unsigned int i=0;
while(i < (80*25*2))
{
vidmem[i]=' ';
i++;
vidmem[i]=WHITE_TXT;
i++;
};
};
unsigned int k_printf(char *message, unsigned int line)
{
char *vidmem = (char *) 0xb8000;
unsigned int i=0;
i=(line*80*2);
while(*message!=0)
{
if(*message=='\n')
{
line++;
i=(line*80*2);
*message++;
} else {
vidmem[i]=*message;
*message++;
i++;
vidmem[i]=WHITE_TXT;
i++;
};
};
return(1);
};
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0xFF800000 : {
*(.text)
}
.data : {
*(.data)
}
.bss :
{
*(.bss)
}
}
Code: Select all
# Makefile for Kernel
CC:= C:\djgpp\bin\gcc <- Aqui é definido o local onde está instalado o DJGPP
COBJS := kernel.o video.c <- Para cada arquivo *.c criado para nosso OS
ASMOBJS:= k_entry.o <- Para cada arquivo *.asm criado para nosso OS
OBJS:= $(COBJS) $(ASMOBJS)
CFILES := $(COBJS:%.o=%.c)
ASMFILES:= $(ASMOBJS:%.o=%.asm)
ASM:=C:\djgpp\bin\nasm <- Aqui é definido o local onde está instalado o NASM
LD := C:\djgpp\bin\ld <- Aqui é definido o local onde está instalado o Link
Code: Select all
@echo off
del *.bin
C:\djgpp\bin\MAKE
PAUSE
Não foi possivel encontrar C:/so/*.bin
make.exe***no tragets.Stop
Thanks