Code Monkey home page Code Monkey logo

rust-framebuffer's People

Contributors

apinlt avatar baskerville avatar belak avatar brownjohnf avatar disasm avatar roysten avatar sn2234 avatar wathiede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rust-framebuffer's Issues

use libc types

I should probably define the constants as the c_ulong type, to enable compilation on both 64 and 32 bit systems.

License?

Hello! Can you please document what license this code is released under?

ioctl return -1 when running rust logo example using kdMode::Graphics

When I run the rust-logo example, it failed with this error message:

❯ sudo cargo run --example rust-logo
    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `target/debug/examples/rust-logo`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: FramebufferError { kind: IoctlFailed, details: "Ioctl returned -1: Inappropriate ioctl for device" }', examples/rust-logo/main.rs:18:56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Source Line:

 18   │     let _ = Framebuffer::set_kd_mode(KdMode::Graphics).unwrap();

And backtrace:

❯ sudo RUST_BACKTRACE=1 cargo run --example rust-logo
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/examples/rust-logo`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: FramebufferError { kind: IoctlFailed, details: "Ioctl returned -1: Inappropriate ioctl for device" }', examples/rust-logo/main.rs:18:56
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1651:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1076:23
   4: rust_logo::main
             at ./examples/rust-logo/main.rs:18:13
   5: core::ops::function::FnOnce::call_once
             at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I knows only a little about fbdev and IDW why the problem occurs and how to fix it. Much appreciate if you could help :)

FrameBuffer::new should not take a &str argument

Instead should take AsRef<Path>.
This should be a backwards compatible change.

Without this, I have to convert my path to a &str before giving it to the function.

Same concept is implemented in std::fs::File::open.

Implement Debug for Framebuffer

Is there a reason for the Framebuffer struct to not implement the Debug trait? I want to store a Framebuffer inside a struct which implements Debug, but this results in an error. I don't think I can implement this trait on Framebuffer in my own project.

I checked the File and Mmap structs which Framebuffer uses and they both implement Debug, so there should not be an issue to do the same for Framebuffer, right?

I need your help

Apparently the values in var_screen_info and fix_screen_info differ among drivers. Could you please post the driver you are using and the debug output from the two structs?

let fb = Framebuffer::new("/dev/fb0");
println!("{:?} {:?}", fb.var_screen_info, fb.fix_screen_info);

Thanks!

--Not needed anymore!--

Display Example output on README

Hi,

I don't have required rust configuration on my current computer, so i can't execute examples given for this library.
Can you show what the output would looks like?

Regards,
PE

Errors when trying to cross compile to ARM

Compiling on a x86 computer for an arm target :

cargo build --release --example rust-logo --target arm-unknown-linux-gnueabi

The error is :

# ./rust-logo 
./rust-logo: /lib/libc.so.6: version `GLIBC_2.28' not found (required by ./rust-logo)
./rust-logo: /lib/libc.so.6: version `GLIBC_2.18' not found (required by ./rust-logo)
./rust-logo: /lib/libc.so.6: version `GLIBC_2.33' not found (required by ./rust-logo)
./rust-logo: /lib/libc.so.6: version `GLIBC_2.32' not found (required by ./rust-logo)
./rust-logo: /lib/libc.so.6: version `GLIBC_2.34' not found (required by ./rust-logo)

This is because the target linux system is an "old" linux which I can't upgrade : https://linux-sunxi.org/Bookeen_Cybook_Muse

I tried to build with musleabi to avoid the dependency on libc6 :

cargo build --release --example rust-logo --target armv7-unknown-linux-musleabi

with config :

cat ~/.cargo/config.toml
[target.armv7-unknown-linux-musleabi]
linker = "/home/arthur/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld"

This works for a "Hello World" rust binary, but doesn't for rust-framebuffer :

The result is :

# ./rust-logo 
thread 'main' panicked at examples/rust-logo/main.rs:15:61:
called `Result::unwrap()` on an `Err` value: BmpError { kind: BmpIoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }), details: "BMP Error: Io Error" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
# RUST_BACKTRACE=1 ./rust-logo 
thread 'main' panicked at examples/rust-logo/main.rs:15:61:
called `Result::unwrap()` on an `Err` value: BmpError { kind: BmpIoError(Os { code: 2, kind: NotFound, message: "No such file or directory" }), details: "BMP Error: Io Error" }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
   3: rust_logo::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.