Diving into the ISRs...

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
DrLink
Member
Member
Posts: 25
Joined: Wed May 21, 2008 6:10 pm
Contact:

Diving into the ISRs...

Post by DrLink »

So I've kickstarted my kernel now, and it's slowly unfolding--but I need ISRs set up. Since I'm still very new to the entire process of OS development, I'm beginning to understand some core concepts and get onto my feet a little bit, but I still need a bit of a push. So, I'm reading up on tutorials (bkerndev, babysteps, etc.) and I've been doing some crossovers so that each tutorials sample code that I borrow to study with ends up being fully compatible. I've been getting to bkerndev a little more (since as we all know, bkerndev does NOT compile, so just use it as a reference). Because of this, I've needed way to do the ISRs. Once I get to the interfacing and build some basic "commands" for the TUI then I'll be ready to start diving into devices and have a bit of fun porting some free software out there to my OS. I need some help, and I guess I'm a bit rusty on my C(++), so here's my code (or rather, bkerndev's code)...

Code: Select all

361. void fault_handler(struct regs *r)
362. {
363.     if (r->int_no < 32)// The error seems to be here, but adding pointers doesn't fix the problem.
364.     {
365.         clear();
366.         kprintf(exception_messages[r->int_no], 1); // If I knew how to fix line 363, then I'd fix this one pretty quickly
367.         for (;;);
368.     }
369. }
Here's some compiler output.

Code: Select all

kernel.c:363: error: dereferencing pointer to incomplete type
kernel.c:366: error: dereferencing pointer to incomplete type
Adding or removing pointers does not repair this (and I knew removing them in the arguments would just break it even further). What exactly is bkerndev doing wrong here? If someone were to release an edited bkerndev that actually compiled then it would be very nice, but this is the only "complete" tutorial out there that isn't still being "researched" or anything to that effect.

So, answers?
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Re: Diving into the ISRs...

Post by suthers »

Bran's tutorial work's fine, this seems to be an error on your part, where do you define regs?
The error means that your accessing a member of the struct before your compiler knows the structure of the struct...
Jules
DrLink
Member
Member
Posts: 25
Joined: Wed May 21, 2008 6:10 pm
Contact:

Re: Diving into the ISRs...

Post by DrLink »

I realized that I had defined the struct after that function. I placed it into the header file and all was well...

Thanks!
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Re: Diving into the ISRs...

Post by suthers »

Your welcome...
Funny how people always blame the tutorial before blaming themselves.. :lol:
Jules
Post Reply