main.rs 871 B

1234567891011121314151617181920212223242526
  1. use clap::{command, ColorChoice, Parser};
  2. use crown::kernel::boot;
  3. use crown::kernel::boot::Cli as BootCli;
  4. use tracing::debug;
  5. static KERNEL_JAM: &[u8] =
  6. include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/bootstrap/http.jam"));
  7. #[derive(Parser, Debug)]
  8. #[command(about = "Tests various poke types for the kernel", author = "zorp", version, color = ColorChoice::Auto)]
  9. struct TestCli {
  10. #[command(flatten)]
  11. boot: BootCli,
  12. }
  13. #[tokio::main]
  14. async fn main() -> Result<(), Box<dyn std::error::Error>> {
  15. let cli = TestCli::parse();
  16. debug!("KERNEL_JAM len: {:?}", KERNEL_JAM.to_vec().len());
  17. boot::init_default_tracing(&cli.boot.clone());
  18. let mut http_app = boot::setup(KERNEL_JAM, Some(cli.boot.clone()), &[], "choo")?;
  19. http_app.add_io_driver(crown::http_driver()).await;
  20. http_app.run().await.expect("Failed to run app");
  21. Ok(())
  22. }