Page 2 of 2
Re:Setting Up the IDT from C
Posted: Mon Apr 21, 2003 5:42 am
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...
Re:Setting Up the IDT from C
Posted: Mon Apr 21, 2003 5:16 pm
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... )
Re:Setting Up the IDT from C
Posted: Tue Apr 22, 2003 12:56 am
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?