MIT 6.828 Operating System Engineering HW: Boot xv6

这篇博客详细解析了MIT 6.828课程作业中关于xv6操作系统启动过程的问题,包括栈指针初始化、bootmain调用时的栈状态、bootmain第一条指令的作用以及call指令改变eip到0x10000c时对栈的操作。通过GDB调试,揭示了从ROM到bootloader再到kernel的启动流程,并分析了内核启动时栈中的数据来源。
摘要由CSDN通过智能技术生成

HW Boot xv6

参考
https://www.cnblogs.com/wuhualong/p/6828_homework01_boot_xv6.html
在 lab1 中我们知道了 pc 的上电启动顺序。
问题如下

  • Begin by restarting qemu and gdb, and set a break-point at 0x7c00, the start of the boot block (bootasm.S). Single step through the instructions (type si at the gdb prompt). Where in bootasm.S is the stack pointer initialized? (Single step until you see an instruction that moves a value into %esp, the register for the stack pointer.)
  • Single step through the call to bootmain; what is on the stack now?
  • What do the first assembly instructions of bootmain do to the stack? Look for bootmain in bootblock.asm.
  • Continue tracing via gdb (using breakpoints if necessary – see hint below) and look for the call that changes eip to 0x10000c. What does that call do to the stack? (Hint: Think about what th
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值