Kennem's Blog
  • 🏠主页
  • 🔍搜索
  • 📚文章
  • ⏱时间轴
  • 🔖标签
  • 🗂️分类
  • 🙋🏻‍♂️关于
主页 » 📚文章

💻技术

MIT6.S081(9)-Interrupts

MIT6.S081(9)-Interrupts 6.S081 2020 Lecture 9: Interrupts Interrupts hardware wants attention now! e.g., pkt arrived, clock interrupt software must set aside current work and respond on RISC-V use same trap mechanism as for syscalls and exceptions new issues/complications: asynchronous interrupts running process interrupt handler may not run in context of process who caused interrupt concurrency devices and process run in parallel programming devices device can be difficult to program Where do...

2024-09-18 · 3 分钟 · 1303 字 · updated: 2024-09-18 · ShowGuan

MIT6.S081(8)-Page faults

MIT6.S081(8)-Page faults plan: cool things you can do with vm Better performance/efficiency e.g., one zero-filled page e.g., copy-on-write fork New features e.g., memory-mapped files virtual memory: several views primary purpose: isolation each process has its own address space Virtual memory provides a level-of-indirection provides kernel with opportunity to do cool stuff already some examples: shared trampoline page guard page but more possible… Key idea: change page tables on page fault...

2024-09-17 · 2 分钟 · 958 字 · updated: 2024-09-17 · ShowGuan

LeetCode周赛415(250915)

周赛250915 时隔多日再才重新开启周赛。这场DP居多。 T2-3290. 最高乘法得分 题目大意: 给定两个数组 a 和 b,数组 a 长度为 4,数组 b 长度至少为 4。需要...

2024-09-17 · 2 分钟 · 997 字 · updated: 2024-09-17 · ShowGuan

MIT6.S081(7)-Q&A

MIT6.S081(7)-Q&A Plan: answering your questions Approach: walk through staff solutions start with pgtbl lab because it was the hardest your questions are at bottom of this file Pgtbl lab comments few lines of code, but difficult-to-debug bugs worst case: qemu/xv6 stops running “best” case: kernel panic hard to debug for staff too there are so many possible reasons why you discovered once we hadn’t seen yet likely to be the...

2024-09-12 · 6 分钟 · 2628 字 · updated: 2024-09-12 · ShowGuan

MIT6.S081(6)-System Call Entry/Exit

MIT6.S081(6)-System Call Entry/Exit Today: user -> kernel transition system calls, faults, interrupts enter the kernel in the same way important for isolation and performance lots of careful design and important detail What needs to happen when a program makes a system call, e.g. write()? [CPU | user/kernel diagram] CPU resources are set up for user execution (not kernel) 32 registers, sp, pc, privilege mode, satp, stvec, sepc, … what needs...

2024-09-10 · 7 分钟 · 3445 字 · updated: 2024-09-10 · ShowGuan

MIT6.S081(5)-RISC-V calling convention, stack frames, and gdb

MIT6.S081(5)-RISC-V calling convention, stack frames, and gdb C code is compiled to machine instructions. How does the machine work at a lower level? How does this translation work? How to interact between C and asm Why this matters: sometimes need to write code not expressible in C And you need this for the syscall lab! RISC-V abstract machine No C-like control flow, no concept of variables, types … Base ISA:...

2024-09-04 · 5 分钟 · 2064 字 · updated: 2024-09-04 · ShowGuan

C 语言指针

C 语言指针 C语言中的内存 静态内存(Static Memory) Global variables, accessible throughout the whole program. Defined with static keywork, as well as variables defined in global scope. 栈内存(Stack Memory) Local variables with functions. Destroyed after function exits. 堆内存(Heap M...

2024-09-03 · 7 分钟 · 3219 字 · updated: 2024-09-03 · ShowGuan

MIT6.S081(4)-Virtual Memory

MIT6.S081(4)-Virtual Memory Plan: Address spaces Paging hardware xv6 VM code Virtual memory overview Today’s problem: [user/kernel diagram] [memory view: diagram with user processes and kernel in memory] Suppose the shell has a bug: sometimes it writes to a random memory address how can we keep it from wrecking the kernel? and from wrecking other processes? we want isolated address spaces each process has its own memory it can read and...

2024-09-02 · 12 分钟 · 5742 字 · updated: 2024-09-02 · ShowGuan

MIT6.S081(1)-O/S overview

MIT6.S081(1)-O/S overview Class Page Overview 6.S081 goals Understand operating system (O/S) design and implementation Hands-on experience extending a small O/S Hands-on experience writing systems software What is the purpose of an O/S? Abstract the hardware for convenience and portability Multiplex the hardware among many applications Isolate applications in order to contain bugs Allow sharing among cooperating applications Control sharing for security Don’t get in the way of high performance Support...

2024-08-31 · 12 分钟 · 5897 字 · updated: 2024-08-31 · ShowGuan

MIT6.S081(3)-OS organization

MIT6.S081(3)-OS organization Lecture Topic: OS design ​ system calls ​ micro/monolithic kernel First system call in xv6 OS picture apps: sh, echo, … system call interface (open, close,…) OS Goal of OS run multiple applications isolate them multiplex them share Strawman design: No OS Application directly interacts with hardware CPU cores & registers DRAM chips Disk blocks … OS library perhaps abstracts some of it Strawman design not conducive to...

2024-08-31 · 4 分钟 · 1800 字 · updated: 2024-08-31 · ShowGuan

Kotlin协程(4)

Kotlin协程(4) Kotlin实践部分 Flow与文件下载应用 DownloadFragment.kt // DownloadFragment 是一个 Fragment 类,用于处理文件下载任务 class DownloadFragment : Fragment() { // 定义下载文件的 URL 地址,这是...

2024-08-25 · 10 分钟 · 4536 字 · updated: 2024-08-27 · ShowGuan

Git

Git git 由 linus 开发。 Git流程图 clone(克隆)): 从远程仓库中克隆代码到本地仓库 checkout(检出):从本地仓库中检出一个仓库分支然后进行...

2024-08-20 · 9 分钟 · 4449 字 · updated: 2024-08-20 · ShowGuan

Kotlin协程(3)

Kotlin协程(3) 操作符 过渡流操作符 可以使用操作符转换符,就像使用集合与序列一样 过渡操作符应用于上游流,并返回下游流。 这些操作符也是冷操...

2024-08-13 · 10 分钟 · 4549 字 · updated: 2024-08-13 · ShowGuan

Kotlin协程(2)

Kotlin协程(2) 异常处理的必要性 @OptIn(ExperimentalStdlibApi::class) // 标记该代码使用了实验性标准库 API @Test // 表示这是一个测试函数 fun `test CoroutineContext extend2`() = runBlocking { // 使用 runBlocking 启动协程 // 创建一个协程...

2024-08-09 · 11 分钟 · 5211 字 · updated: 2024-08-13 · ShowGuan

Kotlin协程(1)

Kotlin协程(1) 看明白,讲清楚。 协程处理的问题: 处理耗时任务, 这种任务常常会阻塞主线程 保证主线程安全,即确保安全的从主线程调用任何su...

2024-08-06 · 10 分钟 · 4801 字 · updated: 2024-08-13 · ShowGuan
« 上一页  下一页  »
© 2025 Kennem's Blog · Powered by Hugo & PaperMod
Visitors: Views: