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_name
returns “slos-hal-nullsystem”. -
SystemHardware::has_requested_return
will return the value of thehas_requested_return
field of the struct - this field is set tofalse
in the constructor, and set totrue
on every call to theSystemKmainHooks::hook_kmain_loop_head
method. This is done so thatkmain
will iterate exactly once before returning. -
If the
is_virtualized
field of this struct is set totrue
, theSystemHardware::virtualization
method 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
,None
is 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: bool
Whether to request a kmain
return
is_virtualized: bool
Whether 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