Kernel Programmer Newbie seeks help with his kernel
Posted: Fri Jan 09, 2009 8:55 am
Hello,
I have started developing my kernel (called KRISTEN) today, as working for my thesis for my school exams.
I am currently conpiling my kernel on Linux x86_64 (but I was able to compile a 32 bit kernel as I wanted).
Following the Bare Bones tutorial on OSdev I was able to get my first characted ('A') on my Bochs screen, so i continued implementing my own functions (following the Basic C tutorial kernel on osdever, since it was cited into the Getting Started page of this site's wiki).
So I was abel to get a kernel Source like this
But when I open bochs with the new Kernel Image I am not able to see anything (I have also changed the value of blocks as said in the tutorial).... Does anybody know where I made a mistake? If you gave any advice for my Kernel please tell me,
Regards,
Mattias
EDIT: the loader file is like the one in the OSdev C Barebone tutorial.
The output should be
I have started developing my kernel (called KRISTEN) today, as working for my thesis for my school exams.
I am currently conpiling my kernel on Linux x86_64 (but I was able to compile a 32 bit kernel as I wanted).
Following the Bare Bones tutorial on OSdev I was able to get my first characted ('A') on my Bochs screen, so i continued implementing my own functions (following the Basic C tutorial kernel on osdever, since it was cited into the Getting Started page of this site's wiki).
So I was abel to get a kernel Source like this
Code: Select all
/************************************************************************
* PROJECT: Kristen Kernel *
* LICENSE: GPL - See LICENSE in the top level directory *
* FILE: kernel.c *
* VERSION: 0.0.1 *
* PURPOSE: The Main Kernel Module *
* *
* PROGRAMMER: Mattias Cibien *
************************************************************************/
/// Clears the entire text screen
void kclearscr() {
char *videoram = (char *) 0xb8000;
unsigned int i=0;
while(i < (80*25*2))
{
videoram[i]=' ';
i++;
videoram[i]=0x07;
i++;
};
};
/// Prints a message at a difined line
unsigned int kprint(char *message, unsigned int line)
{
char *videoram = (char *) 0xb8000;
unsigned int i=0;
i=(line*80*2);
while(*message!=0)
{
if(*message=='\n') // check for a new line
{
line++;
i=(line*80*2);
*message++;
} else {
videoram[i]=*message;
*message++;
i++;
videoram[i]=0x07;
i++;
};
};
return(1);
};
///This is our Kernel Startup Point
void kmain( void* mbd, unsigned int magic ) {
kclearscr();
kprint("Welcome to KRISTEN v0.0.1\nAs you noticed, this kernel isn't able to do anything", 0);
}
Regards,
Mattias
EDIT: the loader file is like the one in the OSdev C Barebone tutorial.
The output should be
Welcome to KRISTEN v0.0.1
As you noticed, this kernel isn't able to do anything