00001 /* 00002 * HT Editor 00003 * fltstruc.h 00004 * 00005 * Copyright (C) 2003 Sebastian Biallas (sb@biallas.net) 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License version 2 as 00009 * published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __FLTSTRUC_H__ 00022 #define __FLTSTRUC_H__ 00023 00024 #include "global.h" 00025 00026 #define FLTMAG0 'b' 00027 #define FLTMAG1 'F' 00028 #define FLTMAG2 'L' 00029 #define FLTMAG3 'T' 00030 00031 struct flat_hdr { 00032 byte magic[4]; /* bFLT magic */ 00033 dword version; /* binfmt_flat version */ 00034 dword entry; /* Offset of first executable instruction with text segment from beginning of file*/ 00035 dword data_start; /* Offset of data segment from beginning of file*/ 00036 dword data_end; /* Offset of end of data segment from beginning of file*/ 00037 dword bss_end; /* Offset of end of bss segment from beginning of file*/ 00038 /* (It is assumed that data_end through bss_end for bss segment.) */ 00039 dword stack_size; /* Size of stack, in bytes */ 00040 dword reloc_start; /* Offset of relocation records from beginning of file */ 00041 dword reloc_count; /* Number of relocation records */ 00042 dword filler[7]; /* Reservered, set to zero */ 00043 }; 00044 00045 #define FLAT_RELOC_TYPE_TEXT 0 00046 #define FLAT_RELOC_TYPE_DATA 1 00047 #define FLAT_RELOC_TYPE_BSS 2 00048 00049 struct flat_reloc { 00050 dword value; /* 2: type, 30: offset */ 00051 }; 00052 00053 extern byte FLAT_HEADER_struct[20]; 00054 00055 #endif /* __FLTSTRUC_H__ */