6.828-Lab1

6.828 的 Lab1 之前用英文洋洋洒洒写了七万多字,稍显冗杂。这次使用 Linux 环境重新走一遍,并且改用中文记录。

Read more

6.828-Hw2-Shell

Homework: shell

Executing simple commands

Implementation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
case ' ':
ecmd = (struct execcmd *)cmd;
if (ecmd->argv[0] == 0)
_exit(0);
// Check if the file is executeable in pwd
if (access(ecmd->argv[0], X_OK) == 0)
{
execv(ecmd->argv[0], ecmd->argv);
}
else
{
// Check if the file is executeable in /bin/
// no support for PATHs
const char *binPath = "/bin/";
int pathLen = strlen(binPath) + strlen(ecmd->argv[0]);
char *path = (char *)malloc((pathLen + 1) * sizeof(char));
strcpy(path, binPath);
strcat(path, ecmd->argv[0]);
if (access(path, X_OK) == 0)
{
execv(path, ecmd->argv);
}
else
{
fprintf(stderr, "shell: command <%s> not found\n", ecmd->argv[0]);
}
}
break;
Read more

6.828-Hw1-Boot xv6

Homework: boot xv6

Exercise: What is on the stack

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.)

Read more

Disabling interrupts

Disabling Interrupts

When SeaBIOS is loading in QEMU, it will disable interrupts

1
2
3
4
5
6
7
8
10 0xfd15f: cli                        
11 0xfd160: cld
12 0xfd161: mov $0x8f, %eax
# Here to disable Maskable Hardware interrupts

13 0xfd167: out %al, $0x70
14 0xfd169: in $0x71, %al
# And disable Non-maskable Hardware interrupts
Read more

6.828-Lab1(old)

Lab 1: Booting a PC

Introduction

This lab is split into three parts. The first part concentrates on getting familiarized with x86 assembly language, the QEMU x86 emulator, and the PC’s power-on bootstrap procedure. The second part examines the boot loader for our 6.828 kernel, which resides in the boot directory of the lab tree. Finally, the third part delves into the initial template for our 6.828 kernel itself, named JOS, which resides in the kernel directory.

Read more

A20:历史的妥协

A20: 历史的妥协

今天看 MIT 6.828 中 JOS 的 Bootloader 部分,可以说是看几行代码查一小时资料了。

最近看英文文档比较多,中文社区这块相关的内容是在太过匮乏,还有不少错误,所以自己就来翻译一下。

Read more
Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×