Giter Site home page Giter Site logo

vga's People

Contributors

bendudson avatar dbeckwith avatar ethindp avatar fluxehub avatar pfournier01 avatar phil-opp avatar rkennedy9064 avatar stackdoubleflow avatar tsatke 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vga's Issues

Broken build

Hello,

I was trying to compile a file using vga as a dependance. However, it uses an out of date version of the x86_64 crate (v0.12.4 while v0.13.2 is available as of writing).
With the new nightly versions, the old x86_64 refuses to compile. I therefore suggest that the dependency for x86_64 is updated.

Feedback Appreciated

This crate is fairly new, so I thought I'd take the approach that spinning_top took and ask for feedback if anyone's interested. My main goal was to get something working so I'm sure there are plenty of improvements. If anyone has some spare time to give it a look I'd greatly appreciate it.

add option to use on i686-unknown-none

trying to use the crate to make an operating system, but the build target is i686-unknown-none and this crate uses x86_64. wodnering how I could use it on a 32 bit system thanks.

the coloring of DEFAULT_PALETTE seems wrong

Hello! I'm a newbie user of this crate and have a question.
In src/colors.rs, the DEFAULT_PALETTE for 256 colors are defined. However, The coloring after 65th color is always 0x3f, 0x3f, 0x3f.
I think this is some kind of mistake, and we can improve it, for example, by conforming to one of the standards like mode 13h.
Since I'm quite new to this project, my opinion may be wrong. If so, please give me any feedback.

Machine shuts down after setting graphics mode

This is my current kernel main function:

extern crate vga;
use vga::colors::Color16;
use vga::writers::{Graphics640x480x16, GraphicsWriter};

#[no_mangle]
pub fn kmain()
{	
	log!("Booted!");
	let mode = Graphics640x480x16::new();
	log!("Created graphics mode");
	mode.set_mode();
	log!("Set graphics mode");
	mode.clear_screen(Color16::White);
	log!("Cleared screen");
	for (offset, character) in "Hello World!".chars().enumerate() {
		log!("Drawing character");
		mode.draw_character(270 + offset * 8, 72, character, Color16::Black)
	}
	loop {} // If we exit, the machine shuts down - we don't want that, so we loop forever
}

Before adding the vga crate, the system would boot and then hang at the loop at the end of the function - but now it seems to be rebooting repeatedly as you can see in the screenshot of the output below:

image

I'm not quite sure what the issue is - I'm following everything exactly as it is in the README. If you need to see more of the source, please let me know.

Edit: I also tested with text mode, and the same thing was happening: Everything was working right up to the point where I call text_mode.set_mode().

contribution

Are there any plans for this project?
I want to contribute to this but don't know the plan.

Creating a ScreenCharacter using TextModeColor

It would be easier for a vga writer to store a TextModeColor instead of storing both the foreground color and the background color. This will also make it easier to convert the current blog_os vga to use this crate.
Something like this for example:

pub struct VgaWriter {
    column_position: usize,
    color_code: TextModeColor,
    text_mode: Text80x25,
}

The issue with this would be when writing a character.

impl VgaWriter {
    fn write_byte(&mut self, byte: u8) {
        let row = self.text_mode.get_height() - 1;
        let col = self.column_position;
        self.text_mode.write_character(row, col, ScreenCharacter {
            character: byte, 
            color: color_code,
        });
        self.column_position += 1;
    }
}

The above code will not compile because character and color is private.
There are a couple options to for this:

  1. We could publicize character and color
  2. We could create an alternative function to ScreenCharacter::new that takes a TextModeColor instead of two Color16Bits

Thanks for this crate and hopefully I'm not misunderstanding all of this. I'm also open to contribute if it helps.

Broken build

On the latest nightly 1.49.0-nightly (ffa2e7ae8 2020-10-24) the dependency x86_64 ^0.11.0 is causing the issue. One of the build-time errors is, for example:

error[E0658]: mutable references are not allowed in constant functions
   --> C:\Users\xxxx\.cargo\registry\src\github.com-1ecc6299db9ec823\x86_64-0.11.8\src\structures\idt.rs:402:30
    |
402 |                 interrupts: [Entry::missing(); 256 - 32],
    |                              ^^^^^^^^^^^^^^^^
    |
    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

I think this is due to the new rust feature const_mut_refs and the issue has been fixed in x86_64 ^0.12. A dependency bump would be great :)

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.