鸿蒙微内核游戏,华为鸿蒙微内核
該樓層疑似違規已被系統折疊?隱藏此樓查看此樓
Minix是《操作系統:設計與實現》示例代碼。\ Linus的Linux內核本身就參考了Minix。 Minix2.0.4http://download.minix3.org/previous-versions/Intel-2.0.4/小白入門的版本,需要自己做軟盤。 Minix 3.2.,Minix2.0.4 ps ax 界面:可以看到文件系統,進程內存管理這些已經是系統獨立進程的形式存在了,在ps中可以看到FS,MM。但Minix2版本無法手動操作這些進程,可以看到它們的pid都是0。 Minix3ps 返回結果:FS變成了VFS,但實質上一樣。試著殺掉VFS進程,系統馬上就不重啟了。 FS進程請求SYS進程將從磁盤讀取的內容復制到用戶進程P的緩沖區,這一步是沒有用戶進程參與的,所以FS進程至少要知道用戶進程P的內存信息元數據,這樣才可以讓內核態的SYS進程完成復制操作。 MM服務進程,該進程為用戶進程的fork,exec,exit,wait等調用管理內存,系統所有進程的快照保存在mproc數組中,詳見mm/mproc.h文件:/* This table has one slot per process. It contains all the memory management* information for each process. Among other things, it defines the text, data* and stack segments, uids and gids, and various flags. The kernel and file* systems have tables that are also indexed by process, with the contents* of corresponding slots referring to the same process in all three.*/EXTERN struct mproc {struct mem_map mp_seg[NR_SEGS];/* points to text, data, stack */char mp_exitstatus;/* storage for status when process exits */char mp_sigstatus;/* storage for signal # for killed procs */pid_t mp_pid;/* process id */pid_t mp_procgrp;/* pid of process group (used for signals) */pid_t mp_wpid;/* pid this process is waiting for */int mp_parent;/* index of parent process */...// } mproc[NR_PROCS];// fs/fproc.h:/* This is the per-process information. A slot is reserved for each potential* process. Thus NR_PROCS must be the same as in the kernel. It is not possible* or even necessary to tell when a slot is free here.*/EXTERN struct fproc {mode_t fp_umask;/* mask set by umask system call */struct inode *fp_workdir;/* pointer to working directory's inode */struct inode *fp_rootdir;/* pointer to current root dir (see chroot) */struct filp *fp_filp[OPEN_MAX];/* the file descriptor table */...// } fproc[NR_PROCS];// 同樣是read讀取文件,微內核只是把宏內核的縱向通信換成了橫向通信而已。然而這個一縱一橫的背后,卻隱藏著大不同??v向通信是實際發生的服務調用,即物理通信。橫向通信是對等層通信,即邏輯通信。 對于Minix微內核的read場景,和TCP/IP的模型幾乎一致,在橫向對等IPC之下,宏內核一個系統調用的事,微內核的IPC竟然要12個系統調用,而且僅僅是send/receive重復6對!如此設計性能顯然好不了對于微內核只需要send,receive兩個系統調用就夠了,所有的系統功能都可以通過send/receive兩個系統調用封裝IPC消息來完成:int read
總結
以上是生活随笔為你收集整理的鸿蒙微内核游戏,华为鸿蒙微内核的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 挽救Centos7.0
- 下一篇: 一张图解释几个监督学习的定义