Rev 1681 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
42 | 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 | /* For accessing BIOS calls returning in Real Mode, or using VM86 */ |
||
23 | |||
24 | #ifndef __LL_I386_X_BIOS_H__ |
||
25 | #define __LL_I386_X_BIOS_H__ |
||
26 | |||
27 | #include <ll/i386/defs.h> |
||
28 | BEGIN_DEF |
||
29 | |||
30 | #include <ll/i386/hw-data.h> |
||
31 | #include <ll/i386/hw-instr.h> |
||
32 | |||
33 | #define DOS_OFF(x) ((DWORD)(x) & 0x000F) |
||
34 | #define DOS_SEG(x) (((DWORD)(x) & 0xFFFF0) >> 4) |
||
35 | |||
36 | typedef union x_regs16 { |
||
37 | struct { |
||
1681 | fabio | 38 | WORD ax; |
39 | WORD bx; |
||
40 | WORD cx; |
||
41 | WORD dx; |
||
42 | WORD si; |
||
43 | WORD di; |
||
44 | WORD cflag; |
||
45 | WORD _pad; |
||
46 | } x; |
||
42 | pj | 47 | struct { |
1681 | fabio | 48 | BYTE al,ah; |
49 | BYTE bl,bh; |
||
50 | BYTE cl,ch; |
||
51 | BYTE dl,dh; |
||
52 | } h; |
||
42 | pj | 53 | } X_REGS16; |
54 | |||
55 | typedef struct x_sregs16 { |
||
1681 | fabio | 56 | WORD es; |
57 | WORD cs; |
||
58 | WORD ss; |
||
59 | WORD ds; |
||
42 | pj | 60 | } X_SREGS16; |
61 | |||
62 | typedef struct { |
||
63 | /* The GDT linear address inheritable from X */ |
||
83 | pj | 64 | DWORD _GDT_base; |
42 | pj | 65 | /* These are used for BIOS calling */ |
83 | pj | 66 | X_REGS16 _ir; |
67 | X_REGS16 _or; |
||
68 | X_SREGS16 _sr; |
||
69 | DWORD _irqno; |
||
42 | pj | 70 | /* This is the X version */ |
83 | pj | 71 | DWORD _ver; |
42 | pj | 72 | } X_CALLBIOS; |
73 | |||
74 | X_CALLBIOS * x_bios_address(void); |
||
75 | void X_meminfo(LIN_ADDR *b1,DWORD *s1,LIN_ADDR *b2,DWORD *s2); |
||
76 | void X_callBIOS(int service,X_REGS16 *in,X_REGS16 *out,X_SREGS16 *s); |
||
77 | void vm86_init(); |
||
78 | TSS *vm86_get_tss(void); |
||
79 | int vm86_callBIOS(int service,X_REGS16 *in,X_REGS16 *out,X_SREGS16 *s); |
||
80 | |||
81 | END_DEF |
||
82 | |||
83 | #endif |