Changeset 80 for trunk/hal/x86_64


Ignore:
Timestamp:
Jun 27, 2017, 5:24:02 PM (7 years ago)
Author:
max@…
Message:

add the timer vector, for now it double-faults

Location:
trunk/hal/x86_64/core
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_init.c

    r74 r80  
    184184        kernel_init(&btinfo);
    185185        x86_printf("[+] kernel_init called\n");
     186
     187
     188        sti();
     189        while (1);
    186190
    187191        int m = 0;
     
    288292static void idt_create()
    289293{
    290         extern uint64_t x86_traps[], x86_intrs[];
     294        extern uint64_t x86_traps[], x86_intrs[], x86_rsvd;
    291295        struct idt_seg *idt;
    292296        size_t i;
    293297
    294298        idt = (struct idt_seg *)&idtstore;
     299
     300        /* First, put a dead entry */
     301        for (i = 0; i < NIDT; i++) {
     302                idt_set_seg(&idt[i], (void *)&x86_rsvd, 0,
     303                    SDT_SYS386IGT, SEL_KPL, GDT_FIXED_SEL(GDT_KCODE_SEL, SEL_KPL));
     304        }
    295305
    296306        /* General exceptions */
  • trunk/hal/x86_64/core/hal_kentry.S

    r51 r80  
    111111ASM_ENTRY(x86_trap1e)
    112112ASM_ENTRY(x86_trap1f)
     113ASM_ENTRY(x86_rsvd)
    113114        /* 20 - 31 reserved for future exp */
    114115        ZTRAPENTRY(T_RESERVED)
     
    119120ASM_ENTRY(x86_spurious)
    120121        ZTRAPENTRY(T_ASTFLT)
    121 
    122 
     122ASM_ENTRY(x86_timer)
     123        ZTRAPENTRY(T_ASTFLT)
    123124
    124125/*
     
    164165x86_intrs:
    165166        .quad   x86_spurious
     167        .quad   x86_timer
    166168
  • trunk/hal/x86_64/core/hal_lapic.h

    r51 r80  
    2424
    2525#define LAPIC_SPURIOUS_VECTOR   LAPICVEC_MIN
     26#define LAPIC_TIMER_VECTOR      (LAPICVEC_MIN + 1)
    2627
    2728#define LAPIC_ID                0x020   /* ID. RW */
  • trunk/hal/x86_64/core/hal_segmentation.h

    r51 r80  
    194194#define CPUVEC_MAX      32      /* reserved entries for CPU exceptions */
    195195#define LAPICVEC_MIN    CPUVEC_MAX
    196 #define LAPICVEC_MAX    (LAPICVEC_MIN + 1)
     196#define LAPICVEC_MAX    (LAPICVEC_MIN + 2)
    197197
    198198#define NIDT    256     /* total number of IDT entries */
Note: See TracChangeset for help on using the changeset viewer.