Expand description
Starina standard library for applications.
This is libstd
in Starina. All components
except the kernel use this library.
§APIs you should to know
Here are the most frequently used APIs that you will encounter first:
info!
,warn!
,error!
,debug!
,trace!
: Logging macros.Channel
: A channel for inter-process communication.Environ
: Environment variables in Starina.
§Server APIs
Servers are long-running processes that provide services to clients, such as device drivers, filesystem drivers, TCP/IP stack, and so on.
Mainloop
: An event loop for applications.
§Device driver APIs
In Starina, device drivers are servers with the hardware access. To control the hardware conveniently, Starina provides the following APIs:
MappedFolio
: A physically-contiguous memory region for DMA/MMIO access.Interrupt
: Hardware interrupt handling.starina_driver_utils::mmio
: Type-safe MMIO access.starina_driver_utils::DmaBufferPool
: The DMA buffer pool allocator.
§Prelude
The prelude
module contains the most common types and traits that you’ll
use in Starina programs. Here is an idiomatic way to import the prelude:
use starina_api::prelude::*;
Re-exports§
pub use starina_types as types;
Modules§
- A message-passing channel.
- Collections.
HashMap
,HashSet
,VecDeque
,BinaryHeap
, and more. - Environ, a collection of key-value pairs passed to the application.
- A contiguous page-aliged memory block.
- Kernel object handle types.
- A hardware interrupt object.
- Logging utilities.
- The mainloop for applications.
- A polling API, similar to Linux’s
epoll
. - Frequently used types and traits.
- Low-level printing utilities.
- A semaphore-like API.
- Synchronization primitives such as
Arc
andWeak
. - Low-level system call interfaces.
- A virtual address space object.
Macros§
- Embeds the code generated by
starina_autogen
crate. - Logs with
LogLevel::Debug
. - Similar to
warn!
, but only logs in debug mode. - Logs with
LogLevel::Error
. - Logs with
LogLevel::Info
. - Logs a message.
- Prints a string without a newline.
- Prints a string and a newline.
- Logs with
LogLevel::Trace
. - Logs with
LogLevel::Warn
.