Struct slos_hal::null_system::NullSystem [−][src]
Expand description
A SystemHardware implementation where (almost) everything has no-op
implementations
Behaviour
The following general rules apply:
Methods on HAL traits that return &'static mut T references to other HAL
trait objects return references to valid things, but those things are also
all no-op implementations (for example, NullConsole).
All methods that do not return a value are implemented as empty functions.
All methods that return a value will return either (a) a “sensible” value,
in the case where the value is critical to the kernel, (b) the same value
that Default::default would return, where Default is implemented for
the type, or (c) a manually-constructed default value for the type that
will make any operations on that type into no-ops.
Exceptions to the rules
-
SystemHardware::system_namereturns “slos-hal-nullsystem”. -
SystemHardware::has_requested_returnwill return the value of thehas_requested_returnfield of the struct - this field is set tofalsein the constructor, and set totrueon every call to theSystemKmainHooks::hook_kmain_loop_headmethod. This is done so thatkmainwill iterate exactly once before returning. -
If the
is_virtualizedfield of this struct is set totrue, theSystemHardware::virtualizationmethod will return a value indicating that the system is virtualized (the “virtualization type” field of the value is set toSystemHardware::system_name). If the field is set tofalse,Noneis returned.
Default values
This struct implements the Default trait, these are the values that
are set in that constructor:
NullSystem {
has_requested_return: false,
is_virtualized: true,
}Safety
This implementation will never panic directly.
Fields
has_requested_return: boolWhether to request a kmain return
is_virtualized: boolWhether to indicate the system is virtualized
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Disable interrupts on the current CPU
Enable interrupts on the current CPU
Return whether interrupts are enabled on the current CPU
Name of the crate implementing this system Read more
Get a reference to the default SystemConsole instance
Has the HAL has requested an immediate kmain return?
Current CPU