Such a boneheaded mistake I have to tell everyone!

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
BLoggins02

Such a boneheaded mistake I have to tell everyone!

Post by BLoggins02 »

Some of you may have already seen this on my webiste, but I just spent the last three days agonizing over a perplexing bug. ?Whenever I would reach a certain point in the kernel code, VMWare would barf. ?If I ran it on a real machine, it would triple fault and reset. ?Always at the same place too: 0x000102b5, and there wasn't even an instruction there, it was the middle of an instruction! ?Well after thinking I was doing something incredibly wrong with selectors, idts, and everything else, it turns out that it was my kernel installer scripts! ?Aaarrgghh!

Check it out, in the script I do a:

dd if=./entry.bin of=/dev/fd0 bs=512 count=1 skip=1

Well, as I'm writing my kernel code, it of course is growing beyond 512 bytes, but I never bothered to change the count! ?So of course after my processor got past the first 512 bytes of my code, the rest of it was junk. ?DUH!

I hope you enjoy this story, and let it be a lesson to everyone (at my expense) that bugs aren't always in the code, sometimes you've got to take a step back. ?The IA-32 System Programmer's Manual couldn't help me with my problem this time, but ls -l could ?::)

P.S. ?A new version of the kernel that can handle exceptions should be on my website (look in signature below) by later this evening... I hope :)
Post Reply