Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

i386_vm86(2) [debian man page]

I386_VM86(2)						      BSD System Calls Manual						      I386_VM86(2)

NAME
i386_vm86 -- control vm86-related functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <machine/sysarch.h> #include <machine/vm86.h> int i386_vm86(int function, void *data); DESCRIPTION
The i386_vm86() system call is used to call various vm86 related functions. The function argument can be one of the following values: VM86_INIT This will initialize the kernel's vm86 parameter area for the process, and permit the process to make vm86 calls. The data argument points to the following structure: struct vm86_init_args { int debug; int cpu_type; u_char int_map[32]; }; The debug argument is used to turn on debugging code. The cpu_type argument controls the type of CPU being emulated, and is currently unimplemented. The int_map argument is a bitmap which determines whether vm86 interrupts should be handled in vm86 mode, or reflected back to the process. If the Nth bit is set, the interrupt will be reflected to the process, otherwise it will be dispatched by the vm86 interrupt table. VM86_INTCALL This allows calls to be made to vm86 interrupt handlers by the process. It effectively simulates an INT instruction. data should point to the following structure: struct vm86_intcall_args { int intnum; struct vm86frame vmf; }; intnum specifies the operand of INT for the simulated call. A value of 0x10, for example, would often be used to call into the VGA BIOS. vmf is used to initialize CPU registers according to the calling convention for the interrupt han- dler. VM86_GET_VME This is used to retrieve the current state of the Pentium(r) processor's VME (Virtual-8086 Mode Extensions) flag, which is bit 0 of CR4. data should be initialized to point to the following: struct vm86_vme_args { int state; /* status */ }; state will contain the state of the VME flag on return. vm86 mode is entered by calling sigreturn(2) with the correct machine context for vm86, and with the PSL_VM bit set. Control returns to the process upon delivery of a signal. RETURN VALUES
The i386_vm86() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi- cate the error. ERRORS
The i386_vm86() system call will fail if: [EINVAL] The kernel does not have vm86 support, or an invalid function was specified. [ENOMEM] There is not enough memory to initialize the kernel data structures. AUTHORS
This man page was written by Jonathan Lemon, and updated by Bruce M Simpson. BSD
July 27, 1998 BSD

Check Out this Related Man Page

MODIFY_LDT(2)						     Linux Programmer's Manual						     MODIFY_LDT(2)

NAME
modify_ldt - get or set ldt SYNOPSIS
#include <sys/types.h> int modify_ldt(int func, void *ptr, unsigned long bytecount); Note: There is no glibc wrapper for this system call; see NOTES. DESCRIPTION
modify_ldt() reads or writes the local descriptor table (ldt) for a process. The ldt is a per-process memory management table used by the i386 processor. For more information on this table, see an Intel 386 processor handbook. When func is 0, modify_ldt() reads the ldt into the memory pointed to by ptr. The number of bytes read is the smaller of bytecount and the actual size of the ldt. When func is 1, modify_ldt() modifies one ldt entry. ptr points to a user_desc structure and bytecount must equal the size of this struc- ture. The user_desc structure is defined in <asm/ldt.h> as: struct user_desc { unsigned int entry_number; unsigned long base_addr; unsigned int limit; unsigned int seg_32bit:1; unsigned int contents:2; unsigned int read_exec_only:1; unsigned int limit_in_pages:1; unsigned int seg_not_present:1; unsigned int useable:1; }; In Linux 2.4 and earlier, this structure was named modify_ldt_ldt_s. RETURN VALUE
On success, modify_ldt() returns either the actual number of bytes read (for reading) or 0 (for writing). On failure, modify_ldt() returns -1 and sets errno to indicate the error. ERRORS
EFAULT ptr points outside the address space. EINVAL ptr is 0, or func is 1 and bytecount is not equal to the size of the structure modify_ldt_ldt_s, or func is 1 and the new ldt entry has invalid values. ENOSYS func is neither 0 nor 1. CONFORMING TO
This call is Linux-specific and should not be used in programs intended to be portable. NOTES
Glibc does not provide a wrapper for this system call; call it using syscall(2). SEE ALSO
vm86(2) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2012-07-13 MODIFY_LDT(2)
Man Page