summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorRegina König2020-06-24 03:04:53 +0200
committerRegina König2020-06-24 03:04:53 +0200
commitbb5070f32720b3f878767467ec0d3601d9f27b9e (patch)
tree7911eff5cbf751ae413a921faa1409ecb3765589 /documentation
parentsome new files (diff)
downloadmemtest86-bb5070f32720b3f878767467ec0d3601d9f27b9e.tar.gz
memtest86-bb5070f32720b3f878767467ec0d3601d9f27b9e.tar.xz
memtest86-bb5070f32720b3f878767467ec0d3601d9f27b9e.zip
some documentation of cpuid.c
Diffstat (limited to 'documentation')
-rw-r--r--documentation/memtest86+ code/cpuid_c_h69
-rw-r--r--documentation/memtest86+ code/todo5
2 files changed, 72 insertions, 2 deletions
diff --git a/documentation/memtest86+ code/cpuid_c_h b/documentation/memtest86+ code/cpuid_c_h
index e69de29..39d2069 100644
--- a/documentation/memtest86+ code/cpuid_c_h
+++ b/documentation/memtest86+ code/cpuid_c_h
@@ -0,0 +1,69 @@
+*.h contains data structures required for CPUID implementation
+
+CPUID_VENDOR_LENGTH 3 3 GPRs hold Vendor ID
+CPUID_VENDOR_STR_LENGTH (CPUID_VENDOR_LENGTH * sizeof(uint32_t) + 1) uint32_t = unsigned int
+CPUID_BRAND_LENGTH 12 12 GPRs hold vendor ID
+CPUID_BRAND_STR_LENGTH (CPUID_BRAND_LENGTH * sizeof(uint32_t) + 1) extra byte for '\0'
+
+ASM Code:
+static inline void __cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {}
+-----------------------------------------------------------------------------------------------------------
+TODO
+
+static inline void cpuid(unsigned int op,unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {}
+---------------------------------------------------------------------------------------------------------------------------
+TODO
+
+
+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(unsigned int op, int count, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) {}
+------------------------------------------------------------------------------------------------------------------------------------------
+TODO
+
+
+typedef union / bitfields:
+ LENGTH
+cpuid_cache_info_t Store cache information
+cpuid_vendor_string_t Store the CPUID Vendor String
+cpuid_brand_string_t Store CPUID Brand String
+cpuid_version_t 32 Store CPUID Version
+cpuid_proc_info_t 32 Store CPUID Processor Information
+cpuid_custom_features 1 ?? Store CPUID Feature flags
+cpuid_feature_flags_t 96 Store CPUID Feature flags
+
+
+struct:
+
+cpu_ident Overall structure to cache all of the CPUID information
+cpuid4_eax TODO
+cpuid4_ebx TODO
+cpuid4_ecx TODO
+
+
+
+*.c
+-----
+
+void get_cpuid() {}
+---------------------
+Get max std cpuid & vendor ID
+ op = 0x0
+
+Get processor family information & feature flags
+ op = 0x00000001
+
+Get the digital thermal sensor & power management status bits
+ op = 0x00000006
+
+Get the max extended cpuid
+ op = 0x80000000
+
+Get extended feature flags, only save EDX
+ op = 0x80000001
+
+Get the brand ID
+ op = 0x80000002 0x80000003 0x80000004
+
+Get cache information
+ switch AMD or Intel. Intel is done in init.c
+
diff --git a/documentation/memtest86+ code/todo b/documentation/memtest86+ code/todo
index 53119ef..a7fc0d0 100644
--- a/documentation/memtest86+ code/todo
+++ b/documentation/memtest86+ code/todo
@@ -1,2 +1,3 @@
-SMP
-APM
+TestScreenbuffer.c: ttyprint is outcommented
+
+cpuid.h: asm code