Notes
  • Introduce
  • Go
    • Grammar
      • Basic
      • Goroutines & Channels
      • Test
    • System Library
      • Module
      • sync
      • context
      • net
    • Concurrency in Go
    • The Go Memory Model
    • Code Snippet
  • Rust
    • The Rust Programming Language
    • Rust by Example
  • JAVA
    • Preface
    • Grammar
      • Basic
      • Data Types
      • Operator
      • Exceptions
    • Class Libraries
      • Collection
      • Stream
      • IO
      • NIO
      • RMI
    • Concurrency
      • Preface
      • JMM
      • Synchronized & CAS
      • Deadlock
      • Thread
      • Lock & Condition
      • Utility Class
      • Thread-safe Collection
      • Atomic Class
      • Fork/Join
      • Concurrency Design Patterns
        • Immutable
        • Copy-on-Write
        • ThreadLocal
        • Multitheading If
        • Division
    • JVM
      • Class & Instance Initialization
      • Runtime Data Area
      • Garbage Collection
    • Web Container
      • Tomcat Architecture
      • Jetty Architecture
    • Spring
    • Tuning
      • Programming
  • Computer Science
    • Computer Organization
    • Algorithm
      • Complexity
      • Linear List
      • Sort
      • Binary Search
      • Skip List
      • Hash Table
      • Tree
      • Graph
      • String Matching
      • Bloom Filter
      • Greedy Algorithm
      • Divide and Conquer
      • Back Tracking
      • Dynamic Programming
    • Network Protocol
      • Pysical Layer
      • Data Link Layer
      • Network Layer
      • Transport Layer
      • Application layer
      • HTTP
      • HTTP/2 in Action
    • Operating System
      • Basic
      • System Initialization
      • Diagnostic Tools
      • CPU Diagnosis
      • Memory Diagnosis
      • Disk Diagnosis
      • Network Diagnosis
      • Monitor System
    • Design Patterns
      • UML
      • OOP
      • Principle
      • Refactoring & Specification
      • Creational
        • Singleton
        • Factory
        • Builder
        • Prototype
      • Structural
        • Proxy
        • Bridge
        • Decorator
        • Adapter
        • Facade
        • Composite
        • FlyWeight
      • Behavioral
        • Observer
        • Template Method
        • Strategy
        • State
        • Iterator
        • Chain of Responsibility
    • Distributed System
      • Protocol & Algorithm
      • Transcation
      • Theory
      • Resource Management
      • Scheduling
      • Computing
      • Message Queue
      • Cache
      • Consistent Hashing
  • database
    • InfluxDB
      • In-Memory Index
      • Meta
    • MySQL
      • SQL
      • Architecture
      • Log
      • Transaction
      • Indexing
      • Lock
      • Storage
    • Redis
    • Elasticsearch
      • Local Debug
    • HBase
    • Kafka
    • ZooKeeper
  • Reading
    • RocketMQ
    • 演说之禅
    • So Good They Can't Ignore You
    • 学会提问
    • Lecture
  • Other
    • v2ray
    • Kubernetes
    • Git
    • Maven
    • Anaconda And Conda
    • Fuck! Shit!
      • Remove Final by Reflection
      • Ingress Host
      • ExecuterService submit
  • Open source contribution
Powered by GitBook
On this page

Was this helpful?

  1. Computer Science
  2. Operating System

System Initialization

CPU

  • 计算单元

  • 数据单元

    • 缓存

    • 寄存器组

  • 控制单元

    • 指令起始地址寄存器(CS):

    • 数据起始地址寄存器(DS):

    • 指令指针寄存器(IP):下一条指令在内存中的地址

    • 指令寄存器:代码段

总线:

  • 地址总线:位数决定了能访问到的地址范围

  • 数据总线:位数决定了一次能拿多少数据

x86:

  • 总线位宽:16

  • 地址位:20

Linux 启动过程中有三个特殊进程:

  • 0 号 idle 进程,初始化 1、2 号进程后演变为空闲任务,CPU 没有其它任务运行时就运行它。

  • 1 号 init 进程,通常为 systemd 进程,在用户态运行,用于管理其它用户态进程。

  • 2 号 kthreadd 进程,内核态运行,用于管理所有内核态线程。

常见的内核线程有:

  • ksoftirqd:处理软中断,每个 CPU 有一个。

  • kswapd0:用于内存回收。

  • kworker:执行内核工作队列。分为绑定 CPU 和未绑定 CPU 两类。

  • migration:负载均衡过程中,把进程迁移到 CPU,每个 CPU 有一个。

  • jdb2/sda1-8:为文件系统提供日志功能,保证数据完整性。每个使用 ext4 的磁盘,都有一个 jdb2 线程。

  • pdflush:将内存中的脏页写入磁盘。新版本已合入 kworker 中。

PreviousBasicNextDiagnostic Tools

Last updated 4 years ago

Was this helpful?