C
Introduction C是一种面向过程的编程语言
CS162 Lecture 3: Processes, System Calls, and Fork
Process PCB process control block保存了进程的各种信息,调度器维护了这个数据结构 switch System Call 系统调用是用户内核跳转的一种方式,连接了用户空间和内核空间 fork OS提供了不同的系统调用接口来处理进程,如fork,但是用户使用的是被打包后的系统调用 process api fork Thread posix pthread是一种行业标准,其致力于提供一个在不同操作系统中适用的半标准的线程接口
CS162 Lecture 2: Four Fundamental Concepts of Operating Systems
4 Concepts Thread 独立执行的上下文单元 一个线程被认为是一个虚拟的cpu核心 拥有自己的PC,register,stack, 当一个线程被执行是指处理器核心维护了这个线程有关的寄存器 当一个线程被挂起是指这个线程有关的上下文被保存在内存中,处理器核心在执行其他线程 一个线程要么运行在cpu核心上,要么被保存在Thread Control Block(TCB)中 Address Space 也被叫做Virtual Address Space,是操作系统提供给进程的虚拟地址空间 地址空间是一系列地址以及和地址有关的状态 32bit和64bit处理器拥有的地址空间是不一样的 Process 有隔离性的运行环境 拥有自己的内存(address space)和文件描述符,文件系统上下文 一个进程可以有多个线程 进程里交流是容易的,进程间交流时困难的 Dual mode operation / Protection 硬件至少提供了两个mode,kernel和user,两者拥有不同的硬件权限 通过...
CS162 HW 0: Introduction
Docker配置环境 教程 也可以参考课程网站配置VirtualBox,但我的机子跑不出来😭 Docker目录挂载 获取实验仓库 1git clone git@github.com:Berkeley-CS162/student0.git 目录挂载 1docker run -it --rm --name pintos --mount type=bind,source=/home/huayi/student0,target=/home/PKUOS/pintos pkuflyingpig/pintos bash 可以让主机和docker镜像共用目录 Tools 老生常谈的几个工具了 exercise
CS162 Lecture 1: Intro to CS162: What is an operating system?
软硬件接口 在CS61C中我们已经学习过机器架构,操作系统的一大目的是,为应用程序抽象硬件的细节,而只提供特定功能的接口。 OS概览 操作系统将硬件分别抽象成进程中的各个部分,进程就是操作系统提供的一个编程抽象,应用程序眼中的“机器”就是被抽象后的硬件——进程。 进程切换 操作系统可以在不同进程中切换,由于时间很短,这造成了不同进程同时运行的假象。 操作系统在不同进程中提供隔离性,用户进程不能访问属于内核的进程空间,否则触发Segmentation fault
UCB CS162: Operating Systems and Systems Programming
Course About 介绍有关操作系统的问题 Links 课程主页 课程视频 Pintos
MIT 6.S081 Lab thread
Compulsory exercises Preparation reading To start the lab, switch to the thread branch: 123git fetchgit checkout threadmake clean Uthread: switching between threads (moderate) Using threads (moderate) Barrier(moderate) Optional challenge exercises The user-level thread package interacts badly with the operating system in several ways. For example, if one user-level thread blocks in a system call, another user-level thread won’t run, because the user-level threads scheduler doesn’t know th...
MIT 6.S081 Lecture 17: Virtual memory for applications
Reading Read Virtual Memory Primitives for User Programs (1991)
