Giter Site home page Giter Site logo

0xeax / no_std-cpuid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gz/rust-cpuid

0.0 0.0 0.0 1.7 MB

no_std cpuid library in rust that actually compiles.

Home Page: https://docs.rs/raw-cpuid/

License: MIT License

Rust 97.66% PowerShell 0.33% Shell 1.47% C 0.54%

no_std-cpuid's Introduction

cpuid Build Status Crates.io

A library to parse the x86 CPUID instruction, written in rust with no external dependencies. The implementation closely resembles the Intel CPUID manual description. The library does only depend on libcore.

The code should be in sync with the latest March 2018 revision of the Intel Architectures Software Developer’s Manual.

Library usage

let cpuid = CpuId::new();

match cpuid.get_vendor_info() {
    Some(vf) => assert!(vf.as_string() == "GenuineIntel"),
    None => ()
}

let has_sse = match cpuid.get_feature_info() {
    Some(finfo) => finfo.has_sse(),
    None => false
};

if has_sse {
    println!("CPU supports SSE!");
}

match cpuid.get_cache_parameters() {
    Some(cparams) => {
        for cache in cparams {
            let size = cache.associativity() * cache.physical_line_partitions() * cache.coherency_line_size() * cache.sets();
            println!("L{}-Cache size is {}", cache.level(), size);
        }
    },
    None => println!("No cache parameter information available"),
}

Documentation

no_std-cpuid's People

Contributors

gz avatar gabrielmajeri avatar waywardmonkeys avatar ericson2314 avatar 0xeax avatar tones111 avatar pireax avatar tylerwhall avatar alex-mckenna avatar spaceeraser avatar colinfinck avatar g2p avatar johnbartholomew avatar npmccallum avatar rafalmiel avatar

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.