IOS system analysis (1) read kernel preparation knowledge and ios System Analysis
BytesFor more technical tips, visit: Alibaba Cloud blog
0x01 iOS Architecture
1.1 overall architecture of iOS system
User Experience (The User Experience layer): SpringBoard also supports Spotlight.
Application Software Development Framework(The Application Frameworks layer): Cocoa Touch ).
Core development framework(The Core Frameworks ):The development environment of graphics and multimedia software, including the core framework, Open GL and QuickTime.
Darwin:System Kernel Core:Including KernelAndUnix Shell environment.
1.2 Darwin System
1.3 XNU Overview
Darwin is a unix-like operating system whose core is XNU.
XNU is a hybrid kernel. Combined with the mach and BSD kernels.
Mach is a micro-kernel implementation.
BSD is implemented on the upper layer of Mach. APIs provided by this layer support the POSIX standard model. XNU mainly implements some advanced APIs and modules.
1.3.1 Introduction to Mach microkernel
XNU provides the following functions:
Process and thread Abstraction
Virtual Memory Management
Task Scheduling
Inter-process communication
1.3.2 BSD kernel Introduction
BSD is implemented on the upper layer of Mach. APIs provided by this layer support the POSIX standard model. XNU mainly implements some advanced APIs and modules.
UNIX process model;
POSIX thread model (pthread) and related synchronization functions;
UNIX user and group management;
The network protocol stack (BSD Socket API) conforms to the POSIX model;
File System/device system;
1.3.3 libKern
1.3.4 I/O kit
The I/O kit is a device driver framework different from other operating systems. IOKit is an object-oriented driving model framework. It was a replica of DriverKit in the early days. The Driver Kit was written using Objective-C, while IOKit is a C ++ driving architecture, it has made great improvements on the basis of DriverKit. For example, IOKit can be written into the driver running in the user space (although most of them are still running in the kernel space ), therefore, the driver fails and the system does not. In addition, IOKit has taken into account the development trend of computers, so it is better in power management, plug-and-play, and dynamic loading.
0x02 iOS Security Mechanism
2.1 code signature
There should be a certificate, a public key, and a private key on the machine used by iOS developers. The core of the code signature mechanism. Like SSL, code signatures also rely on public key encryption systems that use the X.509 standard. Neither the user nor the developer can change the Application Enabling policy. You must have a developer account or publish a certificate for the application to run on iOS.
2.2 (Mandatory Access Control)
The basis of the entitlement mechanism of iOS. MAC stands for short. It is used to divide information in the system into different confidentiality levels and classes for management, so as to ensure that each user can only access the information indicated to be accessible by him. In general, in MAC, users and files are marked with fixed security attributes (such as security level and access permission). When each access occurs, the system detects security attributes to determine whether a user has the right to access the file ).
Sandbox mechanism (2.3)
Sandbox is a security mechanism that provides an isolated environment for running programs. When starting the sandbox, you can set whether the running program can access the network, files, directories, and so on.
Refer to in-depth analysis of Mac OS X & iOS operating systems
Link: http://blog.tingyun.com/web/article/detail/1134