Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:22
    phil-opp commented #676
  • 12:01
    oyagci commented #676
  • Nov 21 00:57
    andyhhp commented #570
  • Nov 20 14:29
    phil-opp commented #676
  • Nov 20 02:49
    andyhhp commented #449
  • Nov 16 19:25

    phil-opp on master

    Clarified writing beyond the bu… (compare)

  • Nov 16 19:25
    phil-opp closed #685
  • Nov 16 19:24
    phil-opp commented #685
  • Nov 16 19:14
    djhworld opened #685
  • Nov 16 18:09
    phil-opp commented #403
  • Nov 16 18:03
    phil-opp commented #403
  • Nov 16 08:27
    shakram02 commented #627
  • Nov 16 08:26
    shakram02 commented #627
  • Nov 16 08:26
    shakram02 commented #627
  • Nov 15 20:07
    djhworld commented #403
  • Nov 12 09:30
    arnoldcui commented #403
  • Nov 11 16:12
    arnoldcui commented #403
  • Nov 11 10:49
    phil-opp commented #403
  • Nov 11 10:09
    arnoldcui commented #403
  • Nov 11 08:44
    Dentosal commented #283
Philipp Oppermann
@phil-opp
I tried to reproduce it on godbolt, but failed
Philipp Oppermann
@phil-opp
Is there a way to pass a target config file on godbolt?
Scott McWhirter
@konobi
mmm... good question, I haven't had to test out those edges... though I know some folks will run it locally for more fine grain debugging
Philipp Oppermann
@phil-opp
I created https://github.com/phil-opp/__floatdidf-issue for reproducing the issue. I think I'll open an issue in the rust repo, maybe someone knows what's going on
Philipp Oppermann
@phil-opp
I opened an issue at rust-lang/rust#62852
Aaron Deadman
@adeadman
:+1: I'd forgotten about disassembling the code from the stack trace, I think the v2 tutorial hasn't covered it yet. Thanks Philipp
Philipp Oppermann
@phil-opp
Yeah, the second edition provides no information about debugging at the moment. I'm still thinking about the best way to add it. My current plan is to add a "Debugging" post after the "Testing" post, which explains how to use gdb/lldb, QEMUs debug options, and objdump
Scott McWhirter
@konobi
I'm never sure how visible things like qemu monitor are to folks... all the no ui, but ridiculously helpful low-level helpers
Aaron Deadman
@adeadman
I'm now trying to draw antialiased lines using Xiaolin Wu's line drawing algorithm, which requires getting the fractional part of a number.
However, calling 1.75_f64.fract() leads to a linker error:
note: rust-lld: error: undefined symbol: fmod
          >>> referenced by arith.rs:560 (/Users/aaron/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore/ops/arith.rs:560)
          >>>               /Users/aaron/Development/x86/curi_os/target/x86_64-curi_os/debug/deps/curi_os-317ecf0cf7f99e86.5fqxd6e0jeohqd9.rcgu.o:(_$LT$f64$u20$as$u20$core..ops..arith..Rem$GT$::rem::h09842b402db57bb3)
I thought it might be something the num_traits crate isn't providing, but the linker error is against arith.rs in the core
Seems to be true for any of the functions on f64 that return a modified float - floor, round, trunc, etc.
Aaron Deadman
@adeadman
re-reading num_traits code, I think it's because only a subset of FloatCore is implemented, and these functions are not
Scott McWhirter
@konobi
looks like there's a PR stream to make some of those functions available in num_traits via libm: rust-num/num-traits#99
Ben Gubler
@nebrelbug
@adeadman could I see your code with the VESA framebuffer? I'd love to implement something like that.
Also, has anybody been able to get a graphics library working?
Aaron Deadman
@adeadman
Hi @nebrelbug sure. The bootloader code is on my public Github, and the vesa drawing code is in curi_os in the vesa branch.
I can't claim credit for the vesa mode init and framebuffer printer code though - Philipp and jabedude wrote most of that and you can see that here: https://github.com/jabedude/bootloader/tree/vesa
One thing that limits the effectiveness of a lot of this is the lack of float math in the kernel, as discussed above. I have written my own versions of functions to truncate floats and return the fractional part (actually most of those functions can be written as variations on fmod, which can be solved in a stupid way by moving closer to 0 by 1.0 in a while loop until you have a number smaller than 1.0)
Aaron Deadman
@adeadman
I was finally able to figure out how to create a double buffer by creating a lazy_static Vec<u16> using the allocator code (had to bump the heap size). This should mean I can add some mouse support or a proper scrolling vesa writer implementation that shifts the characters up as the screen fills
Philipp Oppermann
@phil-opp
@adeadman Awesome! I will keep an eye on your project!
Antoine
@AntoineSebert
Hello, I have a question about the toolchain choice :)
Do you think the OS will rely on the nightly version forever, or do you plan to switch to beta or stable at some point ?
Does it depend on the crates used within the project ?
Philipp Oppermann
@phil-opp

I would love to switch to beta/stable one day! The problem is that some essential features are still unstable, so that we have to use nightly at the moment. For example, writing an OS without inline assembly is not really possible.

It doesn't matter if the feature is used in your own crate or one of your dependencies. If you want to use stable, all dependencies must compile on stable too.

Scott McWhirter
@konobi
anyone tried targetting firecracker as target platform at all?
Philipp Oppermann
@phil-opp
Not yet
Antoine
@AntoineSebert
Do you plan to use Miri (https://github.com/rust-lang/miri) to perform undefined behavior checks ?
Philipp Oppermann
@phil-opp
I haven't tried it yet, but it would be definitely interesting. I added it as an optional item to the roadmap at https://github.com/phil-opp/blog_os/projects/2
Antoine
@AntoineSebert
I've tried it on my fork, but problems stopped the process.
Two possibilities: either the project does not support no_std environments yet, or either further configuration is required.
I'll investigate that.
Scott McWhirter
@konobi
Looks like they use std directly in a fair number of places
Antoine
@AntoineSebert
oh no
I checked the dependencies, you're right
hopefully it'll be working in no_std environments in a future release
Antoine
@AntoineSebert
Hi @phil-opp, I have a question concerning the roadmap item "Kernel Processes"
Do you already have an idea how the processes will be represented as a data strucure ?
ethindp
@ethindp
Hey all, a bit confused -- am working on PCI with external devices. I know that the PCI bus defines an "interrupt line" that can be read and written to to alter the interrupt line that the particular device I'm scanning uses. I've done some digging and am now wondering if its possible for me to dynamically update the IDT in drivers to add interrupts only when a driver is being used and not every time the kernel boots -- even if that interrupt isn't being used at all?
Antoine
@AntoineSebert
I don't think the IDT is supposed to change, but it's an interesting idea
As you can see, the IDT is static : static ref IDT: InterruptDescriptorTable
which means its location memory is fixed
modifying it may not be possible, for it might conflict with nearby elements in the memory
so in the current implementation, it's not possible, but it doesn't mean it's not possible at all
(although I do not really see the point)
Sammy Hajhamid
@pepsipu
hi!
when i burn my OS to a usb, it doesn't show up on boot options
any ideas?
oh that's because i'm on uefi my bad