Boot loader appears to work somewhat, kernel is questionable

This commit is contained in:
2015-01-23 23:02:25 -08:00
parent 6034fe2573
commit 20ee203ace
5 changed files with 188 additions and 24 deletions

35
src/kernel.c Normal file
View File

@@ -0,0 +1,35 @@
void printChar(char c)
{
#asm
#if !__FIRST_ARG_IN_AX__
mov bx, sp
#endif
#if __FIRST_ARG_IN_AX__
mov si, ax
#else
mov si, [bx+2]
#endif
mov ah, 0x0e
mov bh, 0x00
mov bl, 0x07
int 0x10
#endasm
return;
}
void printString(char *ptr)
{
while (*ptr != '\0') {
printChar(*ptr);
*ptr++;
}
return;
}
void main(void)
{
char *kernelHello = "Welcome to Piquant, please wait while Kernel boots...\n";
printString(kernelHello);
while(1);
}