Need help with my kernel

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
fei
Posts: 10
Joined: Sat Jul 07, 2007 4:40 am

Need help with my kernel

Post 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!!!
Attachments
mini-kernel.tar.gz
(11.07 KiB) Downloaded 56 times
fei
Posts: 10
Joined: Sat Jul 07, 2007 4:40 am

Post 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??
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post 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.
Author of COBOS
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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
fei
Posts: 10
Joined: Sat Jul 07, 2007 4:40 am

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply