<aside> 💡 Author: 李纪 Student No.1711342

</aside>

吐槽及难点环节

  1. cprintf vs printf

    What is the difference between cprintf and printf?

  2. 下面的这段代码为什么是 “+2”?

  1. MOOCOS 里的 GCC 默认使用 C99 标准编译
  1. 一个之前未见到过的用法:C 语言变量声明加冒号的用法
/* Gate descriptors for interrupts and traps */
struct gatedesc {
    unsigned gd_off_15_0 : 16;        // low 16 bits of offset in segment
    unsigned gd_ss : 16;            // segment selector
    unsigned gd_args : 5;            // # args, 0 for interrupt/trap gates
    unsigned gd_rsv1 : 3;            // reserved(should be zero I guess)
    unsigned gd_type : 4;            // type(STS_{TG,IG32,TG32})
    unsigned gd_s : 1;                // must be 0 (system)
    unsigned gd_dpl : 2;            // descriptor(meaning new) privilege level
    unsigned gd_p : 1;                // Present
    unsigned gd_off_31_16 : 16;        // high bits of offset in segment
};

  1. 其他大难点(不算坑)
  1. 其他小难点(不算坑)

各类练习的简要报告(特别粗糙,可以不看了)(纯自用,无详细介绍)

Copy of 练习 1:理解通过 make 生成执行文件的过程。

Copy of 练习 2:使用 qemu 执行并调试 lab1 中的软件

Copy of 练习 3:分析 bootloader 进入保护模式的过程。

Copy of 练习 4:分析 bootloader 加载 ELF 格式的 OS 的过程。