[v0.87][DOC] Explain commit #42ade63 in documentation. Add Android information in README

This commit is contained in:
Dr-Noob
2020-11-22 09:20:35 +01:00
parent 5b0cbd622f
commit f5ec566577
2 changed files with 35 additions and 9 deletions

View File

@@ -34,10 +34,16 @@ If the CPU supports it, we are done. If not:
#### How to get cache sizes? #### How to get cache sizes?
__Involved code: get_cache_info (cpuid.c)__ __Involved code: get_cache_info (cpuid.c)__
- Intel: We use CPUID leaf 0x4 First, we check if CPU supports the given cpuid level:
- AMD: We use extended CPUID leaf 0x1D
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? #### How to get CPU microarchitecture?
__Involved code: get_cpu_uarch (cpuid.c), get_uarch_from_cpuid (uarch.c)__ __Involved code: get_cpu_uarch (cpuid.c), get_uarch_from_cpuid (uarch.c)__

View File

@@ -4,14 +4,23 @@ Simplistic yet fancy CPU architecture fetching tool
![cpu1](i9.png) ![cpu1](i9.png)
### Platforms ### 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 | | Platform | Intel | AMD | ARM | Notes |
|:---------:|:-------------------------:|:------------------------:|:------------------------:|:-----------------:| |:---------:|:-------------------------:|:------------------------:|:------------------------:|:-----------------:|
| Linux | :heavy_check_mark: | :heavy_check_mark: |:interrobang: | Prefered platform. <br> Experimental ARM support | | Linux | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Prefered platform. <br> Experimental ARM support |
| Windows | :heavy_check_mark: | :heavy_check_mark: | :x: | Some information may be missing. <br> Colors will be used if supported | | Windows | :heavy_check_mark: | :heavy_check_mark: | :x: | Some information may be missing. <br> 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 | | 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 ### Usage and installation
#### Linux #### Linux
@@ -22,9 +31,11 @@ If you are in other distro, you can build `cpufetch` from source (see below)
#### Windows #### 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. 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 #### Android
Just clone the repo and use `make` to compile it You need to build `cpufetch` from source (see below).
### Building from source
#### Linux and Windows
``` ```
git clone https://github.com/Dr-Noob/cpufetch git clone https://github.com/Dr-Noob/cpufetch
cd cpufetch cd cpufetch
@@ -32,9 +43,18 @@ make
./cpufetch ./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. Here are more examples of how `cpufetch` looks on different CPUs.