summaryrefslogtreecommitdiffstats
path: root/src/interface/linux
Commit message (Collapse)AuthorAgeFilesLines
* [init] Show startup and shutdown function names in debug messagesMichael Brown2019-01-251-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Allow timer to be selected at runtimeMichael Brown2017-01-261-16/+10Star
| | | | | | | | | | | | | | | | | | | | | | Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Rewrite headers included in all buildsMichael Brown2015-03-051-1/+0Star
| | | | | | | Rewrite (and relicense) the header files which are included in all builds of iPXE (including non-Linux builds). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-023-3/+15
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Avoid starting currticks() from zero every timeMichael Brown2014-03-071-1/+7
| | | | | | | | | | | | | | | | | | | iPXE uses currticks() (along with the MAC address(es) of any network devices) to seed the (non-cryptographic) random number generator. The current implementation of linux_currticks() ensures that the first call to currticks() will always return zero; this results in identical random number sequences on each run of iPXE on a given machine. This can cause odd-looking behaviour due to e.g. the reuse of local TCP port numbers. Fix by effectively rounding down the start time recorded by linux_currticks() to the nearest whole second; this makes it unlikely that consecutive runs of iPXE will use the exact same RNG sequence. (Note that none of this affects the cryptographic RNG, which uses /dev/random as a source of entropy.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Provide access to SMBIOS via /dev/memMichael Brown2013-12-051-9/+87
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add missing #include <stddef.h>Marin Hannache2013-07-142-0/+2
| | | | | Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add support for accessing PCI configuration space via /proc/bus/pciMichael Brown2013-07-131-0/+185
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-203-3/+6
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Add Linux time source using gettimeofday()Michael Brown2012-05-041-0/+45
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Remove "log message" usage from interactive console defaultsMichael Brown2012-03-271-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow usage to be defined independently for each consoleMichael Brown2012-03-261-0/+9
| | | | | | | | | | | | | | | | | | | | | Add the concept of a "console usage", such as "standard output" or "debug messages". Allow usages to be associated with each console independently. For example, to send debugging output via the serial port, while preventing it from appearing on the local console: #define CONSOLE_SERIAL CONSOLE_USAGE_ALL #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG ) If no usages are explicitly specified, then a default set of usages will be applied. For example: #define CONSOLE_SERIAL will have the same affect as #define CONSOLE_SERIAL CONSOLE_USAGE_ALL Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add Linux entropy source using /dev/randomMichael Brown2012-03-181-0/+96
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Make malloc and linux_umalloc valgrindablePiotr Jaroszyński2011-03-271-3/+31
| | | | | | | | | | Make the allocators used by malloc and linux_umalloc valgrindable. Include valgrind headers in the codebase to avoid a build dependency on valgrind. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-091-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add empty smbiosPiotr Jaroszyński2010-08-191-0/+37
| | | | | | | | | There exists an smbios userspace library so implementing this is probably possible, but doesn't seem really important to have in userspace. Hence provide a dummy implementation returning an error. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add napPiotr Jaroszyński2010-08-191-0/+40
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add umallocPiotr Jaroszyński2010-08-191-0/+126
| | | | | | | Add umalloc API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add uaccessPiotr Jaroszyński2010-08-191-0/+38
| | | | | | | | | | | | | | | Add user access API for linux. On linux userspace virtual == user == phys addresses. Physical addresses also being the same is wrong, but there is no general way of converting userspace addresses to physical as what appears to be contiguous in userspace is physically fragmented. Currently only the DMA memory is special-cased, but its conversion to bus addresses is done in phys_to_bus. This is known to break virtio as it is passing phys addresses to the virtual device. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add timerPiotr Jaroszyński2010-08-191-0/+80
| | | | | | | Add linux timer API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add consolePiotr Jaroszyński2010-08-191-0/+146
Add linux console using stdin/out. Configure the attached terminal for readline use. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>