📄 read.me
字号:
read.me for bootf02.zip
Version 2.0, May 1, 1999
Sample code
by John S. Fine johnfine@erols.com
I do not place any restrictions on your use of this source code
I do not provide any warranty of the correctness of this source code
_____________________________________________________________________________
BOOTF.ASM is a coding sample for a bootstrap for a pmode operating system.
It is also a coding sample for cramming lots of operations into very little
code. The boot code on a FAT diskette or FAT partition is limited to 0x1C0
bytes (0x3E bytes are reserved at the beginning and 0x2 at the end of a 0x200
byte sector). BOOTF.ASM fits with 0x1A bytes to spare. In just 0x1A6 bytes of
code and data it:
1) Enables the A20 gate.
2) Switches to big real mode
3) Computes the locations of the FAT, the root directory and the first cluster.
4) Reads in the root directory
5) Scans the root directory for a specific file (KERNEL.BIN in the example)
6) Reads in the FAT
7) Reads the file (KERNEL.BIN) to RAM starting at physical 1Mb.
8) Builds two page tables and one page directory mapping:
a) The first 4Mb linear to the first 4Mb physical
b) Linear FF800000 (where all my protected mode images start) to physical
RAM starting at 1Mb
c) Self map the page directory to the end of linear memory
9) Switch to protected mode with paging turned on
10) JMP to KERNEL.BIN at linear FF800000
_____________________________________________________________________________
Included in BOOTF02.ZIP:
READ.ME This file.
BOOTF.ASM Source code.
BOOTF.LNK JLOC control file for linking BOOTF.
BOOTF.BIN Prebuilt
BOOTF.BAT Commands to make BOOTF.BIN and install it on A:
GDT.INC Definitions for GDT (included by BOOTF.ASM).
GDT_OLD.INC Part of GDT.INC
GDT_NEW.INC Part of GDT.INC
KERNEL_C.C Source code for trivial C example of KERNEL.BIN
KERNEL_C.LNK JLOC control file for linking KERNEL_C
KERNEL_C.BAT Commands to make KERNEL_C.BIN and copy it to A:KERNEL.BIN
KERNEL_C.BIN Prebuilt
KERNEL_A.ASM Source code for trivial ASM example of KERNEL.BIN
KERNEL_A.BAT Commands to make KERNEL_A.BIN and copy it to A:KERNEL.BIN
KERNEL_C.BIN Prebuilt
Also required to rebuild and install:
NASM (I think version 0.95 or higher will work)
http://www.cryogen.com/Nasm/
(but I only tested with version 0.98)
http://www.erols.com/johnfine/#nasmj
JLOC
http://www.erols.com/johnfine/#jloc
PARTCOPY (pcopy02.zip contains partcopy.exe)
http://www.erols.com/johnfine/#partcopy
DJGPP (if you want to rebuild kernel_c)
http://www.delorie.com/djgpp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -