Page 1 of 1

Need help with my kernel

Posted: Fri Jul 13, 2007 12:06 am
by fei
I followed Bran's kernel development tutorial from http://www.osdever.net/bkerndev/Docs/whatsleft.htm. I changed file "start.asm" in nasm to my own loader in gas. I also made other changes.

The problem is that the kernel can only print out a hello message. The interrupt and exception handlers are not working. Normally, the "timer_handler" should be called in every second and print out messages.

Don't know how to debug this problem. Have been spending a long time on it. Can you please help with this problem? I included my source code in a tar file.

Thanks!!!

Posted: Fri Jul 13, 2007 12:26 am
by fei
When I convert nasm to gas, one problem is that I cannot convert "push byte 0" in nasm to "pushb $0" in gas. The as compiler always complains. So, I had to change "pushb $0" to "push $0". Is this right??

Posted: Fri Jul 13, 2007 12:41 am
by os64dev
fei wrote:When I convert nasm to gas, one problem is that I cannot convert "push byte 0" in nasm to "pushb $0" in gas. The as compiler always complains. So, I had to change "pushb $0" to "push $0". Is this right??
yep, or you could do pushw.

Posted: Fri Jul 13, 2007 12:45 am
by pcmattman
I converted Bran's tutorial to GAS syntax. PM me if you want some help :D

The ISR/IRQ stubs are like so:

Code: Select all

#  0: Divide By Zero Exception
isr0:
    cli
    pushl $0
    pushl $0
    jmp isr_common_stub
Good luck :D

Posted: Fri Jul 13, 2007 1:03 am
by fei
I tried to use "pushl $0" to replace "push btye 0" in nasm. After the changes, my kernel can't even print out the hello message. Don't know what is the problem.

Posted: Fri Jul 13, 2007 9:15 am
by Combuster
I suggest you compare the disassemblies of both the nasm and the gas versions to see the differences. That way you'd know where to look for translation bugs.