⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 一个类linux的dos下开发的操作系统.
💻 TXT
字号:
Modular Boot Loader (MBL)       Release date: ???
Chris Giese <geezer@execpc.com>, http://www.execpc.com/~geezer/os

================================================================
SUPPORTED KERNEL TYPES
================================================================
32-bit pmode kernel file in one of the following formats:
- DJGPP COFF
- ELF (statically-linked)
- Win32 PE (statically-linked with "--image-base 0")
- Any of the above in RDSK format

The kernel will be loaded at address 00100000h (1 meg).
It must either
- be linked to run at address 1 meg, or
- use relative addressing until it relocates itself, or sets
  up paging, or sets up segment-based address translation.

RDSK is a simple initial RAM disk format. Compile and run file
RDSK.C in the UTIL/ directory to create RDSK files. The kernel
(same restrictions as above) must be the first object in the
RDSK file. If the loader detects a file in RDSK format, it will
store some data in the first 16 bytes of the kernel BSS. This is
for compatability with my own OS (Cosmos). If you don't want
this feature, change function copy_pmode_kernel() in file BOOT.C

The pmode kernel will be entered with all segment registers
pointing to descriptors with a base address of 0. The entry
point need not be the start of the file.

================================================================
OVERVIEW
================================================================

-- 16-bit code --

Nearly all of this boot code runs in real mode. GCC does not
build real mode code, so I am using Turbo C. Linux users may be
able to run Turbo C under DOSEMU. If you don't do DOS or DOSEMU,
you can wait until a native Linux version of Watcom C comes out:
	http://www.openwatcom.org
or maybe try using Dev86:
	http://www.cix.co.uk/~mayday/nf-home.html
I haven't used either of these compilers.

-- Boot code in the master boot record (MBR) --

No MBR boot code is supplied with this bootloader. (Such code
is not required for booting from floppy disks.) Use the MBR
installed on your hard disk by DOS FDISK. I don't know where
the MBR boot code comes from under Linux.

-- First-stage bootloader (in STAGE1/ directory) --

Files FAT16-HD.ASM and FAT12-F.ASM are first-stage bootloaders.
The code in these files is just smart enough to find the second-
stage bootloader in the root directory of the disk, load it into
memory, and run it.

FAT16-HD.ASM and FAT12-F.ASM are assembled to 512-byte files
FAT16-HD.BIN and FAT12-F.BIN (512 bytes is the size of one disk
sector). They are then installed in sector 0 (the boot sector)
of a hard disk partition or floppy disk.

Avoid changing the BIOS parameter block (BPB) in the existing
FAT boot sector when you install these files:

(DOS)
  partcopy     stage1\fat12-f.bin      0        3           -f0
  partcopy     stage1\fat12-f.bin     24      1DC           -f0      24

(Linux)
  dd size=1 if=stage1/fat12-f.bin skip=0  count=3   of=/dev/fd0
  dd size=1 if=stage1/fat12-f.bin skip=36 count=476 of=/dev/fd0 seek=36

These files are filesystem- and disk-specific: FAT12-F.BIN
should only be installed on a FAT12-formatted floppy disk, and
FAT16-HD.BIN should only be installed on a FAT16-formatted hard
disk partition.

Unfortunately, there is no ext2 code yet.

-- Second-stage loader (in STAGE2/ directory) --

LOADER.BIN is the second-stage bootloader. It is a real-mode
program compiled with the TINY memory model (code, data, and
stack in one 64K segment), and ORG'ed 100h. LOADER.BIN must be
copied to the root directory of the bootable partition or disk.

LOADER.BIN is both larger and smarter than the first-stage code.
It understands several types of filesystems, recognizes several
types of kernel file formats, knows how to enter protected mode,
etc. LOADER.BIN will load a pmode kernel from anywhere on a
floppy disk or primary hard disk partition; the kernel file need
not be in the root directory.

-- Memory usage --

real-mode interrupt vectors (IVT):      00000h-003FFh
BIOS data segment:                      00400h-004FFh
(unused memory):                        00500h-07B7Fh
first-stage variables:                  07B80h-07BFFh
first-stage code (512 bytes):           07C00h-07DFFh
first-stage stack:                      07E00h-07FFFh
first-stage buffers:                    08000h-085FFh
(unused memory):                        08600h-0FFFFh
default second-stage load address:      10000h-

================================================================
BUILD AND INSTALL
================================================================
You need these freely-available software tools:
   NASM:
	http://www.web-sites.co.uk/nasm/
   Turbo C 2.0 (registration required):
	http://community.borland.com/museum/
   DOS users will need John Fine's PARTCOPY (PCOPY):
	http://www.execpc.com/~geezer/johnfine

1.  Put a FAT- (DOS-)formatted floppy disk in drive A:
    1.44 meg and 1.68 meg disks have been tested.

2.  To build everything and make a bootable floppy disk, type
        make install

3.  xxx - todo

================================================================
GOTCHAS/BUGS/TO DO
================================================================
Loading big kernels is slow. (It's a cache problem -- one kernel
loads quickly from a 1.68 meg disk, but slowly from a 1.44 meg
disk.)

Huge pointer math is broken under Turbo C 3.0. There are some
macros that try to detect this compiler. The older Turbo C 2.0
and newer Borland C 3.1 seem to work OK.

The intr() function is buggy under Turbo C 2.0 (the BP register
is not handled correctly). There is a substitute intr() in
START.ASM

The open() function will overwrite the 'path' argument.

Using NASM to produce .OBJ files is perilous. Be careful when
changing any of the SEGMENT or GROUP statements in START.ASM.
Also, NASM seems to produce broken .OBJ files when asked to make
a page- (4K-)aligned segment.

This code does not support INT 13h LBA extensions. Large hard
disks (>8 gig) probably won't work.

Use INT 16h to set keyboard repeat rate to maximum.

Mmaybe store a magic value in a register or in the kernel BSS
to indicate that the kernel was booted from MBL

In START.ASM, use both INT 15h AH=89h and "raw" methods to enter
pmode

Align disk cache to 512-byte boundary to prevent INT 13h error 9

The loader is slow -- work on the caching code

Restore the menuing 2nd-stage code that lets you chose a
kernel file to be loaded, set the load address, etc.

Let kernels return to the bootloader

Load pmode kernel to conventional memory if too little
extended memory?

Load RDSK file to extended memory if too little conventional
memory?

Support compressed kernels

Make a DOS version (like LOAD.ASM)
    - use VCPI to switch to pmode when EMM386 is loaded
    - allocate extended memory via XMS
    - use DOS for filesystem functions

Support other filesystems in both first- and second-stages:
    - ext2 (Linux)
    - ffs (BSD)
    - iso9660 (CD-ROM)

Support other executable file formats:
    - real mode kernels: DOS .EXE (finish adding this)
    - a.out (BSD)
    - LE (Watcom executables)

First-stage code needs a BPB, even if the FAT filesystem is
not used. Write an install tool that creates a BPB.

Do INT 21h AX=4C01h instead of INT 19h if error and DOS defined

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -