2 ** Portions Copyright 2001-2004, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
7 ** Copyright 1998 Brian J. Swetland
8 ** All rights reserved.
10 ** Redistribution and use in source and binary forms, with or without
11 ** modification, are permitted provided that the following conditions
13 ** 1. Redistributions of source code must retain the above copyright
14 ** notice, this list of conditions, and the following disclaimer.
15 ** 2. Redistributions in binary form must reproduce the above copyright
16 ** notice, this list of conditions, and the following disclaimer in the
17 ** documentation and/or other materials provided with the distribution.
18 ** 3. The name of the author may not be used to endorse or promote products
19 ** derived from this software without specific prior written permission.
21 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 #ifndef _NEWOS_BOOT_H_
34 #define _NEWOS_BOOT_H_
36 #define BOOTDIR_NAMELEN 96
37 #define BOOTDIR_MAX_ENTRIES 128
38 #define BOOTDIR_DIRECTORY "SBBB/Directory"
41 char be_name
[BOOTDIR_NAMELEN
]; /* name of loaded object, zero terminated */
42 int be_offset
; /* offset of object relative to the start of boot_dir */
43 int be_type
; /* object type designator */
44 int be_size
; /* size of loaded object (pages) */
45 int be_vsize
; /* size loaded object should occupy when mapped in */
53 boot_entry bd_entry
[BOOTDIR_MAX_ENTRIES
];
56 /* void _start(uint32 mem, char *params, boot_dir *bd); */
58 #define BE_TYPE_NONE 0 /* empty entry */
59 #define BE_TYPE_DIRECTORY 1 /* directory (entry 0) */
60 #define BE_TYPE_BOOTSTRAP 2 /* bootstrap code object (entry 1) */
61 #define BE_TYPE_CODE 3 /* executable code object */
62 #define BE_TYPE_DATA 4 /* raw data object */
63 #define BE_TYPE_ELF32 5 /* 32bit ELF object */
64 #define BE_TYPE_ELF64 6 /* 64bit ELF object */
66 /* for BE_TYPE_CODE */
67 #define be_code_vaddr be_extra0 /* virtual address (rel offset 0) */
68 #define be_code_ventr be_extra1 /* virtual entry point (rel offset 0) */