services in OS implementations

本文详细阐述了操作系统的主要组成部分,包括内核、系统程序及其具体功能模块,并深入探讨了硬件服务、用户服务及应用服务三类服务的具体内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

As a structuring principle, we identify three categories of services in OS implementations: hardware services, user services, and application services.

  • Hardware services include the OS kernel and device drivers, which abstract and multiplex hardware, along with file systems and TCP/IP networking stack.
  • User services in the OS include the graphical user interface (GUI) shell and desktop, clipboard, search indexers, etc.
  • Application services in the OS include the API implementation; to an application, these comprise the OS personality. Applications services include frameworks, rendering engines, common UI controls, language runtimes, etc.

The application communicates with application services, which in turn communicate with hardware and user services.

操作系统 = 内核 + 系统程序
操作系统最底层的组件是内核,其上搭建了许多系统软件。内核至少包括的模块为:进程管理、内存管理、文件系统、设备管理、I/O管理、中断管理。
系统程序包括三个部分,分别是:编译环境应用程序接口用户接口

  • 编译环境包含汇编、C等低高级语言编译程序,连接程序和装载程序,这些程序将文本格式的程序语言转变为机器能识别和装载的机器代码。
  • 应用程序接口(API)包括内核提供的系统调用接口语言库函数(C、C++、JAVA等等)。系统调用是为了让应用程序使用内核服务,语言库函数是为了方便应用程序开发,所以将一些常用的基础功能预先编译以供食用,比如对C语言来说常用的C库等。
  • 用户接口(AUI)包括shell、系统服务程序(如X服务器等)和常用的应用程序(浏览器、字处理、编辑器)。

以上是一个典型结构,但不是一成不变。许多操作系统的发行中会有删减,比如应用于嵌入式设备的系统,对X服务器可能不做要求。但是像内核、系统调用等要素是必不可少的。

系统软件:系统软件是相对于应用软件而言的,应用软件针对用户需求编写,完成实际功能,而系统软件则是为了简化应用程序的开发而存在的。比如,数据库系统为应用软件提供了有效的数据传输、存储服务;编程语言的执行环境,由C库实现,也属于一种系统程序,为应用程序开发提供了诸如I/O操作例程,图形库,计算库等等基础服务。可见系统软件范围覆盖很广,只要面向的服务群体不是最终用户的软件都可以划归到系统软件中来

### AIDL Native Implementation and Concepts in Android Development In Android development, AIDL (Android Interface Definition Language) allows for inter-process communication (IPC), enabling different processes to communicate with each other by defining interfaces that both client and service agree upon[^1]. For native implementations involving C or C++, this process becomes more intricate due to the limitations on developing third-party applications directly in native code. When integrating AIDL with native components such as those written in C/C++, developers often need to bridge Java-based IPC mechanisms provided through AOSP frameworks into their native modules. This bridging typically involves modifying build scripts like `Android.mk` files located within directories similar to `$AOSP/frameworks/base/core/java/android/joffee/`, ensuring proper compilation paths are set up for JNI bindings between Java and native layers[^2]. For specific examples related to how certain system-level services interact via binder mechanism at a lower level, one can refer to source codes available under `$AOSP/frameworks/base/core/jni`. An illustrative case is the implementation details of `MemoryFile`, which shows interaction patterns using Binder for cross-process memory sharing implemented partly in C++ inside `$AOSP/frameworks/base/core/jni/android/os_MemoryFile.cpp_`[^3]. ```cpp // Example snippet from android_os_MemoryFile.cpp showing part of the native side handling. #include "JNIHelp.h" #include <memory> extern "C" { JNIEXPORT void JNICALL Java_android_os_MemoryFile_nativeCreate(JNIEnv* env, jobject thiz, jlong size); } ``` This demonstrates how native methods registered here would handle requests coming over from Java-side calls made against an AIDL-defined interface when dealing with objects requiring direct manipulation outside managed runtime environment boundaries.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值