原文 Assembler / なぜx86ではMBRが"0x7C00"にロードされるのか?(完全版)
感謝 descent 大大分享本文,隨便看隨便譯。本文不是逐句譯,同時也不是這方面的專家 (不管是語言或技術),用語不一或缺漏錯誤在所難免,歡迎自行 fork 修正指教
誰適合看本文?
對 x86 架構與組合語言有基礎認識,以及從 MBR 到載入 OS 這一段過程有興趣的人 (還有談到中斷向量或 INT xxx 時不會一臉茫然的人)
| ;Made by FeDOS (FeDOS SubSystems) | |
| ;All Rights Reserved | |
| ;FeDOS (ICQ 313-997-813) | |
| [BITS 16] | |
| [ORG 0x0000] | |
| __start: | |
| ; mov cx, 0xB800 | |
| ; mov es, cx | |
| ; mov bx, 0h | |
| ; mov cx, cs |
| /* | |
| * This program is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation, either version 3 of the License, or | |
| * (at your option) any later version. | |
| */ | |
| #include <arpa/inet.h> | |
| #include <linux/if_packet.h> | |
| #include <stdio.h> |
原文 Assembler / なぜx86ではMBRが"0x7C00"にロードされるのか?(完全版)
感謝 descent 大大分享本文,隨便看隨便譯。本文不是逐句譯,同時也不是這方面的專家 (不管是語言或技術),用語不一或缺漏錯誤在所難免,歡迎自行 fork 修正指教
誰適合看本文?
對 x86 架構與組合語言有基礎認識,以及從 MBR 到載入 OS 這一段過程有興趣的人 (還有談到中斷向量或 INT xxx 時不會一臉茫然的人)
| main.out: main.o map.o | |
| g++ main.o map.o -o main.out | |
| main.o: main.c | |
| gcc -c main.c -o main.o | |
| map.o: map.cpp | |
| g++ -c map.cpp -o map.o | |
| clean: |