feat(pic): add pic functions to idt
This commit is contained in:
		
							parent
							
								
									d5a8623acd
								
							
						
					
					
						commit
						f636fcbadf
					
				
							
								
								
									
										10
									
								
								k/idt.c
									
									
									
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										10
									
								
								k/idt.c
									
									
									
									
									
								
							@ -4,6 +4,7 @@
 | 
				
			|||||||
static struct idt idt = { 0 };
 | 
					static struct idt idt = { 0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct idt_entry_info infos[] = {
 | 
					static struct idt_entry_info infos[] = {
 | 
				
			||||||
 | 
					    // Intel-defined (0-20)
 | 
				
			||||||
    {int_de, INTERRUPT_TYPE},   {int_db, INTERRUPT_TYPE},
 | 
					    {int_de, INTERRUPT_TYPE},   {int_db, INTERRUPT_TYPE},
 | 
				
			||||||
    {int_nmi, INTERRUPT_TYPE},  {int_bp, TRAP_TYPE},
 | 
					    {int_nmi, INTERRUPT_TYPE},  {int_bp, TRAP_TYPE},
 | 
				
			||||||
    {int_of, TRAP_TYPE},        {int_br, INTERRUPT_TYPE},
 | 
					    {int_of, TRAP_TYPE},        {int_br, INTERRUPT_TYPE},
 | 
				
			||||||
@ -14,7 +15,14 @@ static struct idt_entry_info infos[] = {
 | 
				
			|||||||
    {int_pf, INTERRUPT_TYPE},   {0, INTERRUPT_TYPE},
 | 
					    {int_pf, INTERRUPT_TYPE},   {0, INTERRUPT_TYPE},
 | 
				
			||||||
    {int_mf, INTERRUPT_TYPE},   {int_ac, INTERRUPT_TYPE},
 | 
					    {int_mf, INTERRUPT_TYPE},   {int_ac, INTERRUPT_TYPE},
 | 
				
			||||||
    {int_mc, INTERRUPT_TYPE},   {int_xm, INTERRUPT_TYPE},
 | 
					    {int_mc, INTERRUPT_TYPE},   {int_xm, INTERRUPT_TYPE},
 | 
				
			||||||
    {int_ve, INTERRUPT_TYPE}
 | 
					    {int_ve, INTERRUPT_TYPE},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Intel-reserved (21-31)
 | 
				
			||||||
 | 
					    {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
 | 
				
			||||||
 | 
					    {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // user-defined (32-255)
 | 
				
			||||||
 | 
					    {0, INTERRUPT_TYPE},    {pic_keyboard, INTERRUPT_TYPE}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void handle_interrupt(struct int_args *args)
 | 
					void handle_interrupt(struct int_args *args)
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										5
									
								
								k/idt.h
									
									
									
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										5
									
								
								k/idt.h
									
									
									
									
									
								
							@ -5,9 +5,12 @@
 | 
				
			|||||||
#include "gdt.h"
 | 
					#include "gdt.h"
 | 
				
			||||||
#include "isr.h"
 | 
					#include "isr.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IDT_NB_ENTRIES 21
 | 
					#define IDT_NB_ENTRIES 34
 | 
				
			||||||
#define IDT_SIZE (IDT_NB_ENTRIES * sizeof(struct idt_entry))
 | 
					#define IDT_SIZE (IDT_NB_ENTRIES * sizeof(struct idt_entry))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define INTEL_DEFINED 21
 | 
				
			||||||
 | 
					#define INTEL_UNUSED  31
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define INTERRUPT_TYPE 0x6
 | 
					#define INTERRUPT_TYPE 0x6
 | 
				
			||||||
#define TRAP_TYPE      0x7
 | 
					#define TRAP_TYPE      0x7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user