functions probleme

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
CyberMan

functions probleme

Post 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
CyberMan

Re:functions probleme

Post 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
}
Tom

Re:functions probleme

Post by Tom »

hmm that's strange...are you sure that you even are running your C kernel?
.bdjames

Re:functions probleme

Post 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();
}
CyberMan

Re:functions probleme

Post by CyberMan »

yes, sure.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:functions probleme

Post 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 ...
Post Reply