Contents of /tags/mkinitrd-6_3_4/isolinux/layout.inc
Parent Directory | Revision Log
Revision 1189 -
(show annotations)
(download)
Thu Dec 16 01:27:43 2010 UTC (13 years, 9 months ago) by niro
File size: 4078 byte(s)
Thu Dec 16 01:27:43 2010 UTC (13 years, 9 months ago) by niro
File size: 4078 byte(s)
tagged 'mkinitrd-6_3_4'
1 | ; ----------------------------------------------------------------------- |
2 | ; |
3 | ; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved |
4 | ; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin |
5 | ; |
6 | ; This program is free software; you can redistribute it and/or modify |
7 | ; it under the terms of the GNU General Public License as published by |
8 | ; the Free Software Foundation, Inc., 53 Temple Place Ste 330, |
9 | ; Bostom MA 02111-1307, USA; either version 2 of the License, or |
10 | ; (at your option) any later version; incorporated herein by reference. |
11 | ; |
12 | ; ----------------------------------------------------------------------- |
13 | |
14 | ; |
15 | ; layout.inc |
16 | ; |
17 | ; Memory layout of segments |
18 | ; |
19 | |
20 | ; Default to 16-bit code |
21 | bits 16 |
22 | |
23 | ; Memory below 0800h is reserved for the BIOS and the MBR. |
24 | BSS_START equ 0800h |
25 | |
26 | ; Text starts at the load address of 07C00h. |
27 | TEXT_START equ 7C00h |
28 | |
29 | ; |
30 | ; Stack layout |
31 | ; |
32 | ; PXELINUX: There are apparently some AMI BIOSes in the field which |
33 | ; put their BEV stack somewhere below 7C00h (and therefore don't |
34 | ; handle localboot properly), so avoid that immediate memory region. |
35 | ; The range that is known to be bad is approximately 75E8..7C00; the |
36 | ; lower bound is tight. |
37 | ; |
38 | global STACK_LEN, STACK_TOP, STACK_BASE |
39 | STACK_LEN equ 4096 |
40 | %if IS_PXELINUX |
41 | STACK_TOP equ 7000h |
42 | %else |
43 | STACK_TOP equ 7c00h |
44 | %endif |
45 | STACK_BASE equ STACK_TOP - STACK_LEN |
46 | |
47 | ; The secondary BSS section, above the text; we really wish we could |
48 | ; just make it follow .bcopy32 or hang off the end, |
49 | ; but it doesn't seem to work that way. |
50 | LATEBSS_START equ 0B800h |
51 | |
52 | ; |
53 | ; The various sections and their relationship |
54 | ; |
55 | ; Use .earlybss for things that MUST be in low memory. |
56 | section .earlybss nobits |
57 | section .config write progbits align=4 |
58 | section .replacestub exec write progbits align=16 |
59 | |
60 | ; Use .bss for things that doesn't have to be in low memory; |
61 | ; with .bss1 and .bss2 to offload. .earlybss should be used |
62 | ; for things that absolutely have to be below 0x7c00. |
63 | section .bss write nobits align=16 |
64 | |
65 | %if 0 ; IS_PXELINUX |
66 | ; Warning here: RBFG build 22 randomly overwrites |
67 | ; memory location [0x5680,0x576c), possibly more. It |
68 | ; seems that it gets confused and screws up the |
69 | ; pointer to its own internal packet buffer and starts |
70 | ; writing a received ARP packet into low memory. |
71 | section .rbfg write nobits |
72 | RBFG_brainfuck: resb 2048 ; Bigger than an Ethernet packet... |
73 | %endif |
74 | |
75 | section .bss2 write nobits align=16 |
76 | |
77 | section .text exec write progbits align=16 |
78 | section .bcopyxx exec write progbits align=16 |
79 | section .data write progbits align=16 |
80 | |
81 | section .adv write nobits align=512 |
82 | |
83 | ; .uibss contains bss data which is guaranteed to be |
84 | ; safe to clobber during the loading of the image. This |
85 | ; is because while loading the primary image we will clobber |
86 | ; the spillover from the last fractional sector load. |
87 | section .uibss write nobits align=16 |
88 | |
89 | ; Normal bss... |
90 | section .bss1 write nobits align=16 |
91 | |
92 | ; Symbols from linker script |
93 | %macro SECINFO 1 |
94 | extern __%1_start, __%1_lma, __%1_end |
95 | extern __%1_len, __%1_dwords |
96 | %endmacro |
97 | SECINFO config |
98 | SECINFO replacestub |
99 | |
100 | global _start |
101 | |
102 | section .text |
103 | |
104 | ; |
105 | ; Segment assignments in the bottom 640K |
106 | ; Keep the low-memory footprint as small as possible... overrun is a hard |
107 | ; failure! |
108 | ; |
109 | ; 0000h - main code/data segment (and BIOS segment) |
110 | |
111 | xfer_buf_seg equ 1000h |
112 | aux_seg equ 2000h |
113 | |
114 | serial_buf_size equ 4096 ; Should be a power of 2 |
115 | |
116 | ; |
117 | ; Contents of aux_seg |
118 | ; |
119 | struc aux |
120 | .fontbuf resb 8192 |
121 | .serial resb serial_buf_size |
122 | |
123 | alignb 4096 ; Align the next segment to 4K |
124 | endstruc |
125 | |
126 | aux_seg_end equ aux_seg + (aux_size >> 4) |
127 | |
128 | ; |
129 | ; Bounce buffer for I/O to high mem |
130 | ; Note: we keep all the segments page-aligned, even if that probably |
131 | ; is somewhat excessive. Sector alignment is obligatory, however. |
132 | ; |
133 | |
134 | %if IS_ISOLINUX |
135 | ; ISOLINUX doesn't have a block cache yet |
136 | real_mode_seg equ aux_seg_end |
137 | %else |
138 | cache_seg equ aux_seg_end ; 64K area for metadata cache |
139 | real_mode_seg equ cache_seg + 1000h |
140 | |
141 | pktbuf_seg equ cache_seg ; PXELINUX packet buffers |
142 | %endif |
143 | |
144 | comboot_seg equ real_mode_seg ; COMBOOT image loading zone |