Wierd all of the sudden
Posted: Mon Oct 18, 2004 7:15 pm
This is my first post here, seems like a great site. Anyways, I have a basic kernel that handles interrupts and is starting to use paging. I'm starting to write my free function so i decided to test some things. Here's by main():
great, works like that. Now i uncomment the first printk, works, 2nd, works ... anyways when you uncomment the 6th one, bochs goes into spasms and says "load_seg_reg: GDT: SS: index(0015*8+7) > limit(000017)" I know it's not anything to do with the real code because i take that out and it works (I mean still produces the error). I look at my GDT and everything seems to be fine. What could be the problem? Everything worked before i put in the stuff with test and test1.
Code: Select all
clear();
interrupts();
sti();
tm=time_init();
paging_init();
printk("startup date: %2d/%2d/%2d\n", tm.day, tm.month, tm.year);
printk("startup time: %2d:%2d:%2d\n\n", tm.hour, tm.min, tm.sec);
char *test;
char *test1;
//printk("Location of `test': %x at initialization\n", test);
test = (char *)malloc(sizeof(char));
//printk("Location of `test': %x after malloc\n", test);
test = "Hello World!";
//printk("Location of `test': %x after assignment\n\n", test);
//printk("Location of `test1': %x at initialization\n", test1);
test1 = (char *)malloc(sizeof(char));
//printk("Location of `test1': %x after malloc\n", test1);
test = "I'm Alive\n";
//printk("Location of `test1': %x after assignment\n\n", test1);