Posts
秘秘秘秘秘密
Cancel

1. fork 1.1 基本解释 函数思想:fork()前 , 代码公用 , fork() 后, 代码公用 。仅凭借fork()的返回值判断为父进程还是子进程 父进程返回子进程pid 子进程返回0 1.2 代码 getpid() :获得当前进程的pid getppid():获得父进程的pid int main(){ pid_t pid = 0; pid = f...

1. open /** * x --- 1 * w --- 2 * r ---- 4 */ int main(){ int fd = 0; // 只写 fd = open("temp.txt",O_WRONLY); // 追加写 fd = open("temp2.txt",O_WRONL...

1. 程序分段 1.1 为什么要分段? 编译重定位 载入重定位 运行重定位 cpu本质上就是取指执行。 问题的核心, 指令地址在哪? 2.2 分段 引入段表 每个进程的pcb中,都有一根指向LDT表的指针。 LDT 表, 包含 段号,基地址,长度 有了段号,有了基地址,通过MMU就可以找到实际的物理地址。...

系统调用源码剖析 1. lib目录下的系统调用api close() #define __LIBRARY__ #include <unistd.h> _syscall1(int,close,int,fd) write() #define __LIBRARY__ #include <unistd.h> _syscall3(int,writ...

更新 sudo apt-get update 安装 sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal ubuntu-desktop vnc sudo apt-get install vnc4serve...

以8086为例 1.寄存器 通用寄存器(存放数据) AX -> AH AL BX CX -> 一般用来控制loop DX si di 与bx功能相近 ds 一般与 bx 配合作为数据段 段寄存器 地址计算方式: IP*16 + CS (20位) 指令地址: CS 段代码寄存器 IP 指令寄存器...

对前面几章的一点总结 int main(){ char dirName[] = "."; DIR *dir_ptr; /* the directory */ struct dirent *direntp; /* each entry */ struct stat info; if ((dir_ptr = opendir(dirName))...

1. 算法如何知道迭代器数据类型? typedef bidirectional_iterator_tag iteraotr_category; typedef T value_type; typedef Ptr pointer; typedef Ref reference; typedef ptrdiff_t defference_type; 很简单 直接点即可 algorithm...

1. 终端模式小结 2.1 规范模式 有缓冲 2.2 非规范模式 无缓冲 2.3 raw模式 2. 编写 play——again 2.1 版本1 #include <stdio.h> #include <termios.h> #define QUESTION "Do you want another transaction" int get_reso...

1. unix 文件目录 1.1 文件目录的工作过程 抽象模型为: 包含一个i-节点与文件名的表 ls -1ia (base) root@xm-System-Product-Name:/home/xm/xyx/linux_os# ls -1ia 1613828 . 1613831 .. 1606606 a.txt 1586697 b.txt 输出的为文件名与对应 i-节点号 1...

Trending Tags