-
Notifications
You must be signed in to change notification settings - Fork 2
Home
BIOS -> Legacy BIOS, UEFI BIOS BootLoader -> Grub(單階段啟動), Uboot(兩階段啟動,嵌入式專用)
BIOS將Boot Loader(原本MBR內)載入到記憶體(RAM)後,並將控制權給 Boot Loader Boot Loader 準備把 Kernel image 從硬碟讀到記憶體中,接者跳轉到Kernel的入口點執行,開始啟動作業系統
OVMF(Open Virtual Machine Firmware),提供QEMU拿來做為虛擬機的UEFI BIOS
ORG
: Binary File Program Origin
$
evaluates to the assembly position at the beginning of the line containing the expression
. $$
evaluates to the beginning of the current section
; so you can tell how far into the section you are by using ($-$$)
.
$ means "address of here".
$$ means "address of start of current section".
So
https://en.wikipedia.org/wiki/Master_boot_record#PTE
https://en.wikipedia.org/wiki/INT_13H
https://en.wikipedia.org/wiki/E820\ https://wiki.osdev.org/Detecting_Memory_(x86)
http://vitaly_filatov.tripod.com/ng/asm/asm_023.1.html
segment:offset = logical address (16-bit) in real mode
segment * 16 + offset = physical address (20-bit) in real mode
CS:IP (CS is Code Segment, IP is Instruction Pointer) points to the address where the processor will fetch the next byte of code.
SS:SP (SS is Stack Segment, SP is Stack Pointer) points to the address of the top of the stack
DS:SI (DS is Data Segment, SI is Source Index) is often used to point to string data that is about to be copied to ES:DI.
ES:DI (ES is Extra Segment, DI is Destination Index) is typically used to point to the destination for a string copy
https://wiki.osdev.org/GDT
http://www.brokenthorn.com/Resources/OSDev8.html
進入保護模式(一):加載GDTR
segment descriptor:offset
https://www.cnblogs.com/lanrenxinxin/p/4735027.html
https://zhuanlan.zhihu.com/p/152119007 \
https://stenlyho.blogspot.com/2008/08/pic.html
https://wiki.osdev.org/8259_PIC
https://wiki.osdev.org/Programmable_Interval_Timer
https://www.csie.ntu.edu.tw/~wcchen/asm98/asm/proj/b85506061/chap3/privilege.html
https://stackoverflow.com/a/36631763/5321961
The RPL is intended to represent the privilege level of the procedure that originates a selector.
An internal processor register records the current privilege level (CPL).
Normally the CPL is equal to the DPL of the segment that the processor is currently executing.
https://en.wikipedia.org/wiki/FLAGS_register
https://wiki.osdev.org/Task_State_Segment
鳥哥 - 第十九章、開機流程、模組管理與 Loader
*Writing a Bootloader Part 1
osdev
nasm tutorial
64bit-os-tutorial
A bare metal hello world in C for Risc-V using QEMU to test
使用 UEFI
使用 Grub
Grub2 and UEFI
eBPF aya
refactor some asm codes to C codes (e.g. gdt, tss, pic, pit...)
APCI
add create/update/delete method to FAT16
add sub folders support to FAT16
FAT 32
EXT 2/3
syscall: fork/open/close/exec/read/wait_pid
add move cursor in text mode
network driver
mouse driver
audio driver
usb driver
add Symmetric Multi-Processing (SMP)
add Bad Apple demo
add scrolling
add cursor moving
add more commands
modify examples/process into fork and exec and observing the context switch