Page 1 of 1

functions probleme

Posted: Sun Oct 20, 2002 7:06 am
by CyberMan
Hi,

I have a problem, if I add a simple function to my kernel the computer reboot. But if I revome this function, he work fine.
The interrupts are disabled

Re:functions probleme

Posted: Sun Oct 20, 2002 7:14 am
by CyberMan
just....

I use gcc(version 2.95.3) for my kernel...

If I do:

main.c
asm("jmp start");

void start(void)
{
/* Initialise l'?cran */
init_screen();
/* Initialise le driver managment */
driver_init();
/* Enregistrer les drivers des disquettes */
init_floppy();
}

floppy.c
void detect_floppy(void)
{
}

void init_floppy(void)
{
detect_floppy(); <--- I add this function, the computer reboot
}

Re:functions probleme

Posted: Sun Oct 20, 2002 8:01 am
by Tom
hmm that's strange...are you sure that you even are running your C kernel?

Re:functions probleme

Posted: Sun Oct 20, 2002 8:05 am
by .bdjames
__inline__ __volatile__ static HLT(){
__asm__ ("hlt\n\t" \
);
}

void start(void)
{
/* Initialise l'?cran */
init_screen();
/* Initialise le driver managment */
driver_init();
/* Enregistrer les drivers des disquettes */
init_floppy();
HLT();
}

Re:functions probleme

Posted: Sun Oct 20, 2002 8:15 am
by CyberMan
yes, sure.

Re:functions probleme

Posted: Mon Oct 21, 2002 1:38 am
by Pype.Clicker
CyberMan wrote: Hi,

I have a problem, if I add a simple function to my kernel the computer reboot. But if I revome this function, he work fine.
The interrupts are disabled
what is the troublesome function ? if you declare anything before your "asm (jmp start)", your dead ...