I’ve been using Vim and some handy plugins for a while. Today when I was trying to use the “copy-to-clipboard” combo-key "+y
in Vim, I found that it didn’t work for me. After doing some Google search I realized that to use the “copy-to-clipboard” function the Vim has to enable GUI. However, the Vim on my computer didn’t support GUI:
MIT 6.828 Lab 4 - Preemptive Multitasking
Q1: Compare kern/mpentry.S side by side with boot/boot.S. Bearing in mind that kern/mpentry.S is compiled and linked to run above KERNBASE just like everything else in the kernel, what is the purpose of macro MPBOOTPHYS? Why is it necessary in kern/mpentry.S but not in boot/boot.S? In other words, what could go wrong if it were omitted in kern/mpentry.S?
A1: Macro MPBOOTPHYS
maps a virtual address (above KERNBASE) to be its physical address. It is needed because mpentry.S
is linked at high addresses but gets loaded by boot_aps()
at the low address MPENTRY_ADDR
. The bootloader doesn’t need a macro like this because it is linked and loaded at the same low address (0x00007c00
). You can verify this by running objdump -h obj/boot/boot.out
and comparing the VMA and LMA columns.
Zim - A Note-taking Tool on Linux
Installation on Linux
- Install Zim:
sudo apt install zim
- Install the syntax highlighting plugin
Source View
:sudo apt install python-gtksourceview2
Source View Plugin Usage
- Enable the Source View plugin:
Edit -> Preferences -> Plugins -> Check: Source View -> OK
- Insert a new code block:
Insert -> Code Block
Usage Tips
- <Ctrl>J: Jump to page… (either an existing or a new page)
- Enable the
Table of Contents
plugin to display the headings of the current article in a floating window on the top right corner.
Set Vim as Default Editor
- Go to
Edit -> Preferences -> Applications -> Set default text editor
, and then set it to Gvim. Now when you’re looking at a note, go toTools -> Edit Source
and you’ll open that note in Vim. - You can bind that to a keyboard shortcut, for example maybe
F4
. Search for keywordedit_page_source
in~/.config/zim/accelmap
and change the line to be:1(gtk_accel_path "<Actions>/GtkInterface/edit_page_source" "F4")
More info: http://zim-wiki.org/manual/Start.html
Lab3 - User Environments
Interrupts and exceptions are special kinds of control transfer; they work somewhat like unprogrammed CALLs. They alter the normal program flow to handle external events or to report errors or exceptional conditions. The difference between interrupts and exceptions is that interrupts are used to handle asynchronous events external to the processor, but exceptions handle conditions detected by the processor itself in the course of executing instructions.
Installation of Sogou Input on Linux/Ubuntu
- Download Sogou input from the link;
- Double click the downloaded file and install it;
- Navigate to “System Settings -> Language Support -> Keyboard input method system”, change the input method to be fcitx, and click on “Install / Remove Languages…” to install the Chinese input;
- Install fcitx:
sudo apt-get install fcitx fcitx-pinyin
; - Log out and re-login;
- If there are two input method panels when using the Sogou input, delete one of them by:
sudo apt remove fcitx-ui-qimpanel
.
MIT 6.828 Lab2 - Memory Management
The first PCs, which were based on the 16-bit Intel 8088 processor, were only capable of addressing 1MB of physical memory. The physical address space of an early PC would therefore start at 0x00000000
but end at 0x000FFFFF
instead of 0xFFFFFFFF
. The 640KB area marked “Low/Base Memory” was the only random-access memory (RAM) that an early PC could use.
MIT 6.828 Lab1 - Booting a PC (The Kernel)
Operating system kernels often like to be linked and run at very high virtual address, such as 0xf0100000
, in order to leave the lower part of the processor’s virtual address space for user programs to use. Many machines don’t have any physical memory at address 0xf0100000
, so we can’t count on being able to store the kernel there. Instead, we will use the processor’s memory management hardware to map virtual address 0xf0100000
(the link address at which the kernel code expects to run) to physical address 0x00100000
(where the boot loader loaded the kernel into physical memory).
MIT 6.828 Lab1 - Booting a PC (PC Bootstrap & Bootloader)
Boot-up procedure: ROM BIOS -> Boot Loader -> Kernel.
BIOS sets up an interrupt descriptor table and initializes various devices such as the VGA display. After initializing the PCI bus and all the important devices, it searches for a bootable device and loads the 512 byte boot sector into memory at physical addresses 0x7c00
through 0x7dff
, and then uses a jmp
instruction to set the CS:IP
to 0000:7c00
, passing control to the boot loader.
The boot loader switches the processor from real mode to 32-bit protected mode. It also reads the kernel from the hard disk by directly accesing the disk device registers via the x86’s special I/O instructions. Then it transfers control to the kernel.
MIT 6.828 HW - Boot xv6 & Shell
The homework solutions of mine were uploaded to here.
Installing tools
- Use
make && sudo make install
to compile QEMU, to avoid any permission error. - There is a
auto-loading
warning when launching GDB for the first time. Add a line to the.gdbinit
file according to the info below:1234567warning: File "/home/ylong/Desktop/hobby_project/abc/MIT/6.828/xv6-public/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".To enable execution of this file addadd-auto-load-safe-path /home/ylong/Desktop/hobby_project/abc/MIT/6.828/xv6-public/.gdbinitline to your configuration file "/home/ylong/.gdbinit".To completely disable this security protection addset auto-load safe-path /line to your configuration file "/home/ylong/.gdbinit".`
Create a Github blog with Hexo on Ubuntu 16.04
This very first blog article introduces how to deploy Hexo with Github. For detailed information about Hexo, see the official document page.
Installing Nodejs
|
|