diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index fbce3d6..fdb93ca 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -34,10 +34,16 @@ If the CPU supports it, we are done. If not: #### How to get cache sizes? __Involved code: get_cache_info (cpuid.c)__ -- Intel: We use CPUID leaf 0x4 -- AMD: We use extended CPUID leaf 0x1D +First, we check if CPU supports the given cpuid level: -If CPU does not support it, we are dead: cpufetch can't get this information. If CPU does, we can fetch it, and 0x4 in Intel behaves the same way as 0x1D in AMD. +- Intel: CPUID leaf 0x00000004 (standard) +- AMD: CPUID leaf 0x8000001D (extended) + +Intel behaves the same way with 0x00000004 as AMD with 0x8000001D, so the same code can be reused. + +If AMD does not support this level, we fallback to the old method, using 0x80000005 and 0x80000006. I observed that the old method returns the full size for L3 cache. However, in the other one (using 0x8000001D), L3 size is reported as the size of a single cache, and we also can fetch how many cores shares the cache. This means that the old method in new CPUs reports a wrong L3 cache size. Therefore, the old methold should not be used in new AMD CPUs. Finally, if AMD CPU does not support, cpufetch can't get cache information. + +If Intel does not support this level, cpufetch can't get this information. #### How to get CPU microarchitecture? __Involved code: get_cpu_uarch (cpuid.c), get_uarch_from_cpuid (uarch.c)__ diff --git a/README.md b/README.md index 4a17994..1e73cc6 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,23 @@ Simplistic yet fancy CPU architecture fetching tool ![cpu1](i9.png) ### Platforms -cpufetch currently supports x86_64 CPUs (both Intel and AMD CPUs) and ARM (experimental support) +cpufetch currently supports x86_64 CPUs (both Intel and AMD) and ARM (experimental support) | Platform | Intel | AMD | ARM | Notes | |:---------:|:-------------------------:|:------------------------:|:------------------------:|:-----------------:| -| Linux | :heavy_check_mark: | :heavy_check_mark: |:interrobang: | Prefered platform.
Experimental ARM support | +| Linux | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Prefered platform.
Experimental ARM support | | Windows | :heavy_check_mark: | :heavy_check_mark: | :x: | Some information may be missing.
Colors will be used if supported | +| Android | :heavy_exclamation_mark: | :heavy_exclamation_mark: | :heavy_check_mark: | Experimental ARM support | | macOS | :heavy_exclamation_mark: | :heavy_exclamation_mark: | :heavy_exclamation_mark: | Untested | +| Emoji | Meaning | +|:-----------------------:|:-------------:| +|:heavy_check_mark: | Supported | +|:x: | Not Supported | +|:heavy_exclamation_mark: | Unested | + + + ### Usage and installation #### Linux @@ -22,9 +31,11 @@ If you are in other distro, you can build `cpufetch` from source (see below) #### Windows In the [releases](https://github.com/Dr-Noob/cpufetch/releases) section you will find some cpufetch executables compiled for Windows. Just download and run it from Windows CMD. -#### Building from source -Just clone the repo and use `make` to compile it +#### Android +You need to build `cpufetch` from source (see below). +### Building from source +#### Linux and Windows ``` git clone https://github.com/Dr-Noob/cpufetch cd cpufetch @@ -32,9 +43,18 @@ make ./cpufetch ``` -The Makefile is designed to work on both Linux and Windows. +#### Android +I recommend using `termux` terminal emulator. Once you installed it, run the following commands: -### Example +``` +pkg install -y git make clang +git clone https://github.com/Dr-Noob/cpufetch +cd cpufetch +make +./cpufetch +``` + +### Examples Here are more examples of how `cpufetch` looks on different CPUs.