[coreboot] Regarding patch review of 707

manasa gv manasa671989 at gmail.com
Thu Apr 19 12:54:52 CEST 2012


I have done patch review of 707  that is to Fix  address in Real mode IDT ..
To find this i have gone through Intel IA-32  Vol-3A  manual..Here am
using LIDT instruction to fix address in IDT register..I thought
below given code may work to load an address..

# include<system.h>

/*Defines an IDT entry*/
struct idt_entry
   unsigned short base_lo;
   unsigned short sel;
   unsigned char always0;
   unsigned char flags;
   unsigned short base_hi;

struct idt_ptr
   unsigned short limit;
   unsigned int base;

/*Declares an IDT of 256 entries*/
struct idt_entry idt[256];
struct idt_ptr idtp;

/*This is used to load IDT*/
extern void idt_load();

extern void idt_set_gate();
void idt_install();

void idt_install()
/*Sets the IDT pointer up*/
idtp.limit = (sizeof ( struct idt_entry)*256)-1;
idtp.base = &idt;

/*clears out the entire IDT, initializing it to zeros*/
memset( &idt , 0 , sizeof ( struct idt_entry )*256);

/*points the processor's internal register to new IDT*/

;Loads the IDT defined in '_idtp' into the processor
global _idt_load
extern _idtp
_idt load:
lidt [ _idtp ]

/*use this function to set an entry in the IDT*/
void idt_set_gate ( unsigned char num , unsigned long base , unsigned
short sel , unsigned char flags)
 idt[num].base_lo = base&0xFFFF;
 idt[num].sel = sel;
 idt[num].flags = ( flags >> 8) & 0xFF00;
 idt[num].base_hi = ( base >> 16) & 0xFFFF;

If i test this code in terminal of Fedora16, leads to system hang..So
Is there any other way to test??
please let me know feedback regarding this work ..Is this the solution
or not ?? Am new to this coreboot,
so please help me out..


More information about the coreboot mailing list