Ignore:
Timestamp:
Oct 2, 2012, 9:56:32 AM (13 years ago)
Author:
Markus Thielen
Message:

fixed #13 (kernel exit call for trap dumps)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/os2ahci.c

    r133 r141  
    5959  }
    6060
     61/* constants for undefined kernel exit routine;
     62 * see register_krnl_exit() func */
     63#define DevHlp_RegisterKrnlExit   0x006f
     64
     65#define FLAG_KRNL_EXIT_ADD        0x1000
     66#define FLAG_KRNL_EXIT_REMOVE     0x2000
     67
     68#define TYPE_KRNL_EXIT_NMI        0x0000  /* non masked interrupts */
     69#define TYPE_KRNL_EXIT_SFF        0x0001  /* system fatal faults */
     70#define TYPE_KRNL_EXIT_PROCDUMP   0x0002
     71#define TYPE_KRNL_EXIT_DYN        0x0003
     72#define TYPE_KRNL_EXIT_INT13      0x0004  /* enable int13 IO */
     73
    6174/* ------------------------ typedefs and structures ------------------------ */
    6275
    6376/* -------------------------- function prototypes -------------------------- */
    6477
    65 void _cdecl  small_code_      (void);
    66 
    67 static int   add_unit_info    (IORB_CONFIGURATION _far *iorb_conf, int dt_ai,
    68                                int a, int p, int d, int scsi_id);
     78void _cdecl  small_code_        (void);
     79
     80static int   add_unit_info      (IORB_CONFIGURATION _far *iorb_conf, int dt_ai,
     81                                 int a, int p, int d, int scsi_id);
     82
     83static void  register_krnl_exit (void);
    6984
    7085/* ------------------------ global/static variables ------------------------ */
     
    381396    rsp->CodeEnd = (u16) end_of_code;
    382397    rsp->DataEnd = (u16) &end_of_data;
     398
     399    /* register kernel exit routine for trap dumps */
     400    register_krnl_exit();
     401
    383402    return(STDON);
    384403
     
    14941513}
    14951514
     1515/*******************************************************************************
     1516 * Register kernel exit handler for trap dumps. Our exit handler will be called
     1517 * right before the kernel starts a dump; that's where we reset the controller
     1518 * so it supports BIOS int13 I/O calls.
     1519 */
     1520static void register_krnl_exit(void)
     1521{
     1522  _asm {
     1523
     1524    push ds
     1525    push es
     1526    push bx
     1527    push si
     1528    push di
     1529
     1530    mov ax, FLAG_KRNL_EXIT_ADD
     1531    mov cx, TYPE_KRNL_EXIT_INT13
     1532    mov bx, SEG asm_krnl_exit
     1533    mov si, OFFSET asm_krnl_exit
     1534    mov dl, DevHlp_RegisterKrnlExit
     1535    call Device_Help
     1536
     1537    pop  di
     1538    pop  si
     1539    pop  bx
     1540    pop  es
     1541    pop  ds
     1542  }
     1543
     1544  dprintf("Registered kernel exit routine for INT13 mode\n");
     1545}
Note: See TracChangeset for help on using the changeset viewer.