Subversion Repositories shark

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/* Project:     OSLib
2
 * Description: The OS Construction Kit
3
 * Date:                1.6.2000
4
 * Idea by:             Luca Abeni & Gerardo Lamastra
5
 *
6
 * OSLib is an SO project aimed at developing a common, easy-to-use
7
 * low-level infrastructure for developing OS kernels and Embedded
8
 * Applications; it partially derives from the HARTIK project but it
9
 * currently is independently developed.
10
 *
11
 * OSLib is distributed under GPL License, and some of its code has
12
 * been derived from the Linux kernel source; also some important
13
 * ideas come from studying the DJGPP go32 extender.
14
 *
15
 * We acknowledge the Linux Community, Free Software Foundation,
16
 * D.J. Delorie and all the other developers who believe in the
17
 * freedom of software and ideas.
18
 *
19
 * For legalese, check out the included GPL license.
20
 */
21
 
22
/* System calls for X extender                          */
23
/* BIOS Call from X (Basic Reflection Service)          */
24
 
25
#include <ll/i386/hw-data.h>
26
#include <ll/i386/x-bios.h>
27
#include <ll/i386/mem.h>
28
 
29
FILE(X - BIOS);
30
 
31
/* The interface between X (and 32 bit PM) and BIOS (which runs at 16 bits */
32
/* It works as int86() standard library call                               */
33
 
34
void X_callBIOS(int service, X_REGS16 * in, X_REGS16 * out, X_SREGS16 * s)
35
{
36
    /* Assembler gate JMP instruction */
37
    extern void _x_callBIOS(void);
38
    X_CALLBIOS *xbc = x_bios_address();
39
 
40
    /* Send interrupt request & register through the X_Info structure */
41
    xbc->irqno = service;
42
    memcpy(&(xbc->ir), in, sizeof(X_REGS16));
43
    memcpy(&(xbc->sr), s, sizeof(X_SREGS16));
44
 
45
    /* Back to RM to execute the BIOS routine */
46
    _x_callBIOS();
47
 
48
    /* Get the return register values */
49
    memcpy(out, &(xbc->or), sizeof(X_REGS16));
50
    memcpy(s, &(xbc->sr), sizeof(X_SREGS16));
51
}