1*2813126eSlogin #![no_std] // <1> 2*2813126eSlogin #![no_main] // <1> 3*2813126eSlogin #![feature(core_intrinsics)] // <2> 4*2813126eSlogin #[allow(non_upper_case_globals)] 5*2813126eSlogin #[allow(non_camel_case_types)] 6*2813126eSlogin #[allow(non_snake_case)] 7*2813126eSlogin 8*2813126eSlogin use core::ffi::c_char; 9*2813126eSlogin use core::intrinsics; // <2> 10*2813126eSlogin use core::panic::PanicInfo; // <3> 11*2813126eSlogin include!("include/bindings/bindings.rs"); 12*2813126eSlogin 13*2813126eSlogin #[panic_handler] 14*2813126eSlogin #[no_mangle] 15*2813126eSlogin pub fn panic(_info: &PanicInfo) -> ! { 16*2813126eSlogin intrinsics::abort(); // <4> 17*2813126eSlogin } 18*2813126eSlogin 19*2813126eSlogin #[no_mangle] 20*2813126eSlogin pub extern "C" fn __rust_demo_func() -> i32 { 21*2813126eSlogin unsafe{ 22*2813126eSlogin let f = b"\nDragonOS's Rust lib called printk_color()\n".as_ptr() as *const c_char; 23*2813126eSlogin printk_color(GREEN, BLACK, f); 24*2813126eSlogin } 25*2813126eSlogin return 0; 26*2813126eSlogin } 27