Page 1 of 1

OS Crash because of infinite loop

Posted: Thu Nov 05, 2015 6:30 am
by trolly
Hi,

i'm working on a new kernel since 2 days, it's written in FreeBasic, with a little inline ASM (i started using , the freebasic bare metal example).

For now , i have console routines, memory management (alloc, free, realoc, mem cpy) , and the initialisation of a GDT

i now there is a lot of thing to do, (the goal is to make a sort of VM that executes a kind of bytecodes, and i could port it on the rhaspeberry pi)


The problem now,
is when in the main function, i add the "while(1);" loop , it crashes . any idea what could cause that?

Re: OS Crash because of infinite loop

Posted: Thu Nov 05, 2015 7:52 am
by Techel
Use the Debugger and check why it crashes.

Re: OS Crash because of infinite loop

Posted: Thu Nov 05, 2015 3:00 pm
by trolly
i tryied to start qemu in debug mode, but it fails

Re: OS Crash because of infinite loop

Posted: Thu Nov 05, 2015 4:58 pm
by iansjack
What do you mean by "it crashes". Error message?

What do you mean by "qemu fails to start in debug mode"? What command line did you use and what error message did you get?

Vague statements like "it crashes" or "it fails to start" are no use at all to others.

I would say that if you are going to try to program an OS in something unusual, like FreeBasic, then you have to know your tools very well indeed. Very few people will be using the same tools so you can expect little help. Pioneers have to be - well, pioneers. I would strongly advise the use of C for someone new to OS development.

Re: OS Crash because of infinite loop

Posted: Thu Nov 05, 2015 8:54 pm
by trolly
When it entered into the do:loop qemu rebooted immediately

finaly i've found the problem; it was because the IDP whas not yet configured, and it may that an interrupt (the timer by example) occured, and because it was not configured, it went to an arbitrary location.

ive now finished the IRQ manager , and all work fine. i can now work on the Hard disk driver :D