1
OUTPUT_FORMAT("pe-i386", "pe-i386", "pe-i386")
14
__prefix_size = __prefix_end - __prefix_start;
24
__compressed_end = . ;
26
__compressed_size = __compressed_end - __compressed;
32
/* Size of the core of etherboot in memory */
33
__base_size = __end - __text;
35
/* _prefix_size is the length of the non-core etherboot prefix */
36
__prefix_size = __prefix_end - __prefix_start;
38
/* _verbatim_size is the actual amount that has to be copied to base memory */
39
__verbatim_size = __verbatim_end - __verbatim_start;
41
/* _image_size is the amount of base memory needed to run */
42
__image_size = __base_size + __prefix_size;
44
/* Standard sizes rounded up to paragraphs */
45
__prefix_size_pgh = (__prefix_size + 15) / 16;
46
__verbatim_size_pgh = (__verbatim_size + 15) / 16;
47
__image_size_pgh = (__image_size + 15) / 16 ;
49
/* Standard sizes in sectors */
50
__prefix_size_sct = (__prefix_size + 511) / 512;
51
__verbatim_size_sct = (__verbatim_size + 511) / 512;
52
__image_size_sct = (__image_size + 511) / 512;
54
/* Symbol offsets and sizes for the exe prefix */
56
__exe_size = __verbatim_size; /* Should this be - 32 to exclude the header? */
57
__exe_size_tail = (__exe_size) % 512;
58
__exe_size_pages = ((__exe_size) + 511) / 512;
59
__exe_bss_size = ((__image_size - __verbatim_size) + 15) / 16;
60
__exe_ss_offset = (__stack_offset + __prefix_size - __exe_hdr_size + 15) / 16 ;
62
/* This is where we copy the compressed image before decompression.
63
* Prepare to decompress in place. The end mark is about 8.25 bytes long,
64
* and the worst case symbol is about 16.5 bytes long. Therefore
65
* We need to reserve at least 25 bytes of slack here.
66
* Currently I reserve 2048 bytes of just slack to be safe :)
67
* 2048 bytes easily falls within the BSS (the defualt stack is 4096 bytes)
68
* so we really are decompressing in place.
70
* Hmm. I missed a trick. In the very worst case (no compression)
71
* the encoded data is 9/8 the size as it started out so to be completely
72
* safe I need to be 1/8 of the uncompressed code size past the end.
73
* This will still fit compfortably into our bss in any conceivable scenario.
75
__compressed_copy = __edata + __prefix_size - __compressed_size +
76
/* The amount to overflow _edata */
77
MAX( ((__edata - __text + 7) / 8) , 2016 ) + 32;
78
__assert = ASSERT( ( __compressed_copy - __prefix_size ) < __ebss , "Cannot decompress in place" ) ;
80
_decompress = DEFINED(_decompress) ? _decompress : 0;
86
/* Symbols used by the prefixes whose addresses are inconvinient
87
* to compute, at runtime in the code.
89
_image_basemem_size = DEFINED(_image_basemem_size)? _image_basemem_size : 65536;
90
_image_basemem = DEFINED(_image_basemem)? _image_basemem : 65536;
91
__prefix_real_to_prot = __real_to_prot + __prefix_size ;
92
__prefix_prot_to_real = __prot_to_real + __prefix_size ;
93
__prefix_image_basemem_size = _image_basemem_size + __prefix_size ;
94
__prefix_image_basemem = _image_basemem + __prefix_size ;
95
__prefix_rm_in_call = __rm_in_call + __prefix_size ;
96
__prefix_in_call = __in_call + __prefix_size ;
97
__prefix_rom = _rom + __prefix_size ;
98
__prefix_rm_etherboot_location = _rm_etherboot_location + __prefix_size ;
99
__prefix_stack_end = __stack_end + __prefix_size ;