zl程序教程

您现在的位置是:首页 >  系统

当前栏目

【Linux 内核 内存管理】Linux 内核内存布局 ① ( 查看 Linux 操作系统位数 | 查看 Linux 操作系统软硬件信息 )

Linux内存内核操作系统 管理 查看 信息 布局
2023-06-13 09:18:05 时间

文章目录

一、查看 Linux 操作系统位数


64

位的 Linux 中 ,

  • 使用
48

位 表示 " 虚拟地址空间 " ;

  • 使用
45

位 表示 " 物理地址空间 " ;

执行

getconf LONG_BIT

命令 , 可以查看 Linux 操作系统 是

32

位还是

64

位的 ;

得到结果

64

, 说明该系统是

64

位 Ubuntu Linux 操作系统 ;

二、查看 Linux 操作系统软硬件信息


执行

cat /proc/cpuinfo

命令 , 可以查看 " Linux 内核位数 “ 和 ” 系统的软硬件信息 " ;

输出内容解析 :

  • vendor_id : GenuineIntel CPU 制造商 GenuineIntel
  • cpu family : 6 CPU 产品系列代号
  • model : 165 CPU 属于系列中的代号
  • model name : Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz CPU 名称 , 编号 , 主频
  • stepping : 5 CPU 的制作更新版本
  • cpu MHz : 2903.999 CPU 实际使用的主频
  • cache size : 16384 KB CPU 二级缓存大小
  • physical id : 0 单个 CPU 的标号
  • siblings : 1 单个 CPU 逻辑物理核心数量
  • core id : 0 当前 物理核心 在 CPU 中的编号
  • cpu cores : 1 逻辑核心 所在的 物理核心数
  • apicid : 0 区分不同的逻辑核心编号 , 该编号不一定连续 ;
  • bogomips : 5807.99 Linux 内核启动时测量的 CPU 速度
  • clflush size : 64 每次刷新的缓存大小
  • cache_alignment : 64 缓存地址对齐单位
  • address sizes : 42 bits physical, 48 bits virtual 虚拟地址位数 和 物理地址位数

完整输出内容 参考 :

root@ubuntu:~/kernel/linux-5.6.14# getconf LONG_BIT
64
root@ubuntu:~/kernel/linux-5.6.14# cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 165
model name	: Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz
stepping	: 5
microcode	: 0xc8
cpu MHz		: 2903.999
cache size	: 16384 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt arat md_clear flush_l1d arch_capabilities
vmx flags	: vnmi invvpid ept_x_only tsc_offset vtpr mtf ept vpid unrestricted_guest
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 5807.99
clflush size	: 64
cache_alignment	: 64
address sizes	: 42 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 165
model name	: Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz
stepping	: 5
microcode	: 0xc8
cpu MHz		: 2903.999
cache size	: 16384 KB
physical id	: 2
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt arat md_clear flush_l1d arch_capabilities
vmx flags	: vnmi invvpid ept_x_only tsc_offset vtpr mtf ept vpid unrestricted_guest
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 5807.99
clflush size	: 64
cache_alignment	: 64
address sizes	: 42 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 165
model name	: Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz
stepping	: 5
microcode	: 0xc8
cpu MHz		: 2903.999
cache size	: 16384 KB
physical id	: 4
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt arat md_clear flush_l1d arch_capabilities
vmx flags	: vnmi invvpid ept_x_only tsc_offset vtpr mtf ept vpid unrestricted_guest
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 5807.99
clflush size	: 64
cache_alignment	: 64
address sizes	: 42 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 165
model name	: Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz
stepping	: 5
microcode	: 0xc8
cpu MHz		: 2903.999
cache size	: 16384 KB
physical id	: 6
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 6
initial apicid	: 6
fpu		: yes
fpu_exception	: yes
cpuid level	: 22
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt arat md_clear flush_l1d arch_capabilities
vmx flags	: vnmi invvpid ept_x_only tsc_offset vtpr mtf ept vpid unrestricted_guest
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs itlb_multihit
bogomips	: 5807.99
clflush size	: 64
cache_alignment	: 64
address sizes	: 42 bits physical, 48 bits virtual
power management:

在虚拟机中的 Ubuntu Linux 打印出的参数是

42

位物理地址 ,

48

位虚拟地址 ;

address sizes	: 42 bits physical, 48 bits virtual