Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any future plans? Maybe a server version? #1

Open
edimoldovan opened this issue Aug 30, 2023 · 9 comments
Open

Any future plans? Maybe a server version? #1

edimoldovan opened this issue Aug 30, 2023 · 9 comments

Comments

@edimoldovan
Copy link

Hi,

Very interesting experiment.
I was wondering, do you foresee any ongoing development? Any plans perhaps for a dedicated server OS? This last one sort of triggered my imagination, would be interesting to be able to work in an environment where I can extend the environment with my own functionality written in Rust, run various other services also written in Rust.

ed

@Ruddle
Copy link
Owner

Ruddle commented Aug 30, 2023

Hey, thanks for reaching out.

Fomos working as a server is a nice target. An easier one than as a desktop since having native GPU driver is near impossible without interest from GPU vendors. Although such a feat was shown possible recently with Asahi Linux.

Ideally, Fomos stays slim and simple enough that the only difference between the desktop binary and the server binary is the presence of an optional GPU drivers.

However we are a long way from any production use. For several months, maybe years, experimentation has to happen to even know how to go forward on the current base.

  • Can security be made reasonable whilst keeping the cooperative scheduling. This is the most controversial issue.
  • Where exactly does Fomos end, where do apps start. I would like to see how slim a kernel can be, and still be a better experience than current systems from an app developer (that doesn't want to rely on magic) point of view.

From there things could go fast !

@edimoldovan
Copy link
Author

Great points, thank you for replying.

Is there anything I can help with? I have some knowledge of Rust, not too deep though, but I would be happy to beef that up.

@Ruddle
Copy link
Owner

Ruddle commented Sep 1, 2023

That is great !
First of all, can you run the project ? the build.sh script supposes that a lot of tooling is already present.
If you could try to build and run the project, and give a feedback of everything you needed to install, that would be very useful for newcomers. Do not hesitate to reach out if you get stuck.
Next, you could try to make a simple app for Fomos and tell us about your experience, and how it could be better.

@edimoldovan
Copy link
Author

Happy to, will schedule these for next week and come back to as soon as I'm done.

@edimoldovan
Copy link
Author

I tried it out earlier than planned. It failed to run though. Forgot to mention earlier use a macbook pro M1 so with a ubuntu 22 lts arm64 in quemu.

This is my detailed output:

Finished release [optimized] target(s) in 0.05s
     Running `target/release/loader`
/home/ed/dev/Fomos/bootloader/target/release/build/loader-482d20e557f365c0/out/uefi.img
thread 'main' panicked at src/main.rs:53:33:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
stack backtrace:
   0:     0xaaaab7f05264 - std::backtrace_rs::backtrace::libunwind::trace::h5c6701fe76905843
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0xaaaab7f05264 - std::backtrace_rs::backtrace::trace_unsynchronized::hb7114239f75bc9ed
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0xaaaab7f05264 - std::sys_common::backtrace::_print_fmt::hb217c686754478b8
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/sys_common/backtrace.rs:67:5
   3:     0xaaaab7f05264 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd920426b9d39cb1c
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/sys_common/backtrace.rs:44:22
   4:     0xaaaab7f23a28 - core::fmt::rt::Argument::fmt::h10f93969b8c34951
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/core/src/fmt/rt.rs:138:9
   5:     0xaaaab7f23a28 - core::fmt::write::h9b7e2566d0d837b5
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/core/src/fmt/mod.rs:1094:21
   6:     0xaaaab7f02b9c - std::io::Write::write_fmt::h1d3a92f6733ca1dc
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/io/mod.rs:1714:15
   7:     0xaaaab7f05098 - std::sys_common::backtrace::_print::hd3a796ad260d6b9b
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/sys_common/backtrace.rs:47:5
   8:     0xaaaab7f05098 - std::sys_common::backtrace::print::hfccf3063f35f005c
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/sys_common/backtrace.rs:34:9
   9:     0xaaaab7f06790 - std::panicking::panic_hook_with_disk_dump::{{closure}}::h2d31d267ffb2f97a
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:280:22
  10:     0xaaaab7f06474 - std::panicking::panic_hook_with_disk_dump::hfae769aaab008269
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:314:9
  11:     0xaaaab7f06db0 - std::panicking::default_hook::hd662de88e69a9816
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:239:5
  12:     0xaaaab7f06db0 - std::panicking::rust_panic_with_hook::h383de6a29f55479d
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:753:13
  13:     0xaaaab7f06c74 - std::panicking::begin_panic_handler::{{closure}}::h26018fe37ec7c66d
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:631:13
  14:     0xaaaab7f05748 - std::sys_common::backtrace::__rust_end_short_backtrace::h5a62a684156a6ccb
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/sys_common/backtrace.rs:170:18
  15:     0xaaaab7f069bc - rust_begin_unwind
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:619:5
  16:     0xaaaab7ee7d30 - core::panicking::panic_fmt::h33ea0d9ce74ed839
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/core/src/panicking.rs:72:14
  17:     0xaaaab7ee8018 - core::result::unwrap_failed::h585dfc30b60b8f02
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/core/src/result.rs:1652:5
  18:     0xaaaab7ee8da0 - loader::main::h0c5259ec8251419a
  19:     0xaaaab7ee839c - std::sys_common::backtrace::__rust_begin_short_backtrace::he216beb4be4856e2
  20:     0xaaaab7ee83b0 - std::rt::lang_start::{{closure}}::h549c68fbf3e5e34d
  21:     0xaaaab7eff80c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd57aebb7fb3ad364
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/core/src/ops/function.rs:284:13
  22:     0xaaaab7eff80c - std::panicking::try::do_call::h0252a342e5d11b63
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:526:40
  23:     0xaaaab7eff80c - std::panicking::try::ha851f9c92da04d3c
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:490:19
  24:     0xaaaab7eff80c - std::panic::catch_unwind::h292f7b13be756a43
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panic.rs:142:14
  25:     0xaaaab7eff80c - std::rt::lang_start_internal::{{closure}}::h0f6ac2ed473c66b9
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/rt.rs:148:48
  26:     0xaaaab7eff80c - std::panicking::try::do_call::ha3d5bbcfe4c88a0b
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:526:40
  27:     0xaaaab7eff80c - std::panicking::try::he47b8dbc1a385f8a
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panicking.rs:490:19
  28:     0xaaaab7eff80c - std::panic::catch_unwind::ha5fb54945abff01a
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/panic.rs:142:14
  29:     0xaaaab7eff80c - std::rt::lang_start_internal::h39ae99ee584f62ec
                               at /rustc/35e416303e6591a71ef6a91e006c602d2def3968/library/std/src/rt.rs:148:20
  30:     0xaaaab7ee8e74 - main
  31:     0xffff94fc73fc - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  32:     0xffff94fc74cc - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  33:     0xaaaab7ee82b0 - _start
  34:                0x0 - <unknown>

@Ruddle
Copy link
Owner

Ruddle commented Sep 3, 2023

I found an old macbook air 2015, and managed to reproduce this error !
It did not have qemu installed, (the qemu-system-x86_64 binary exactly). So I did
brew install qemu , ./build.sh again and it worked (until the next error).

However it is not simple, the qemu shipped this way is not compiled with SDL. For an unknown reason I cannot get graphics to work fast without SDL.

SDL might not be needed, but I had to switch to it to use the virtio-vga-gl.

We need someone that knows more about qemu to remove that SDL dependency.

Meanwhile, you have 2 options:

  • Compile qemu with SDL
  • OR replace those 2 lines in ./bootloader/src/main.rs
      cmd.arg("-device").arg("virtio-vga-gl");
      cmd.arg("-display").arg("sdl,gl=on");

by this one

      cmd.arg("-device").arg("virtio-vga");

@Ruddle
Copy link
Owner

Ruddle commented Sep 3, 2023

You might not have KVM on your machine, which means you need to remove the --enable-kvm option from
./bootloader/src/main.rs too.

@Ruddle
Copy link
Owner

Ruddle commented Sep 3, 2023

I started a doc detailing how to build here
BUILD.md

@edimoldovan
Copy link
Author

I was able to make it run, though the graphical performance was not very good, quite slow.
The way I did it I installed qemu in Ubuntu, the default install I guess was missing SDL as you mentioned. Then I removed the two lines and replaced with the one you suggested. Rebuilt and it worked.

Also did a build of qemu from source, no I'm trying to figure to figure out how I can use that for a new Fomos build, to see if the performance is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants