鸿蒙微内核游戏,华为鸿蒙微内核
該樓層疑似違規(guī)已被系統(tǒng)折疊?隱藏此樓查看此樓
Minix是《操作系統(tǒng):設(shè)計與實現(xiàn)》示例代碼。\ Linus的Linux內(nèi)核本身就參考了Minix。 Minix2.0.4http://download.minix3.org/previous-versions/Intel-2.0.4/小白入門的版本,需要自己做軟盤。 Minix 3.2.,Minix2.0.4 ps ax 界面:可以看到文件系統(tǒng),進程內(nèi)存管理這些已經(jīng)是系統(tǒng)獨立進程的形式存在了,在ps中可以看到FS,MM。但Minix2版本無法手動操作這些進程,可以看到它們的pid都是0。 Minix3ps 返回結(jié)果:FS變成了VFS,但實質(zhì)上一樣。試著殺掉VFS進程,系統(tǒng)馬上就不重啟了。 FS進程請求SYS進程將從磁盤讀取的內(nèi)容復(fù)制到用戶進程P的緩沖區(qū),這一步是沒有用戶進程參與的,所以FS進程至少要知道用戶進程P的內(nèi)存信息元數(shù)據(jù),這樣才可以讓內(nèi)核態(tài)的SYS進程完成復(fù)制操作。 MM服務(wù)進程,該進程為用戶進程的fork,exec,exit,wait等調(diào)用管理內(nèi)存,系統(tǒng)所有進程的快照保存在mproc數(shù)組中,詳見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讀取文件,微內(nèi)核只是把宏內(nèi)核的縱向通信換成了橫向通信而已。然而這個一縱一橫的背后,卻隱藏著大不同。縱向通信是實際發(fā)生的服務(wù)調(diào)用,即物理通信。橫向通信是對等層通信,即邏輯通信。 對于Minix微內(nèi)核的read場景,和TCP/IP的模型幾乎一致,在橫向?qū)Φ菼PC之下,宏內(nèi)核一個系統(tǒng)調(diào)用的事,微內(nèi)核的IPC竟然要12個系統(tǒng)調(diào)用,而且僅僅是send/receive重復(fù)6對!如此設(shè)計性能顯然好不了對于微內(nèi)核只需要send,receive兩個系統(tǒng)調(diào)用就夠了,所有的系統(tǒng)功能都可以通過send/receive兩個系統(tǒng)調(diào)用封裝IPC消息來完成:int read
總結(jié)
以上是生活随笔為你收集整理的鸿蒙微内核游戏,华为鸿蒙微内核的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 挽救Centos7.0
- 下一篇: 一张图解释几个监督学习的定义