Setting Up the IDT from C

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.
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:Setting Up the IDT from C

Post by Pype.Clicker »

hmm ... weird. Maybe you could check the IDT structure has the expected size (i.e. sizeof(IDTR)==6) ... Sometimes the C compiler may decide to add padding to have integer aligned ... i can't remember whether there is a flag to set to prevent him from doing this...
shad

Re:Setting Up the IDT from C

Post by shad »

Well I would try that, but my bootloader is acting up so ill have to come back to the kernel later... ( before i wasnt using a FS, so i had to keep modifying the size to load.. then it became more than a track.. disaster... )
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Setting Up the IDT from C

Post by distantvoices »

maybe something like this (in c) will help out?

Code: Select all

  typedef struct{
     unsigned short limit;
     unsigned int base;
  }__attribute__((PACKED)) idtr_t;
as for your fs support in the bootloader:

keep track of logical sectors in some kind of fat (or inode) and have them be translated to chs by some function that feeds the floppy/harddisk-read/write function you may be have?

what does it say in the result phase?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply