Page 1 of 1
small IDT kernel, djgpp.
Posted: Mon Oct 27, 2003 11:17 am
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
Re:small IDT kernel, djgpp.
Posted: Mon Oct 27, 2003 12:04 pm
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).
Re:small IDT kernel, djgpp.
Posted: Mon Oct 27, 2003 12:24 pm
by petrusss
yeah, I've tested everything
:-\
Re:small IDT kernel, djgpp.
Posted: Mon Oct 27, 2003 12:26 pm
by Therx
my.execpc.com/~geezer/osd
Download the kernels. I think the most basic one with IRQs is OSD7
Re:small IDT kernel, djgpp.
Posted: Tue Oct 28, 2003 2:34 am
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.
Re:small IDT kernel, djgpp.
Posted: Tue Oct 28, 2003 11:56 am
by petrusss
I've done all that, and osd is a jungle of files.
I can call my interrupts with the INT opcode.
Re:small IDT kernel, djgpp.
Posted: Tue Oct 28, 2003 1:08 pm
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
Re:small IDT kernel, djgpp.
Posted: Wed Oct 29, 2003 5:10 pm
by petrusss
I can't make it compile, because there's only makefiles.
No dos-batch =/
Re:small IDT kernel, djgpp.
Posted: Wed Oct 29, 2003 5:20 pm
by kaos
Get DJGPP make and other gnu utilities. They should be available from where you got DJGPP.
Re:small IDT kernel, djgpp.
Posted: Wed Oct 29, 2003 6:29 pm
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).
Re:small IDT kernel, djgpp.
Posted: Wed Oct 29, 2003 7:34 pm
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??
Re:small IDT kernel, djgpp.
Posted: Wed Oct 29, 2003 7:52 pm
by nullify
make -f <filename>
Re:small IDT kernel, djgpp.
Posted: Thu Oct 30, 2003 7:17 am
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