i'm hacking my own OS these days.
It's somewhat working on real hardware & qemu & bochs.
The problems is that, theres a strange problem with my IRQ1 - keyboard handler code.
So i want to debug the problem using GDB.
The problem arrises now;
I have compiled a bochs with gdb-stub support and got apt-get install qemu.
For both, when i enable the debugging (gdb-stub enable in bochs, -s -S switches with qemu)
i'm getting SIGSEGV when trying to debug my OS code;
This is somewhat strange, as i already statedi in real hardware or non-debugging qemu or bochs mode, the code just works.Starting program: /root/kernel/trunk/kernel/kernel.bin
Program received signal SIGSEGV, Segmentation fault.
main (magic_no=0, addr=0) at src/kernel.c:29
29 cli(); /* disable interrupts while init */
Here is my cli() definition;
Code: Select all
#define sti() __asm__ __volatile__ ("sti":::"memory")
#define cli() __asm__ __volatile__ ("cli":::"memory")
Code: Select all
void main(unsigned long magic_no,unsigned long addr) /* entrance point to kernel */
{
int i;
cli(); /* disable interrupts while init */
Code: Select all
/* Now enter the C main function... */
call EXT_C(main)