当前位置:网站首页>[mit 6.s081] LEC 3: OS organization and system calls notes
[mit 6.s081] LEC 3: OS organization and system calls notes
2022-07-27 18:27:00 【PeakCrosser】
Lec 3: OS organization and system calls
- Ref: https://github.com/huihongxiao/MIT6.S081/tree/master/lec03-os-organization-and-system-calls
- Preparation: xv6 book Chapter 2
Topic
- Isolation Isolation,
- Kernel/User mode kernel / User mode
- System Call system call
- xv6 Realization
Isolation Isolation,
Unix Interface - Realize reuse and physical memory isolation :
- abstract the HW resource Abstract hardware resources
- process: instead CPU process : The application communicates with the CPU In exchange for , Abstract the CPU
- exec: instead of memory Load the image , Memory isolation
- files: instead of disk block file system : Abstracted disk blocks
Defensive Defensive
App cannot crash the OS
App cannot break out of its isolation
Strong isolation through hardware Strong Isolation between apps + OS
typical: HW support:
- user/kernel mode
- virtual memory
user/kernel mode
user: unprivileged instructions - ADD, SUB, JRC, BRANCH
kernel: privileged instructions - setup page table Set the page table register , Turn off clock interrupt
virtual memory
page table: virtual addr -> physical addr
process has own page table
memory isolation
User/Kernel mode Switch

RISC-V: ECALL Instructions : Control is transferred from the user to the kernel 
Each application initiates a system call through syscall function
Kernel = Trusted Computing Base(TCB) The kernel is called a trusted computing space
- Kernel must have no bugs
- Kernel must treat processes as malicious
Monolithic Kernel vs Micro Kernel Macro kernel vs Microkernel
- Macro kernel : All operating system services are in kernel mode
- shortcoming : There is a lot of code in the kernel , Bug hidden danger
- somewhat : Sub modules in the same program , Good performance
- Microkernel : The kernel has only a few modules
- advantage : Less Bug
- shortcoming : Performance loss of user mode and kernel mode switching ; Sharing difficulties
xv6: Macro kernel
Kernel compilation
- Makefile Read C file , call gcc compiler Generate .s Of RISC-V Assembly language files
- Call the assembly interpreter to generate .o Binary file
- All kernels C The document repeats 1, 2 The operation of
- System loader (Loader) Collect all .o file , Link together to generate kernel files

Pass to QEMU Several parameters of :
- kernel: What is passed here is the kernel file (kernel In the catalog kernel file ), This is what will happen in the future QEMU Program files running in .
- m: The message here is RISC-V The amount of memory that the virtual machine will use
- smp: What is passed here is what the virtual machine can use CPU Check the number
- drive: What is passed is the disk drive used by the virtual machine , What's coming in here is fs.img file

XV6 The boot process
kernel/entry.S -> kernel/start.c-start() -> kernel/main.c-main()-> kernel/proc.c-userinit() The first user process , Used to interact with the operating system
userinit() Will perform initcode Code , The system call will be executed SYS_exec, And execute user mode init Program (user/init.c), In the end shell Run up .
边栏推荐
- Deep learning - VIDEO behavior recognition: paper reading - two stream revolutionary networks for action recognition in videos
- 深度学习:GAN优化方法-DCGAN案例
- 请教大神一个问题 flinkcdc,同步mysql中的datetime字段会变为时间戳 有人遇到过吗
- You can't specify target table 'table name' for update in from clause error resolution in MySQL
- [MIT 6.S081] Lab 7: Multithreading
- Read only mode of buffer
- Marvell announced the roadmap of its arm server chip, and the performance of the next generation will be twice that of thunderx2
- 1542. Find the longest super substring hash + state compression
- [MIT 6.S081] Lab 11: networking
- [MIT 6.S081] Lec 1: Introduction and examples 笔记
猜你喜欢

Common commands of database 1
![[MIT 6.S081] Lab 3: page tables](/img/ea/94cdb4379733994adf3aa31cf2e826.png)
[MIT 6.S081] Lab 3: page tables

Salesforce runs all test classes and gets coverage reports
![[MIT 6.S081] Lec 9: Interrupts 笔记](/img/b6/a8d39aa7ede4eb1c5a74e6d15b3b1c.png)
[MIT 6.S081] Lec 9: Interrupts 笔记

Getting started with typora: the most complete tutorial in the whole network
![[MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6](/img/ca/e8c0827b13805c7c74cc41bf84c6ff.png)
[MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6

Deep learning: Gan case exercise -minst handwritten digits

Deep learning: Gan optimization method dcgan case

Local development using LWC in salesforce

深度学习:GAN案例练习-minst手写数字
随机推荐
Hackers use lasers to attack, and voice assistants can be activated from a distance of 100 meters
Year end summary template
Super practical! After reading the kubernetes study notes hidden by Alibaba P9, call NB directly
Disassembly of Xiaomi cc9 Pro: the cost of rear five shots is several times that of Xiaolong 855!
【学习笔记】lombok的@Builder注解
深度学习:GAT
Is it difficult to operate email safely? COREMAIL joins hands with cloud store to create a new ecosystem of corporate email office!
Golang waits for a group of goroutines to complete with the return value (2)
江苏华存首发PCIe 5.0 SSD主控:台积电12nm工艺,2020年量产
Interview FAQs 12
@DateTimeFormat 接收不到时分秒,转换时报类型异常
Marvell announced the roadmap of its arm server chip, and the performance of the next generation will be twice that of thunderx2
浅论分布式训练中的recompute机制
Guoju spent $1.8 billion to acquire its competitor KEMET, and the transaction may be completed in the second half of next year
Jianan Yunzhi has completed the pre roadshow and is expected to land on NASDAQ on November 20
收藏!0 基础开源数据可视化平台 FlyFish 大屏开发指南
携手三星,vivo将推Exynos980双模5G手机!
被“赶出”比特大陆之后,詹克团首度发声:将通过法律途径尽快回归!
[MIT 6.S081] Lec 4: Page tables 笔记
国巨斥资18亿美元收购竞争对手Kemet,交易或在明年下半年完成