small IDT kernel, djgpp.

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
petrusss

small IDT kernel, djgpp.

Post by petrusss »

Hi!
I've been trying for a month now to get IRQ support to my os (keyboard support), but I can't make it work =/
Now I wonder, does anyone out there have a nice and small 32bit protected mode kernel that does nothing, but IRQ's are working?
I'm using djgpp, and I would be glad if it could compile under djgpp ;)
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:small IDT kernel, djgpp.

Post by Neo »

Have you enabled the IRQ's after disabling them when you remapped the PIC?
Try to just print a message on the IRQ 1 just saying that a key was pressed and then work up form there. (Thats how i did it).
Only Human
petrusss

Re:small IDT kernel, djgpp.

Post by petrusss »

yeah, I've tested everything ;) :-\
Therx

Re:small IDT kernel, djgpp.

Post by Therx »

my.execpc.com/~geezer/osd

Download the kernels. I think the most basic one with IRQs is OSD7
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:small IDT kernel, djgpp.

Post by Pype.Clicker »

agree with pete. Get a working small kernel (geezer's one should be fine for this) and check yours is not missing a crucial point ...

things you must do:
1. remap the PIC so that it does not interfere with any other thing. see the 8259a documentation on OSRC for details
2. install a valid IDT (program the IDTR register with LIDT ... see the Holy Intel Manual for details)
3. install valids descriptors in this IDT. At this point, you should be able to check that the interrupts can be called by software using INT nn instruction
4. unmask the interrupts you need. Make sure you unmasked them properly by reading the mask back and displaying it on screen. People tends to clear only the last interrupt they want to enable rather than accumulating them (check irqCheckEnabled)
5. make the CPU respond to IRQs from the PIC with the STI instruction.

More detailed tutorials should be available on Bona Fide page.
petrusss

Re:small IDT kernel, djgpp.

Post by petrusss »

I've done all that, and osd is a jungle of files.
I can call my interrupts with the INT opcode.
Therx

Re:small IDT kernel, djgpp.

Post by Therx »

I've done all that, and osd is a jungle of files.
You won't find any cleaner code.

What's so messy. About 5 kernel source files in OSD7 directory. 12 include files in the INC of which OSD7 only uses a few. A bit more in the LIB directory but not all of that is used. And there's even a makefile in the OSD7 directory for DJGPP or Linux. If your code was much sipler than that then you were probally missing a bit

Cheers

Pete
petrusss

Re:small IDT kernel, djgpp.

Post by petrusss »

I can't make it compile, because there's only makefiles.
No dos-batch =/
kaos

Re:small IDT kernel, djgpp.

Post by kaos »

Get DJGPP make and other gnu utilities. They should be available from where you got DJGPP.
Tim

Re:small IDT kernel, djgpp.

Post by Tim »

If you're using Windows, better to use Cygwin or Mingw. They will be faster and less hassle to use (i.e. they work out of the box).
petrusss

Re:small IDT kernel, djgpp.

Post by petrusss »

Okey, I've got make and other stuff now.

$ make d:/kernels/osd/dj.mak
make.exe: Nothing to be done for `d:/kernels/osd/dj.mak'.

Nothing to be done??
nullify

Re:small IDT kernel, djgpp.

Post by nullify »

make -f <filename>
Therx

Re:small IDT kernel, djgpp.

Post by Therx »

Rename dj.mak to 'makefile' (no extension) and then go into the directory and from command prompt just type make.

I'd recommend building each kernel sepeerately by the same process. With DJGPP i had to copy th e version.h include from th DJGPP include directory to the OSD/inc/sys folder
Post Reply