kmem(4freebsd)


NAME

     mem, kmem --- memory files

SYNOPSIS

     device mem

DESCRIPTION

     The special file /dev/mem is an interface to the physical memory of the
     computer.  Byte offsets in this file are interpreted as physical memory
     addresses.  Reading and writing this file is equivalent to reading and
     writing memory itself.  Only offsets within the bounds of /dev/mem are
     allowed.

     Kernel virtual memory is accessed through the interface /dev/kmem in the
     same manner as /dev/mem.  Only kernel virtual addresses that are
     currently mapped to memory are allowed.

     On ISA the I/O memory space begins at physical address 0x000a0000 and
     runs to 0x00100000.  The per-process data size for the current process is
     UPAGES long, and ends at virtual address 0xf0000000.

IOCTL INTERFACE

     Several architectures allow attributes to be associated with ranges of
     physical memory.  These attributes can be manipulated via ioctl() calls
     performed on /dev/mem.  Declarations and data types are to be found in
     <sys/memrange.h>.

     The specific attributes, and number of programmable ranges may vary
     between architectures.  The full set of supported attributes is:

     MDF_UNCACHEABLE
         The region is not cached.

     MDF_WRITECOMBINE
         Writes to the region may be combined or performed out of order.

     MDF_WRITETHROUGH
         Writes to the region are committed synchronously.

     MDF_WRITEBACK
         Writes to the region are committed asynchronously.

     MDF_WRITEPROTECT
         The region cannot be written to.

     Memory ranges are described by struct mem_range_desc:

       uint64_t        mr_base;        / physical base address /
       uint64_t        mr_len;         / physical length of region /
       int             mr_flags;       / attributes of region /
       char            mr_owner[8];

     In addition to the region attributes listed above, the following flags
     may also be set in the mr_flags field:

     MDF_FIXBASE
         The region's base address cannot be changed.

     MDF_FIXLEN
         The region's length cannot be changed.

     MDF_FIRMWARE
         The region is believed to have been established by the system
         firmware.

     MDF_ACTIVE
         The region is currently active.

     MDF_BOGUS
         We believe the region to be invalid or otherwise erroneous.

     MDF_FIXACTIVE
         The region cannot be disabled.

     MDF_BUSY
         The region is currently owned by another process and may not be
         altered.

     Operations are performed using struct mem_range_op:

       struct mem_range_desc   *mo_desc;
       int                     mo_arg[2];

     The MEMRANGE_GET ioctl is used to retrieve current memory range
     attributes.  If mo_arg[0] is set to 0, it will be updated with the total
     number of memory range descriptors.  If greater than 0, the array at
     mo_desc will be filled with a corresponding number of descriptor
     structures, or the maximum, whichever is less.

     The MEMRANGE_SET ioctl is used to add, alter and remove memory range
     attributes.  A range with the MDF_FIXACTIVE flag may not be removed; a
     range with the MDF_BUSY flag may not be removed or updated.

     mo_arg[0] should be set to MEMRANGE_SET_UPDATE to update an existing or
     establish a new range, or to MEMRANGE_SET_REMOVE to remove a range.

RETURN VALUES

     [EOPNOTSUPP]       Memory range operations are not supported on this
                    architecture.

     [ENXIO]            No memory range descriptors are available (e.g.
                    firmware has not enabled any).

     [EINVAL]           The memory range supplied as an argument is invalid or
                    overlaps another range in a fashion not supported by
                    this architecture.

     [EBUSY]            An attempt to remove or update a range failed because
                    the range is busy.

     [ENOSPC]           An attempt to create a new range failed due to a
                    shortage of hardware resources (e.g. descriptor
                    slots).

     [ENOENT]           An attempt to remove a range failed because no range
                    matches the descriptor base/length supplied.

     [EPERM]            An attempt to remove a range failed because the range
                    is permanently enabled.

FILES

     /dev/mem
     /dev/kmem

SEE ALSO

     kvm(3), memcontrol(8)

HISTORY

     The mem and kmem files appeared in Version 6 AT&T UNIX.  The ioctl
     interface for memory range attributes was added in FreeBSD 3.2.

BUGS

     Busy range attributes are not yet managed correctly.

     This device is required for all users of kvm(3) to operate.





Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.