Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

smapi(4) [debian man page]

SMAPI(4)						 BSD/i386 Kernel Interfaces Manual						  SMAPI(4)

NAME
smapi -- System Management Application Program Interface driver DESCRIPTION
Many IBM Thinkpad laptops utilize a special software interface known as SMAPI (System Management Application Program Interface). This inter- face controls various aspects of the system including: o System Interface (the BIOS can store system information such as the system identifier), o System Configuration (where devices such as the display can be configured), o Power Management (software can interact with the SMAPI BIOS for Power Management control). Client software must locate a ``header image'' stored in the F000 segment in the Thinkpad ROM (read-only memory), which resides at the 16-byte boundary. This is considered the ``Entry Point'' for the service. The ``header image'' stores information like: o signature, o SMAPI version (major and minor), o header image length, o checksum information (which verifies the image), o an Information Word (used to identify the BIOS service level), o Real Mode Entry Point (where clients using the Real/V86 mode for the far-call value), o and finally a 16-bit/32-bit Protected Mode Entry Point: base code address which specifies the BIOS physical address. The client must prepare a 64 kilobyte selector for this BIOS). To invoke the SMAPI BIOS, a far-call must be used on the entry point specified in the header file. All other information should be stored in the client data area. The client is required to prepare both an input and output parameter in a data area of its own. This area can be ``informed'' by pushing those pointers into its stack before the far-calls. The SMAPI BIOS uses the stack and data areas with the selector during a BIOS invocation, thus the caller must define the same privilege area as the BIOS. The parameter structure will be made up by using the input and output fields prepared by the caller. The input field will specify the func- tion request to the BIOS. The BIOS will then drop a return value into the output field. These fields are made up of three parts. The first holds parameters, function numbers, and return codes. The next will contain an offset in hexadecimal. Finally a length field which is com- prised of Byte, Word, or Double Word. SEE ALSO
IBM Thinkpad 560/560E Technical Reference, 06J0536 S76H-7587-01. IBM Thinkpad 560Z Technical Reference, xxxxxxx xxxx-xxxx-xx. IBM Thinkpad 600 Technical Reference, xxxxxxx xxxx-xxxx-xx. IBM Thinkpad 760XD/760XL/765D/765L Technical Reference, 06J0537 S30H-2433-02. IBM Thinkpad 770 Technical Reference, 05L1739 S05L-1739-00. AUTHORS
The smapi driver was written by Matthew N. Dodd <mdodd@FreeBSD.org>. This manual page was written by Tom Rhodes <trhodes@FreeBSD.org> and Matthew N. Dodd <mdodd@FreeBSD.org>. BSD
April 1, 2003 BSD

Check Out this Related Man Page

BIOS(9) 						   BSD Kernel Developer's Manual						   BIOS(9)

NAME
bios_sigsearch, bios32_SDlookup, bios32, bios_oem_strings -- interact with PC BIOS SYNOPSIS
#include <sys/param.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/param.h> #include <machine/pmap.h> #include <machine/pc/bios.h> uint32_t bios_sigsearch(uint32_t start, u_char *sig, int siglen, int paralen, int sigofs); int bios32_SDlookup(struct bios32_SDentry *ent); int bios32(struct bios_regs *br, u_int offset, u_short segment); BIOS_PADDRTOVADDR(addr); BIOS_VADDRTOPADDR(addr); extern struct bios32_SDentry PCIbios; extern struct SMBIOS_table SMBIOStable; extern struct DMI_table DMItable; int bios_oem_strings(struct bios_oem *oem, u_char *buffer, size_t maxlen); struct bios_oem_signature { char * anchor; /* search anchor string in BIOS memory */ size_t offset; /* offset from anchor (may be negative) */ size_t totlen; /* total length of BIOS string to copy */ }; struct bios_oem_range { u_int from; /* shouldn't be below 0xe0000 */ u_int to; /* shouldn't be above 0xfffff */ }; struct bios_oem { struct bios_oem_range range; struct bios_oem_signature signature[]; }; DESCRIPTION
These functions provide a general-purpose interface for dealing with the BIOS functions and data encountered on x86 PC-architecture systems. bios_sigsearch() Searches the BIOS address space for a service signature, usually an uppercase ASCII sequence surrounded by underscores. The search begins at start, or at the beginning of the BIOS if start is zero. siglen bytes of the BIOS image and sig are compared at sigofs bytes offset from the current location. If no match is found, the current location is incre- mented by paralen bytes and the search repeated. If the signature is found, its effective physical address is returned. If no signature is found, zero is returned. bios_oem_strings() Searches a given BIOS memory range for one or more strings, and composes a printable concatenation of those found. The routine expects a structure describing the BIOS address range (within 0xe0000 - 0xfffff), and a { NULL, 0, 0 } -termi- nated array of bios_oem_signature structures which define the anchor string, an offset from the beginning of the match (which may be negative), and totlen number of bytes to be collected from BIOS memory starting at that offset. Unmatched anchors are ignored, whereas matches are copied from BIOS memory starting at their corresponding offset with unprintable characters being replaced with space, and consecutive spaces being suppressed. This composed string is stored in buffer up to the given maxlen bytes (including trailing '', and any trailing space suppressed). If an error is encountered, i.e. trying to read out of said BIOS range, other invalid input, or buffer overflow, a negative integer is returned, otherwise the length of the composed string is returned. In particular, a return value of 0 means that none of the given anchor strings were found in the specified BIOS memory range. BIOS_VADDRTOPADDR() Returns the effective physical address which corresponds to the kernel virtual address addr. BIOS_PADDRTOVADDR() Returns the kernel virtual address which corresponds to the effective physical address addr. SMBIOStable If not NULL, points to a struct SMBIOS_table structure containing information read from the System Management BIOS ta- ble during system startup. DMItable If not NULL, points to a struct DMI_table structure containing information read from the Desktop Management Interface parameter table during system startup. BIOS32 At system startup, the BIOS is scanned for the BIOS32 Service Directory (part of the PCI specification), and the existence of the directory is recorded. This can then be used to locate other services. bios32_SDlookup() Attempts to locate the BIOS32 service matching the 4-byte identifier passed in the ident field of the ent argument. bios32() Calls a bios32 function. This presumes that the function is capable of working within the kernel segment (normally the case). The virtual address of the entrypoint is supplied in entry and the register arguments to the function are sup- plied in args. PCIbios If not NULL, points to a struct bios32_SDentry structure describing the PCI BIOS entrypoint which was found during sys- tem startup. BSD
August 9, 2005 BSD
Man Page