# # first.i86 - constants for assembler module for DOS boot loader # # Copyright (C) 1996-2003 Gero Kuhlmann # # 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 2 of the License, or # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # $Id: first.i86,v 1.1 2003/03/09 00:43:09 gkminix Exp $ # #==================================================================== # # Include some required files from the i386 runtime library # #include "ldrec.i86" #include "bootp.i86" # #==================================================================== # # Version of the resident area driver code. If the interrupt F8h # interface gets changed, this version number should get increased. # RES_VERSION .equ H'0002 # #==================================================================== # # Definitions for accessing the BIOS data area and other BIOS # and system data # BIOS_SEG .equ H'0040 # Segment of BIOS data area BIOS_SYSCNF .equ H'0010 # System configuration BIOS_BASEMEM .equ H'0013 # Free base memory in kB BIOS_FDSTAT .equ H'0041 # Floppy disk status byte BIOS_HDSTAT .equ H'0074 # Hard disk status byte DPB_SIZE .equ 11 # size of disk parameter block HMA_SIZE .equ 65 # size of HMA in kB I13_INT .equ H'13 * 4 # interrupt vector 13h I15_INT .equ H'15 * 4 # interrupt vector 15h I1E_INT .equ H'1E * 4 # interrupt vector 1Eh I2F_INT .equ H'2F * 4 # interrupt vector 2Fh IF1_INT .equ H'F1 * 4 # interrupt vector F1h IF8_INT .equ H'F8 * 4 # interrupt vector F8h # #==================================================================== # # Layout of disk boot sector # SECT_SIZE .equ 512 # sector size must be 512 bytes MAX_RD_SIZE .equ H'04000000 # max ramdisk size in bytes MAX_CYL_NUM .equ H'0400 # max number of cylinders MAX_SPT_NUM .equ H'003F # max number of sectors per track MAX_HD_NUM .equ H'0100 # max number of heads DISK_BPS .equ 11 # offset of bytes per sectors DISK_SECTS .equ 19 # offset of total number of sects DISK_SPT .equ 24 # offset of sectors per track DISK_HEADS .equ 26 # offset of number of heads DISK_BOOT .equ 36 # offset of disk ID to boot from PART_STATUS .equ H'01BE # offset of partition status PART_FRST_HEAD .equ H'01BF # offset of first head number PART_FRST_SECT .equ H'01C0 # offset of first sector number PART_FRST_CYL .equ H'01C1 # offset of first cylinder number PART_TYPE .equ H'01C2 # offset of partition id PART_LAST_HEAD .equ H'01C3 # offset of last head number PART_LAST_SECT .equ H'01C4 # offset of last sector number PART_LAST_CYL .equ H'01C5 # offset of last cylinder number PART_ABS_SECT .equ H'01C6 # offset of first sector number PART_SEC_NUM .equ H'01CA # offset of number of sectors PART_SIZE .equ 16 # size of one partition entry PART_ACTIVE .equ H'80 # indicates active partition PART_FAT12 .equ H'01 # indicates partition type PART_FAT16_SM .equ H'04 # indicates partition type PART_FAT16_LG .equ H'06 # indicates partition type BOOT_SIG_OFS .equ H'01FE # offset to boot signature BOOT_SIGNATURE .equ H'AA55 # boot signature BOOT_ID_FD .equ H'00 # BIOS id of floppy boot disk BOOT_ID_HD .equ H'80 # BIOS id of hard boot disk BOOT_OFFSET .equ H'7C00 # offset for boot block in segment 0 # #==================================================================== # # Vendor information for the boot rom image. These values have to be # identical to those in mknbi.h. # VENDOR_MAGIC .assignc "GK-mknbi-DOS" # vendor ID VENDOR_SIZE .equ 3 # size of vendor ID in dwords VENDOR_BOOTL .equ LOADER_TAG + 0 # tag for boot loader segment VENDOR_RAMDISK .equ LOADER_TAG + 1 # tag for ramdisk image # #==================================================================== # # Definitions for accessing the vendor data area in the load records. # BOOT_LD_SECNUM .equ 0 # offset of total number of sectors BOOT_LD_SPT .equ 4 # offset of sectors per track BOOT_LD_CYL .equ 6 # offset of number of cylinders BOOT_LD_HDNUM .equ 8 # offset of number of heads BOOT_LD_DRIVE .equ 10 # offset of boot drive ID BOOT_LD_NOHD .equ 11 # offset of no-hard-disk flag BOOT_FLAG_NORPL .equ B'00000001 # flag for not using INT2F RPL mode BOOT_FLAG_INT15 .equ B'00000010 # flag for using interrupt 15h BOOT_FLAG_KEEP .equ B'00000100 # flag to always keep driver in memory