The Kernel starts behaving abnormally when the kernel code gets a little bigger

75 views Asked by At

I am developing an OS kernel. I am facing a problem that till a particular size of the kernel - 8KB it runs perfectly but as it gets just a little over 8KB, it starts behaving abnormally. The clear screen function doesn't work, the scrolling function doesn't work etc.

I am using the bochs emulator with a 1.44MB floppy configuration.

My code working correctly is -

#include "functions.h"
#include "stdint.h"
#include "stddef.h"
#include "../drivers/colors.h"

void delay();
char getScancode();

void main()
{
    /*Declarations*/
    char* str = "Welcome to MyOS v0.2.4 By Anish Sharma 2017";
    char* status = "Welcome Anish Sharma";
    uint8_t i = 0;


    for(i=0;i<80;i++)
        putChar(' ',i,24,STATUS_COLOR);
    write_string_line(STATUS_COLOR,status,24);

    clrscr();
    print("The KERNEL has been loaded successfully at 0x1000 (memory address)");
    print(str);
    print(">>>");
    update_cursor(3,2);
    for(i=0;i<80;i++)
    {
        putChar(0xdb,i,3,i);
    }
    for(i=0;i<80;i++)
    {
        putChar(0xdb,i,4,i);
    }
    for(i=0;i<80;i++)
    {
        putChar(0xdb,i,5,i);
    }
    for(i=0;i<80;i++)
    {
        putChar(0xdb,i,6,i);
    }
    for(i=0;i<80;i++)
    {
        putChar(0xdb,i,3,i);
    }
}

The output is -

enter image description here

Adding just another -

for(i=0;i<80;i++)
{
    putChar(0xdb,i,3,i);
}

The output is -

enter image description here

Can anyone tell me what is causing this problem?

0

There are 0 answers