Tier: 3

Lynx LynxOS-178 POSIX Real-time operating system.

This support has been implemented by Ferrous Systems as part of the Ferrocene Compiler.

Note that LynxOS-178 is a different RTOS to LynxOS. There is no support for LynxOS in this target, only LynxOS-178.

Target maintainers

  • Jonathan Pallant jonathan.pallant@ferrous-systems.com, https://ferrous-systems.com


This target is cross-compiled. There is no support for std. There is no default allocator, but it's possible to use alloc by supplying an allocator.

This target generates binaries in the ELF format. Any alternate formats or special considerations for binary layout will require linker options or linker scripts. The target requires you to have the i386-lynx-lynxos178-gcc-7.1.0 linker from Lynx mosa-ic 2022.07 or similar.

Building Rust programs

Precompiled arfefacts are only supplied with the Ferrocene compiler. Only libcore is available, not libstd.

# install cross-compile toolchain
criticalup target add i386-lynx-lynxos178
# target flag may be used with any cargo or rustc command
cargo build --target i386-lynx-lynxos178

Small example application


use core::fmt::Write;

/// Represents our standard output stream.
pub struct STDOUT;

impl core::fmt::Write for &STDOUT {
    fn write_str(&mut self, s: &str) -> core::fmt::Result {
        unsafe {
            write(1, s.as_ptr(), s.len());

#[link(name = "c")]
extern "C" {
    pub fn write(fd: i32, ptr: *const u8, len: usize) -> i32;
    pub fn _exit(code: i32);

pub extern "C" fn main() -> isize {
    writeln!(&STDOUT, "Hello, LynxOS-178").unwrap();

/// The default panic handler - prints the panic to stdout.
fn panic(info: &core::panic::PanicInfo) -> ! {
    let _ = writeln!(&STDOUT, "Panic!: {:#?}", info);
    unsafe {
    loop {}

This example will need to be linked against both lib/libc.a and lib/libpthread.a. You can use a build.rs file to do this:

fn main() {
    let bsp_path = std::env::var("BSP_ROOT").expect("Set BSP_ROOT");
    println!("cargo:rustc-link-search=native={}/lib", bsp_path);


As i386-lynx-lynxos178 does not support std, this target does not support running the Rust test suite.