6.828:Opertate System Engineering Fall 2018

课程链接:https://pdos.csail.mit.edu/6.828/2018/schedule.html

最新版课程链接:https://pdos.csail.mit.edu/6.828

课程仓库:https://pdos.csail.mit.edu/6.828/2018/jos.git

参考资料:https://pdos.csail.mit.edu/6.828/2018/reference.html

未完待续~~~


Lecture

Lecture1 Operating Systems

The purpose of an O/S

  • Support applications
  • Abstract the hardware for convenience and portability
  • Multiplex the hardware among multiple applications
  • Isolate applications in order to contain bugs
  • Allow sharing among applications
  • Provide high performance

Lecture2 PC hardware and x86 programming

EIP

  1. EIP is incremented after each instruction
  2. Instructions are different length
  3. EIP modified by CALL, RET, JMP, and conditional JMP

Registers

8个32-bit通用寄存器:%eax, %ebx, %ecx, %edx, %edi, %esi, %ebp, %esp
(32-bit可分为16-bit如%ax, %bx,16-bit可分为8bit如%al和%ah)

1个32-bit程序计数器:%eip

1个80-bit浮点寄存器

控制寄存器:%cr0, %cr2, %cr3, %cr4

调试寄存器:%dr0, %dr1, %dr2, %dr3

段寄存器:%cs, %ds, %es, %fs, %gs, %ss

全局和局部描述符表伪寄存器:%gdtr, %ldtr

Memory

movl %eax, %edx             edx = eax                                     register mode
movl $0x123, %edx           edx = 0x123                                   immediate
movl 0x123, %edx            edx = *(int32_t*)0x123                        direct
movl (%ebx), %edx           edx = *(int32_t*)ebx                          indirect
movl 4(%ebx), %edx          edx = *(int32_t*)(ebx+4)                      displaced

Stack memory

pushl %eax = subl $4, %esp & movl %eax, (%esp)
popl %eax = movl (%esp), %eax & addl $4, %esp
call 0x12345 = pushl %eip(*) & movl $0x12345, %eip(*)
ret = popl %eip(*)

I/0 space and instructions

inb/outb

Memory-mapped I/O

GCC calling conventions

int main(void) {return f(8)+1; }
int f(int x) {return g(x); }
int g(int x) {return x+3; }
_main:
	(prologue)
	pushl %ebp
	movl %esp, %ebp
	(body)
	pushl $8
	call _f
	addl $1, %eax
	(epilogue)
	movl %ebp, %esp
	popl %ebp
	ret
_f:
	(prologue)
	pushl %ebp
	movl %esp, %ebp
	(body)
	pushl 8(%esp)
	call _g
	(epilogue)
	movl %ebp, %esp
	popl %ebp
	ret
_g:
	(prologue)
	pushl %ebp
	movl %esp, %ebp
	(save %ebx)
	pushl %ebx
	(body)
	movl 8(%ebp), %ebx
	addl $3, %ebx
	movl %ebx, %eax
	(restore %ebx)
	popl %ebx
	(epilogue)
	movl %ebp, %esp
	popl %ebp
	ret	

Lecture3 C and gdb

Lecture4 Shell & OS organization

xv6 follows a traditional design: all of the OS runs in kernel mode
microkernel design
exokernel

Lecture5 Isolation mechanisms

Lecture6 Virtual Memory (1)

Lecture7 Virtual Memory (2)

UVPT/UVPD

Lecture8 Interrupts, System calls, and Exceptions

Lecture9 Multiprocessors and locking

Lecture10 Processes, threads, and scheduling

xv6 solution:

1 user thread and 1 kernel thread per process
1 scheduler thread per processor
xv6 has lots of kernel threads sharing the single kernel address space
xv6 has only one user thread per process

Overview of xv6 processing switching:

  1. user -> kernel thread (via system call or timer)
  2. kernel thread yields, due to pre-emption or waiting for I/O
  3. kernel thread -> scheduler thread
  4. scheduler thread finds a RUNNABLE kernel thread
  5. scheduler thread -> kernel thread
  6. kernel thread -> user

Lab

6.828:Lab1 Booting a PC 实验总结
6.828:Lab2 Memory Management 实验总结
6.828:Lab3 User Environments 实验总结
6.828:Lab4 Preemptive Multitasking 实验总结
6.828:Lab5 File system, Spawn and Shell 实验总结
6.828:Lab6 Network Driver 实验总结

Homework

6.828:Homework 总结

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值