Android 车载应用开发指南 - CarService 详解(下)

车载应用正在改变人们的出行体验。从导航到娱乐、从安全到信息服务,车载应用的开发已成为汽车智能化发展的重要组成部分。而对于开发者来说,如何将自己的应用程序无缝集成到车载系统中,利用汽车的硬件和服务能力,是一个极具挑战性的话题

那么,在Android平台上开发车载应用时,CarService究竟扮演了什么样的角色?它的功能和使用方法有哪些关键点?

随着车联网技术的普及,车载应用的种类和功能也在迅速增加,从简单的导航和音乐播放,到智能语音助手、驾驶行为分析等多样化的服务。CarService作为Android车载应用开发的基础组件,为开发者提供了与车辆深度交互的能力。在未来,车载应用的智能化、个性化将进一步提升驾驶体验,并成为汽车产品竞争的重要元素。

03 CarService 实现原理

想要弄清楚CarService实现方式,首先需要搞明白CarService的启动流程。

CarService 启动流程主要分为以下四个步骤:

  1. SystemServer 启动 CarServiceHelperService 服务

  2. 在调用 startService() 后,CarServiceHelperService 的onStart() 方法通过 bindService 的方式启动 CarService(一个系统级别的 APK,位于 system/priv-app)

  3. 启动 CarService 后首先调用 onCreate(),创建 ICarImpl 对象并初始化,在此时创建了一系列 Car 相关的核心服务,并遍历 init 初始化

  4. 然后调用 onBind 将该 ICarImpl 对象返回给CarServiceHelperService,CarServiceHelperService 在内部的一个 Binder 对象 ICarServiceHelperImpl传递给 CarService,建立双向跨进程

3.1 启动 CarServiceHelperService 服务

SystemServer会在startOtherServices()方法中让SystemServiceManager先通过反射的形式创建出StartCarServiceHelperService对象。

  • 源码路径:frameworks/base/services/java/com/android/server/SystemServer.java

 private void startOtherServices(@NonNull TimingsTraceAndSlog t) {     ...     // 仅在 automotive 中启动     if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {         t.traceBegin("StartCarServiceHelperService");         final SystemService cshs = mSystemServiceManager             .startService(CAR_SERVICE_HELPER_SERVICE_CLASS);         if (cshs instanceof Dumpable) {             mDumper.addDumpable((Dumpable) cshs);         }         if (cshs instanceof DevicePolicySafetyChecker) {             dpms.setDevicePolicySafetyChecker((DevicePolicySafetyChecker) cshs);         }         t.traceEnd();     }     ... }

然后在SystemServiceManager中调用StartCarServiceHelperService的onStart()方法。

CarServiceHelperService是CarService的 SystemService 端的配套服务。

  • 源码路径: 

frameworks/base/services/core/java/com/android/server/SystemServiceManager.java​​​​​​​

 public SystemService startService(String className) {     final Class<SystemService> serviceClass = loadClassFromLoader(className,             this.getClass().getClassLoader());     return startService(serviceClass); }  public void startService(@NonNull final SystemService service) {     // Register it. mServices.add(service);     long time = SystemClock.elapsedRealtime();     try {         service.onStart();     } catch (RuntimeException ex) {         throw new RuntimeException("Failed to start service " + service.getClass().getName()                 + ": onStart threw an exception", ex);     }     warnIfTooLong(SystemClock.elapsedRealtime() - time, service, "onStart"); } 

3.2 绑定 CarService 服务

  • 源码路径:frameworks/opt/car/services/src/com/android/internal/car/CarServiceHelperService.java​​​​​​​

     private static final String CAR_SERVICE_INTERFACE = "android.car.ICar";      @Override     public void onStart() {         EventLog.writeEvent(EventLogTags.CAR_HELPER_START);          IntentFilter filter = new IntentFilter(Intent.ACTION_REBOOT);         filter.addAction(Intent.ACTION_SHUTDOWN);         mContext.registerReceiverForAllUsers(mShutdownEventReceiver, filter, null, null);         mCarWatchdogDaemonHelper.addOnConnectionChangeListener(mConnectionListener);         mCarWatchdogDaemonHelper.connect();         Intent intent = new Intent();         intent.setPackage("com.android.car");  // 绑定包名,设置广播仅对该包有效         intent.setAction(CAR_SERVICE_INTERFACE);  // 绑定 action,表明想要启动能够响应设置的这个 action 的活动,并在清单文件 AndroidManifest.xml 中设置 action 属性         // 绑定后回调         if (!mContext.bindServiceAsUser(intent, mCarServiceConnection, Context.BIND_AUTO_CREATE,                 mHandler, UserHandle.SYSTEM)) {             Slogf.wtf(TAG, "cannot start car service");         }         loadNativeLibrary();     }

  • 源码路径:packages/services/Car/service/AndroidManifest.xml

sharedUserId 是系统级别的,类似 SystemUI,它编译出来同样是一个 APK 文件

  • 设备文件路径:/system/priv-app/CarService/CarService.apk

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"         xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"         package="com.android.car"         coreApp="true"         android:sharedUserId="android.uid.system">      ......     <application android:label="@string/app_title"          android:directBootAware="true"          android:allowBackup="false"          android:persistent="true">          <service android:name=".CarService"              android:singleUser="true"              android:exported="true">             <intent-filter>                 <action android:name="android.car.ICar"/>             </intent-filter>         </service>         ......     </application>

3.3 CarService 初始化

CarService进入启动时序后,会在onCreate()方法中进行一系列自身的初始化操作,步骤如下:

1)通过 HIDL 接口获取到 HAL 层的 IHwBinder 对象IVehicle,与 AIDL 的用法类似,必须持有 IHwBinder 对象我们才可以与 Vehicle HAL 层进行通信。

2)创建 ICarImpl 对象,并调用init方法,它就是ICar.aidl接口的实现类,我们需要通过它才能拿到其他的 Service 的 IBinder 对象。

3)将ICar.aidl的实现类添加到 ServiceManager 中。

4)设定 SystemProperty,将CarService设定为创建完成状态,只有包含CarService在内的所有的核心 Service 都完成初始化,才能结束开机动画并发送开机广播。

  • 源码路径:packages/services/Car/service/src/com/android/car/CarService.java​​​​​​​

     @Override     public void onCreate() {         LimitedTimingsTraceLog initTiming = new LimitedTimingsTraceLog(CAR_SERVICE_INIT_TIMING_TAG,                 Trace.TRACE_TAG_SYSTEM_SERVER, CAR_SERVICE_INIT_TIMING_MIN_DURATION_MS);         initTiming.traceBegin("CarService.onCreate");          initTiming.traceBegin("getVehicle");         // 获取 hal 层的 Vehicle service         mVehicle = getVehicle();         initTiming.traceEnd();         ...         //创建 ICarImpl 实例         mICarImpl = new ICarImpl(this,                 mVehicle,                 SystemInterface.Builder.defaultSystemInterface(this).build(),                 mVehicleInterfaceName);         //然后调用 ICarImpl 的 init 初始化方法         mICarImpl.init();          linkToDeath(mVehicle, mVehicleDeathRecipient);         //将该 service 注册到 ServiceManager         ServiceManager.addService("car_service", mICarImpl);         //设置 boot.car_service_created 属性         SystemProperties.set("boot.car_service_created", "1");          super.onCreate();          initTiming.traceEnd(); // "CarService.onCreate"     }      @Nullable     private static IVehicle getVehicle() {         final String instanceName = SystemProperties.get("ro.vehicle.hal", "default");          try {             //该 service 启动文件 hardware/interfaces/automotive/vehicle/2.0/default/android.hardware.automotive.vehicle@2.0-service.rc             return android.hardware.automotive.vehicle.V2_0.IVehicle.getService(instanceName);         } catch (RemoteException e) {             Slog.e(CarLog.TAG_SERVICE, "Failed to get IVehicle/" + instanceName + " service", e);         } catch (NoSuchElementException e) {             Slog.e(CarLog.TAG_SERVICE, "IVehicle/" + instanceName + " service not registered yet");         }         return null;     }

接着再看ICarImpl的实现,如下所示:

1)创建各个核心服务对象

2)把服务对象缓存到 CarLocalServices 中,这里主要是为了方便 Service 之间的相互访问

  • 源码路径:

/packages/services/Car/service/src/com/android/car/ICarImpl.java​​​​​​​

     @VisibleForTesting     ICarImpl(Context serviceContext, IVehicle vehicle, SystemInterface systemInterface,             String vehicleInterfaceName,             @Nullable CarUserService carUserService,             @Nullable CarWatchdogService carWatchdogService,             @Nullable ICarPowerPolicySystemNotification powerPolicyDaemon) {         ...         mContext = serviceContext;         mSystemInterface = systemInterface;         CarLocalServices.addService(SystemInterface.class, mSystemInterface);         //创建 VehicleHal 对象         mHal = constructWithTrace(t, VehicleHal.class,                 () -> new VehicleHal(serviceContext, vehicle));         ...         // 创建核心服务对象,并缓存到 CarLocalServices         mCarPropertyService = constructWithTrace(t, CarPropertyService.class, () -> new CarPropertyService(serviceContext, mHal.getPropertyHal()));         mCarDrivingStateService = constructWithTrace(t, CarDrivingStateService.class,() -> new CarDrivingStateService(serviceContext, mCarPropertyService));         mCarUXRestrictionsService = constructWithTrace(t, CarUxRestrictionsManagerService.class, () -> new CarUxRestrictionsManagerService(serviceContext, mCarDrivingStateService, mCarPropertyService));         ...          // 将创建的服务对象依次添加到一个 list 中保存起来         List<CarServiceBase> allServices = new ArrayList<>();         allServices.add(mFeatureController);         allServices.add(mCarUXRestrictionsService); // mCarUserService depends on it         allServices.add(mCarUserService);         allServices.add(mSystemActivityMonitoringService);         allServices.add(mCarPowerManagementService);         allServices.add(mCarPropertyService);         allServices.add(mCarDrivingStateService);         allServices.add(mCarOccupantZoneService);         addServiceIfNonNull(allServices, mOccupantAwarenessService);         allServices.add(mCarPackageManagerService);         allServices.add(mCarInputService);         allServices.add(mGarageModeService);            ...     }      @MainThread     void init() {         LimitedTimingsTraceLog t = new LimitedTimingsTraceLog(CAR_SERVICE_INIT_TIMING_TAG,                 Trace.TRACE_TAG_SYSTEM_SERVER, CAR_SERVICE_INIT_TIMING_MIN_DURATION_MS);          t.traceBegin("ICarImpl.init");          t.traceBegin("VHAL.init");         mHal.init();         t.traceEnd();          t.traceBegin("CarService.initAllServices");         //启动的所有服务遍历调用 init 初始化(各个都继承了 CarServiceBase)         for (CarServiceBase service : mAllServices) {             t.traceBegin(service.getClass().getSimpleName());             service.init();             t.traceEnd();         }         t.traceEnd(); // "CarService.initAllServices"          t.traceEnd(); // "ICarImpl.init"     }

然后将上面 onCreate() 创建的 mICarImpl 对象返回:

  1. onBind() 回调方法会继续传递通过 bindService() 传递来的 intent 对象(即上面的bindServiceAsUser方法)

  2. onUnbind() 会处理传递给 unbindService() 的 intent 对象。如果 service 允许绑定,onBind() 会返回客户端与服务互相联系的通信句柄

  • 源码路径:

/packages/services/Car/service/src/com/android/car/CarService.java​​​​​​​

     @Override     public IBinder onBind(Intent intent) {         return mICarImpl;     }

所以此处的 mICarImpl 会作为 IBinder 返回给CarServiceHelperService.java - bindServiceAsUser方法中的参数 mCarServiceConnection(回调)

3.4 回调 ServiceConnection

  • ICarImpl 初始化完毕,会作为 IBinder 返回给CarServiceHelperService.java - bindServiceAsUser方法中绑定此服务的 mCarServiceConnection(回调)

mCarServiceConnection 初始化如下:

  1. 其中返回的 ICarImpl 被保存在了 CarServiceHelperService 的 mCarService

  2. mCarService.transact 跨进程通信,调用 ICar.aidl 中定义的第一个方法 setCarServiceHelper

  • 源码路径:

/frameworks/opt/car/services/src/com/android/internal/car/CarServiceHelperService.java​​​​​​​

 private static final String CAR_SERVICE_INTERFACE = "android.car.ICar"; private IBinder mCarService; private final ICarServiceHelperImpl mHelper = new ICarServiceHelperImpl();      private final ServiceConnection mCarServiceConnection = new ServiceConnection() {         @Override         public void onServiceConnected(ComponentName componentName, IBinder iBinder) {             if (DBG) {                 Slogf.d(TAG, "onServiceConnected: %s", iBinder);             }             handleCarServiceConnection(iBinder);         }          @Override         public void onServiceDisconnected(ComponentName componentName) {             handleCarServiceCrash();         }     };          @VisibleForTesting     void handleCarServiceConnection(IBinder iBinder) {         synchronized (mLock) {             if (mCarServiceBinder == iBinder) {                 return; // already connected.             }             Slogf.i(TAG, "car service binder changed, was %s new: %s", mCarServiceBinder, iBinder);             //1. 返回的 ICarImpl 被保存在了 CarServiceHelperService 的 mCarServiceBinder             mCarServiceBinder = iBinder;             Slogf.i(TAG, "**CarService connected**");         }          sendSetSystemServerConnectionsCall();         ...     }      private void sendSetSystemServerConnectionsCall() {         Parcel data = Parcel.obtain();         data.writeInterfaceToken(CAR_SERVICE_INTERFACE);         data.writeStrongBinder(mHelper.asBinder());         //将 ICarServiceHelperImpl 类型的对象作为数据跨进程传递         data.writeStrongBinder(mCarServiceConnectedCallback.asBinder());         IBinder binder;         synchronized (mLock) {             binder = mCarServiceBinder;         }         int code = IBinder.FIRST_CALL_TRANSACTION;         try {             //2. 跨进程传输             //对端是 mCarService 即 ICarImpl,调用 binder 的 transact 进行跨进程通信             //其 code 代表需要调用的对端方法,data 为携带的传输数据             //FIRST_CALL_TRANSACTION  = 0x00000001,即调用对端 ICar.aidl 中定义的第一个方法 setCarServiceHelper             if (VERBOSE) Slogf.v(TAG, "calling one-way binder transaction with code %d", code);             // oneway void setSystemServerConnections(in IBinder helper, in IBinder receiver) = 0;             binder.transact(code, data, null, Binder.FLAG_ONEWAY);             if (VERBOSE) Slogf.v(TAG, "finished one-way binder transaction with code %d", code);         }         ...     }

跨进程 setSystemServerConnections​​​​​​​

     @Override     public void setSystemServerConnections(IBinder helper, IBinder receiver) {         Bundle bundle;         try {             EventLog.writeEvent(EventLogTags.CAR_SERVICE_SET_CAR_SERVICE_HELPER,                     Binder.getCallingPid());             assertCallingFromSystemProcess();             //将 ICarServiceHelper 的代理端保存在 ICarImpl 内部 mICarServiceHelper             ICarServiceHelper carServiceHelper = ICarServiceHelper.Stub.asInterface(helper);             synchronized (mLock) {                 mICarServiceHelper = carServiceHelper;             }             //同时也传给了 SystemInterface             //此时他们有能力跨进程访问 CarServiceHelperService             mSystemInterface.setCarServiceHelper(carServiceHelper);             mCarOccupantZoneService.setCarServiceHelper(carServiceHelper);             mCarUserService.setCarServiceHelper(carServiceHelper);             ...     }

3.5 小结

CarService的启动时序如下所示:

 

 

04 总结

本文讲解了CarService的总体结构、使用方法及启动流程。


CarService中实现的功能非常庞大,可以说相比传统手机端的 Android 系统,AAOS 中独特且最重要的部分都在 Framework 的CarService中。

  • 首先 CarService 是一个系统级别的服务 APK,类似 SystemUI,其在开机时由 SystemServer 通过 CarServiceHelperService 启动。

  • CarServiceHelperService 通过绑定服务的方式启动 CarService,启动之后创建了一个 Binder 对象 ICarImpl,并通过 onBind 返回给 system_server 进程。

  • ICarImpl 构造方法中创建了一系列和汽车相关的核心服务,并依次启动这些服务即调用各自 init 方法。ICarImpl 返回给 CarServiceHelperService 之后,CarServiceHelperService 也将其内部的一个 Binder 对象(ICarServiceHelperImpl)传递到了 CarService 进程,自此 CarService 和 system_server 两个进程建立了双向 Binder 通信。

  • ICarImpl 返回给 CarServiceHelperService 之后,CarServiceHelperService 也将其内部的一个 Binder 对象(ICarServiceHelperImpl)传递到了 CarService 进程,自此 CarService 和 system_server 两个进程建立了双向 Binder 通信。

 

CarService为Android车载应用开发者提供了一个强大而灵活的平台,让应用程序能够充分利用汽车的硬件和服务能力,打造更加智能化和便捷的驾驶体验。掌握CarService的使用,是车载应用开发中的重要一环,也是实现车载生态系统中创新应用的关键。

“在车载应用的世界里,技术的每一次进步,都是为了让行驶的每一公里更加安全、便捷和愉悦。”

 END 

链接:https://juejin.cn/post/7353827463632404517  本文为转载,转载文章所包含的文字来源于作者。如因内容或版权等问题,请联系进行删除

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/883638.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【Docker】01-Docker常见指令

1. Docker Docker会下载镜像&#xff0c;运行的时候&#xff0c;创建一个隔离的环境&#xff0c;称为容器。 docker run -d \ # 创建并运行一个容器&#xff0c;-d表示后台运行 --name mysql \ # 容器名称-p 3307:3306 \ # 端口映射&#xff0c;宿主机端口映射到容器端口-e TZ…

Cilium + ebpf 系列文章-什么是ebpf?(一)

前言&#xff1a; 这篇非常非常干&#xff0c;很有可能读不懂。 这里非常非常推荐&#xff0c;建议使用Cilium官网的lab来辅助学习&#xff01;&#xff01;&#xff01;Resources Library - IsovalentExplore Isovalents Resource Library, your one-stop destination for ins…

linux命令:显示已安装在linux内核的模块的详细信息的工具modinfo详解

目录 一、概述 二、使用方法 1、基本的使用语法 2、常用选项 3、输出字段 4、获取帮助 三、示例 四、实际用途 1、诊断问题 2、模块依赖 3、参数配置 五、其他事项 一、概述 modinfo 是 Linux 系统中的一个工具&#xff0c;用于显示有关已安装内核模块的详细信息。…

中间件:maxwell、canal

文章目录 1、底层原理&#xff1a;基于mysql的bin log日志实现的&#xff1a;把自己伪装成slave2、bin log 日志有三种模式&#xff1a;2.1、statement模式&#xff1a;2.2、row模式&#xff1a;2.3、mixed模式&#xff1a; 3、maxwell只支持 row 模式&#xff1a;4、maxwell介…

MySQL多版本并发控制MVCC实现原理

MVCC MVCC 是多版本并发控制方法&#xff0c;用来解决读和写之间的冲突&#xff0c;比如脏读、不可重复读问题&#xff0c;MVCC主要针对读操作做限制&#xff0c;保证每次读取到的数据都是本次读取之前的已经提交事务所修改的。 概述 当一个事务要对数据库中的数据进行selec…

十七,Spring Boot 整合 MyBatis 的详细步骤(两种方式)

十七&#xff0c;Spring Boot 整合 MyBatis 的详细步骤(两种方式) 文章目录 十七&#xff0c;Spring Boot 整合 MyBatis 的详细步骤(两种方式)1. Spring Boot 配置 MyBatis 的详细步骤2. 最后&#xff1a; MyBatis 的官方文档&#xff1a;https://mybatis.p2hp.com/ 关于 MyBa…

828华为云征文|使用Flexus X实例安装宝塔面板教学

目录 一、Flexus X实例简介 1.1 概述 1.2 产品规格 二、切换操作系统 2.1 Huawei Cloud EulerOS 2.0 标准版 2.2 切换镜像 三、部署宝塔面板 3.1 安装宝塔面板 3.2 放通安全组规则 3.3 登录宝塔面板 四、使用感受 4.1 柔性算力随心配 4.2 一直加速一直快 4.3 越用…

【小程序】微信小程序课程 -2 快速上手

目录 1、快速上手基本概念 1.1 小程序常用组件 1.2 tabbar配置 1.3 尺寸单位 1.4 样式 1.4.1 全局样式 app.wxss 1.4.2 局部样式 xx.wxss 2、首页案例 2.1 button组件使用 2.2 swiper swiper-item 2.3 tips效果 2.4 引入矢量图 2.5 flex&#xff08;布局&#…

Java中List、ArrayList与顺序表

List、ArrayList与顺序表 List什么是List常用方法介绍List的使用 ArrayList与顺序表线性表顺序表接口的实现 ArrayList简介ArrayList的使用ArrayList的构造ArrayList的常见操作ArrayList的遍历ArrayList的扩容机制 ArrayList的具体使用杨辉三角简单的洗牌算法 ArrayList的问题及…

2024.9.26 作业 +思维导图

一、作业 1、什么是虚函数&#xff1f;什么是纯虚函数 虚函数&#xff1a;函数前加关键字virtual&#xff0c;就定义为虚函数&#xff0c;虚函数能够被子类中相同函数名的函数重写 纯虚函数&#xff1a;把虚函数的函数体去掉然后加0&#xff1b;就能定义出一个纯虚函数。 2、基…

前台项目启动/打包报错 Error: error:0308010C:digital envelope routines::unsupported

在package.json中修改启动/打包语句 如图&#xff0c;我这里是打包时候报错&#xff0c;就在build里前面加上 set NODE_OPTIONS--openssl-legacy-provider && 再次打包&#xff0c;成功。

刷题计划 day10 栈与队列上【用栈实现队列】【用队列实现栈】【有效的括号】【删除字符串中的所有相邻重复项】

⚡刷题计划day10栈与队列继续&#xff0c;可以点个免费的赞哦~ 往期可看专栏&#xff0c;关注不迷路&#xff0c; 您的支持是我的最大动力&#x1f339;~ 目录 ⚡刷题计划day10继续&#xff0c;可以点个免费的赞哦~ 往期可看专栏&#xff0c;关注不迷路&#xff0c; 您的…

Vue引入js脚本问题记录(附解决办法)

目录 一、需求 二、import引入问题记录 三、解决方式 一、需求 我想在我的Vue项目中引入jquery.js和bootstrap.js这种脚本文件&#xff0c;但发现不能单纯的import引入&#xff0c;问题如下。 二、import引入问题记录 我直接这么引入&#xff0c;发现控制台报错TypeError: …

使用kaggle命令下载数据集和模型

点击用户头像&#xff0c;点击Settings&#xff1a; 找到API&#xff0c;点击create new token&#xff0c;将自动下载kaggle.json&#xff1a; 在用户目录下创建.kaggle文件夹&#xff0c;并将下载的kaggle.json文件移动到该文件夹&#xff1a; cd ~ mv Downloads/kaggle.j…

postman控制变量和常用方法

1、添加环境&#xff1a; 2、环境添加变量&#xff1a; 3、配置不同的环境&#xff1a;local、dev、sit、uat、pro 4、 接口调用 5、清除cookie方法&#xff1a; 6、下载文件方法&#xff1a;

数据结构升华部分:排序与字符串匹配算法应用

数据结构入门学习&#xff08;全是干货&#xff09;——综合应用 习题选讲 - 排序与字符串匹配算法 习题选讲 - Insert or Merge 习题-IOM.1 插入排序的判断 题意理解 如何区分简单插入和非递归的归并排序 插入排序&#xff1a;前面有序&#xff0c;后面没有变化。归并排…

react hooks--useCallback

概述 useCallback缓存的是一个函数&#xff0c;主要用于性能优化!!! 基本用法 如何进行性能的优化呢&#xff1f; useCallback会返回一个函数的 memoized&#xff08;记忆的&#xff09; 值&#xff1b;在依赖不变的情况下&#xff0c;多次定义的时候&#xff0c;返回的值是…

【计算机组成原理】实验一:运算器输入锁存器数据写实验

目录 实验要求 实验目的 主要集成电路芯片及其逻辑功能 实验原理 实验内容及步骤 实验内容 思考题 实验要求 利用CP226实验箱上的K16&#xff5e;K23二进制拨动开关作为DBUS数据输入端&#xff0c;其它开关作为控制信号的输入端&#xff0c;将通过K16&#xff5e;K23设定…

Linux:终端(terminal)与终端管理器(agetty)

终端的设备文件 打开/dev目录可以发现其中有许多字符设备文件&#xff0c;例如对于我的RedHat操作系统&#xff0c;拥有tty0到tty59&#xff0c;它们是操作系统提供的终端设备。对于tty1-tty12使用ctrlaltF*可以进行快捷切换&#xff0c;下面的命令可以进行通用切换。 sudo ch…

【Linux】项目自动化构建工具-make/Makefile 详解

&#x1f525; 个人主页&#xff1a;大耳朵土土垚 &#x1f525; 所属专栏&#xff1a;Linux系统编程 这里将会不定期更新有关Linux的内容&#xff0c;欢迎大家点赞&#xff0c;收藏&#xff0c;评论&#x1f973;&#x1f973;&#x1f389;&#x1f389;&#x1f389; 文章目…